diff --git a/chatbot.php b/chatbot.php new file mode 100644 index 0000000..73c5a6b --- /dev/null +++ b/chatbot.php @@ -0,0 +1,78 @@ + + + + + + Chatbot + + + +
+
+
+
+
+ + +
+
+ + + + \ No newline at end of file diff --git a/chatbot_api.php b/chatbot_api.php new file mode 100644 index 0000000..2fc6a2b --- /dev/null +++ b/chatbot_api.php @@ -0,0 +1,73 @@ + $credentialsPath + ]); + + // Format the session name + $session = $sessionsClient->sessionName($projectId, $sessionId); + + // Create a new text input + $textInput = new TextInput(); + $textInput->setText($text); + $textInput->setLanguageCode($languageCode); + + // Create a new query input + $queryInput = new QueryInput(); + $queryInput->setText($textInput); + + // Detect the intent + $response = $sessionsClient->detectIntent($session, $queryInput); + $queryResult = $response->getQueryResult(); + $fulfillmentText = $queryResult->getFulfillmentText(); + + // Close the sessions client + $sessionsClient->close(); + + return $fulfillmentText; + + } catch (Exception $e) { + // Return a generic error message + error_log($e->getMessage()); + return "Error processing your request."; + } +} + +// Get the user's message from the POST request +$data = json_decode(file_get_contents('php://input'), true); +$userMessage = $data['message'] ?? ''; +$sessionId = $data['sessionId'] ?? session_id(); // Use PHP session ID as Dialogflow session ID + +// Your Google Cloud Project ID +$projectId = 'chrivia-asxi'; + +// Get the bot's reply from Dialogflow +if (!empty($userMessage)) { + $botReply = detect_intent_texts($projectId, $userMessage, $sessionId); +} else { + $botReply = 'Please say something.'; +} + +// Return the bot's reply as JSON +echo json_encode(['reply' => $botReply]); \ No newline at end of file diff --git a/composer-setup.php b/composer-setup.php new file mode 100644 index 0000000..18df37f --- /dev/null +++ b/composer-setup.php @@ -0,0 +1,1781 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +setupEnvironment(); +process(is_array($argv) ? $argv : array()); + +/** + * Initializes various values + * + * @throws RuntimeException If uopz extension prevents exit calls + */ +function setupEnvironment() +{ + ini_set('display_errors', 1); + + if (extension_loaded('uopz') && !(ini_get('uopz.disable') || ini_get('uopz.exit'))) { + // uopz works at opcode level and disables exit calls + if (function_exists('uopz_allow_exit')) { + @uopz_allow_exit(true); + } else { + throw new RuntimeException('The uopz extension ignores exit calls and breaks this installer.'); + } + } + + $installer = 'ComposerInstaller'; + + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ($version = getenv('COMPOSERSETUP')) { + $installer = sprintf('Composer-Setup.exe/%s', $version); + } + } + + define('COMPOSER_INSTALLER', $installer); +} + +/** + * Processes the installer + */ +function process($argv) +{ + // Determine ANSI output from --ansi and --no-ansi flags + setUseAnsi($argv); + + $help = in_array('--help', $argv) || in_array('-h', $argv); + if ($help) { + displayHelp(); + exit(0); + } + + $check = in_array('--check', $argv); + $force = in_array('--force', $argv); + $quiet = in_array('--quiet', $argv); + $channel = 'stable'; + if (in_array('--snapshot', $argv)) { + $channel = 'snapshot'; + } elseif (in_array('--preview', $argv)) { + $channel = 'preview'; + } elseif (in_array('--1', $argv)) { + $channel = '1'; + } elseif (in_array('--2', $argv)) { + $channel = '2'; + } elseif (in_array('--2.2', $argv)) { + $channel = '2.2'; + } + $disableTls = in_array('--disable-tls', $argv); + $installDir = getOptValue('--install-dir', $argv, false); + $version = getOptValue('--version', $argv, false); + $filename = getOptValue('--filename', $argv, 'composer.phar'); + $cafile = getOptValue('--cafile', $argv, false); + + if (!checkParams($installDir, $version, $cafile)) { + exit(1); + } + + $ok = checkPlatform($warnings, $quiet, $disableTls, true); + + if ($check) { + // Only show warnings if we haven't output any errors + if ($ok) { + showWarnings($warnings); + showSecurityWarning($disableTls); + } + exit($ok ? 0 : 1); + } + + if ($ok || $force) { + if ($channel === '1' && !$quiet) { + out('Warning: You forced the install of Composer 1.x via --1, but Composer 2.x is the latest stable version. Updating to it via composer self-update --stable is recommended.', 'error'); + } + + $installer = new Installer($quiet, $disableTls, $cafile); + if ($installer->run($version, $installDir, $filename, $channel)) { + showWarnings($warnings); + showSecurityWarning($disableTls); + exit(0); + } + } + + exit(1); +} + +/** + * Displays the help + */ +function displayHelp() +{ + echo << $value) { + $next = $key + 1; + if (0 === strpos($value, $opt)) { + if ($optLength === strlen($value) && isset($argv[$next])) { + return trim($argv[$next]); + } else { + return trim(substr($value, $optLength + 1)); + } + } + } + + return $default; +} + +/** + * Checks that user-supplied params are valid + * + * @param mixed $installDir The required istallation directory + * @param mixed $version The required composer version to install + * @param mixed $cafile Certificate Authority file + * + * @return bool True if the supplied params are okay + */ +function checkParams($installDir, $version, $cafile) +{ + $result = true; + + if (false !== $installDir && !is_dir($installDir)) { + out("The defined install dir ({$installDir}) does not exist.", 'info'); + $result = false; + } + + if (false !== $version && 1 !== preg_match('/^\d+\.\d+\.\d+(\-(alpha|beta|RC)\d*)*$/', $version)) { + out("The defined install version ({$version}) does not match release pattern.", 'info'); + $result = false; + } + + if (false !== $cafile && (!file_exists($cafile) || !is_readable($cafile))) { + out("The defined Certificate Authority (CA) cert file ({$cafile}) does not exist or is not readable.", 'info'); + $result = false; + } + return $result; +} + +/** + * Checks the platform for possible issues running Composer + * + * Errors are written to the output, warnings are saved for later display. + * + * @param array $warnings Populated by method, to be shown later + * @param bool $quiet Quiet mode + * @param bool $disableTls Bypass tls + * @param bool $install If we are installing, rather than diagnosing + * + * @return bool True if there are no errors + */ +function checkPlatform(&$warnings, $quiet, $disableTls, $install) +{ + getPlatformIssues($errors, $warnings, $install); + + // Make openssl warning an error if tls has not been specifically disabled + if (isset($warnings['openssl']) && !$disableTls) { + $errors['openssl'] = $warnings['openssl']; + unset($warnings['openssl']); + } + + if (!empty($errors)) { + // Composer-Setup.exe uses "Some settings" to flag platform errors + out('Some settings on your machine make Composer unable to work properly.', 'error'); + out('Make sure that you fix the issues listed below and run this script again:', 'error'); + outputIssues($errors); + return false; + } + + if (empty($warnings) && !$quiet) { + out('All settings correct for using Composer', 'success'); + } + return true; +} + +/** + * Checks platform configuration for common incompatibility issues + * + * @param array $errors Populated by method + * @param array $warnings Populated by method + * @param bool $install If we are installing, rather than diagnosing + * + * @return bool If any errors or warnings have been found + */ +function getPlatformIssues(&$errors, &$warnings, $install) +{ + $errors = array(); + $warnings = array(); + + $iniMessage = PHP_EOL.getIniMessage(); + $iniMessage .= PHP_EOL.'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.'; + + if (ini_get('detect_unicode')) { + $errors['unicode'] = array( + 'The detect_unicode setting must be disabled.', + 'Add the following to the end of your `php.ini`:', + ' detect_unicode = Off', + $iniMessage + ); + } + + if (extension_loaded('suhosin')) { + $suhosin = ini_get('suhosin.executor.include.whitelist'); + $suhosinBlacklist = ini_get('suhosin.executor.include.blacklist'); + if (false === stripos($suhosin, 'phar') && (!$suhosinBlacklist || false !== stripos($suhosinBlacklist, 'phar'))) { + $errors['suhosin'] = array( + 'The suhosin.executor.include.whitelist setting is incorrect.', + 'Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):', + ' suhosin.executor.include.whitelist = phar '.$suhosin, + $iniMessage + ); + } + } + + if (!function_exists('json_decode')) { + $errors['json'] = array( + 'The json extension is missing.', + 'Install it or recompile php without --disable-json' + ); + } + + if (!extension_loaded('Phar')) { + $errors['phar'] = array( + 'The phar extension is missing.', + 'Install it or recompile php without --disable-phar' + ); + } + + if (!extension_loaded('filter')) { + $errors['filter'] = array( + 'The filter extension is missing.', + 'Install it or recompile php without --disable-filter' + ); + } + + if (!extension_loaded('hash')) { + $errors['hash'] = array( + 'The hash extension is missing.', + 'Install it or recompile php without --disable-hash' + ); + } + + if (!extension_loaded('iconv') && !extension_loaded('mbstring')) { + $errors['iconv_mbstring'] = array( + 'The iconv OR mbstring extension is required and both are missing.', + 'Install either of them or recompile php without --disable-iconv' + ); + } + + if (!ini_get('allow_url_fopen')) { + $errors['allow_url_fopen'] = array( + 'The allow_url_fopen setting is incorrect.', + 'Add the following to the end of your `php.ini`:', + ' allow_url_fopen = On', + $iniMessage + ); + } + + if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) { + $ioncube = ioncube_loader_version(); + $errors['ioncube'] = array( + 'Your ionCube Loader extension ('.$ioncube.') is incompatible with Phar files.', + 'Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:', + ' zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so', + $iniMessage + ); + } + + if (version_compare(PHP_VERSION, '5.3.2', '<')) { + $errors['php'] = array( + 'Your PHP ('.PHP_VERSION.') is too old, you must upgrade to PHP 5.3.2 or higher.' + ); + } + + if (version_compare(PHP_VERSION, '5.3.4', '<')) { + $warnings['php'] = array( + 'Your PHP ('.PHP_VERSION.') is quite old, upgrading to PHP 5.3.4 or higher is recommended.', + 'Composer works with 5.3.2+ for most people, but there might be edge case issues.' + ); + } + + if (!extension_loaded('openssl')) { + $warnings['openssl'] = array( + 'The openssl extension is missing, which means that secure HTTPS transfers are impossible.', + 'If possible you should enable it or recompile php with --with-openssl' + ); + } + + if (extension_loaded('openssl') && OPENSSL_VERSION_NUMBER < 0x1000100f) { + // Attempt to parse version number out, fallback to whole string value. + $opensslVersion = trim(strstr(OPENSSL_VERSION_TEXT, ' ')); + $opensslVersion = substr($opensslVersion, 0, strpos($opensslVersion, ' ')); + $opensslVersion = $opensslVersion ? $opensslVersion : OPENSSL_VERSION_TEXT; + + $warnings['openssl_version'] = array( + 'The OpenSSL library ('.$opensslVersion.') used by PHP does not support TLSv1.2 or TLSv1.1.', + 'If possible you should upgrade OpenSSL to version 1.0.1 or above.' + ); + } + + if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) { + $warnings['apc_cli'] = array( + 'The apc.enable_cli setting is incorrect.', + 'Add the following to the end of your `php.ini`:', + ' apc.enable_cli = Off', + $iniMessage + ); + } + + if (!$install && extension_loaded('xdebug')) { + $warnings['xdebug_loaded'] = array( + 'The xdebug extension is loaded, this can slow down Composer a little.', + 'Disabling it when using Composer is recommended.' + ); + + if (ini_get('xdebug.profiler_enabled')) { + $warnings['xdebug_profile'] = array( + 'The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.', + 'Add the following to the end of your `php.ini` to disable it:', + ' xdebug.profiler_enabled = 0', + $iniMessage + ); + } + } + + if (!extension_loaded('zlib')) { + $warnings['zlib'] = array( + 'The zlib extension is not loaded, this can slow down Composer a lot.', + 'If possible, install it or recompile php with --with-zlib', + $iniMessage + ); + } + + if (defined('PHP_WINDOWS_VERSION_BUILD') + && (version_compare(PHP_VERSION, '7.2.23', '<') + || (version_compare(PHP_VERSION, '7.3.0', '>=') + && version_compare(PHP_VERSION, '7.3.10', '<')))) { + $warnings['onedrive'] = array( + 'The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.', + 'Upgrade your PHP ('.PHP_VERSION.') to use this location with Composer.' + ); + } + + if (extension_loaded('uopz') && !(ini_get('uopz.disable') || ini_get('uopz.exit'))) { + $warnings['uopz'] = array( + 'The uopz extension ignores exit calls and may not work with all Composer commands.', + 'Disabling it when using Composer is recommended.' + ); + } + + ob_start(); + phpinfo(INFO_GENERAL); + $phpinfo = (string) ob_get_clean(); + if (preg_match('{Configure Command(?: *| *=> *)(.*?)(?:|$)}m', $phpinfo, $match)) { + $configure = $match[1]; + + if (false !== strpos($configure, '--enable-sigchild')) { + $warnings['sigchild'] = array( + 'PHP was compiled with --enable-sigchild which can cause issues on some platforms.', + 'Recompile it without this flag if possible, see also:', + ' https://bugs.php.net/bug.php?id=22999' + ); + } + + if (false !== strpos($configure, '--with-curlwrappers')) { + $warnings['curlwrappers'] = array( + 'PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub.', + 'Recompile it without this flag if possible' + ); + } + } + + // Stringify the message arrays + foreach ($errors as $key => $value) { + $errors[$key] = PHP_EOL.implode(PHP_EOL, $value); + } + + foreach ($warnings as $key => $value) { + $warnings[$key] = PHP_EOL.implode(PHP_EOL, $value); + } + + return !empty($errors) || !empty($warnings); +} + + +/** + * Outputs an array of issues + * + * @param array $issues + */ +function outputIssues($issues) +{ + foreach ($issues as $issue) { + out($issue, 'info'); + } + out(''); +} + +/** + * Outputs any warnings found + * + * @param array $warnings + */ +function showWarnings($warnings) +{ + if (!empty($warnings)) { + out('Some settings on your machine may cause stability issues with Composer.', 'error'); + out('If you encounter issues, try to change the following:', 'error'); + outputIssues($warnings); + } +} + +/** + * Outputs an end of process warning if tls has been bypassed + * + * @param bool $disableTls Bypass tls + */ +function showSecurityWarning($disableTls) +{ + if ($disableTls) { + out('You have instructed the Installer not to enforce SSL/TLS security on remote HTTPS requests.', 'info'); + out('This will leave all downloads during installation vulnerable to Man-In-The-Middle (MITM) attacks', 'info'); + } +} + +/** + * colorize output + */ +function out($text, $color = null, $newLine = true) +{ + $styles = array( + 'success' => "\033[0;32m%s\033[0m", + 'error' => "\033[31;31m%s\033[0m", + 'info' => "\033[33;33m%s\033[0m" + ); + + $format = '%s'; + + if (isset($styles[$color]) && USE_ANSI) { + $format = $styles[$color]; + } + + if ($newLine) { + $format .= PHP_EOL; + } + + printf($format, $text); +} + +/** + * Returns the system-dependent Composer home location, which may not exist + * + * @return string + */ +function getHomeDir() +{ + $home = getenv('COMPOSER_HOME'); + if ($home) { + return $home; + } + + $userDir = getUserDir(); + + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + return $userDir.'/Composer'; + } + + $dirs = array(); + + if (useXdg()) { + // XDG Base Directory Specifications + $xdgConfig = getenv('XDG_CONFIG_HOME'); + if (!$xdgConfig) { + $xdgConfig = $userDir . '/.config'; + } + + $dirs[] = $xdgConfig . '/composer'; + } + + $dirs[] = $userDir . '/.composer'; + + // select first dir which exists of: $XDG_CONFIG_HOME/composer or ~/.composer + foreach ($dirs as $dir) { + if (is_dir($dir)) { + return $dir; + } + } + + // if none exists, we default to first defined one (XDG one if system uses it, or ~/.composer otherwise) + return $dirs[0]; +} + +/** + * Returns the location of the user directory from the environment + * @throws RuntimeException If the environment value does not exists + * + * @return string + */ +function getUserDir() +{ + $userEnv = defined('PHP_WINDOWS_VERSION_MAJOR') ? 'APPDATA' : 'HOME'; + $userDir = getenv($userEnv); + + if (!$userDir) { + throw new RuntimeException('The '.$userEnv.' or COMPOSER_HOME environment variable must be set for composer to run correctly'); + } + + return rtrim(strtr($userDir, '\\', '/'), '/'); +} + +/** + * @return bool + */ +function useXdg() +{ + foreach (array_keys($_SERVER) as $key) { + if (strpos((string) $key, 'XDG_') === 0) { + return true; + } + } + + if (is_dir('/etc/xdg')) { + return true; + } + + return false; +} + +function validateCaFile($contents) +{ + // assume the CA is valid if php is vulnerable to + // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html + if ( + PHP_VERSION_ID <= 50327 + || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50422) + || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50506) + ) { + return !empty($contents); + } + + return (bool) openssl_x509_parse($contents); +} + +/** + * Returns php.ini location information + * + * @return string + */ +function getIniMessage() +{ + $paths = array((string) php_ini_loaded_file()); + $scanned = php_ini_scanned_files(); + + if ($scanned !== false) { + $paths = array_merge($paths, array_map('trim', explode(',', $scanned))); + } + + // We will have at least one value, which may be empty + if ($paths[0] === '') { + array_shift($paths); + } + + $ini = array_shift($paths); + + if ($ini === null) { + return 'A php.ini file does not exist. You will have to create one.'; + } + + if (count($paths) > 1) { + return 'Your command-line PHP is using multiple ini files. Run `php --ini` to show them.'; + } + + return 'The php.ini used by your command-line PHP is: '.$ini; +} + +class Installer +{ + private $quiet; + private $disableTls; + private $cafile; + private $displayPath; + private $target; + private $tmpFile; + private $tmpCafile; + private $baseUrl; + private $algo; + private $errHandler; + private $httpClient; + private $pubKeys = array(); + private $installs = array(); + + /** + * Constructor - must not do anything that throws an exception + * + * @param bool $quiet Quiet mode + * @param bool $disableTls Bypass tls + * @param mixed $cafile Path to CA bundle, or false + */ + public function __construct($quiet, $disableTls, $caFile) + { + if (($this->quiet = $quiet)) { + ob_start(); + } + $this->disableTls = $disableTls; + $this->cafile = $caFile; + $this->errHandler = new ErrorHandler(); + } + + /** + * Runs the installer + * + * @param mixed $version Specific version to install, or false + * @param mixed $installDir Specific installation directory, or false + * @param string $filename Specific filename to save to, or composer.phar + * @param string $channel Specific version channel to use + * @throws Exception If anything other than a RuntimeException is caught + * + * @return bool If the installation succeeded + */ + public function run($version, $installDir, $filename, $channel) + { + try { + $this->initTargets($installDir, $filename); + $this->initTls(); + $this->httpClient = new HttpClient($this->disableTls, $this->cafile); + $result = $this->install($version, $channel); + + // in case --1 or --2 is passed, we leave the default channel for next self-update to stable + if (1 === preg_match('{^\d+$}D', $channel)) { + $channel = 'stable'; + } + + if ($result && $channel !== 'stable' && !$version && defined('PHP_BINARY')) { + $null = (defined('PHP_WINDOWS_VERSION_MAJOR') ? 'NUL' : '/dev/null'); + @exec(escapeshellarg(PHP_BINARY) .' '.escapeshellarg($this->target).' self-update --'.$channel.' --set-channel-only -q > '.$null.' 2> '.$null, $output); + } + } catch (Exception $e) { + $result = false; + } + + // Always clean up + $this->cleanUp($result); + + if (isset($e)) { + // Rethrow anything that is not a RuntimeException + if (!$e instanceof RuntimeException) { + throw $e; + } + out($e->getMessage(), 'error'); + } + return $result; + } + + /** + * Initialization methods to set the required filenames and composer url + * + * @param mixed $installDir Specific installation directory, or false + * @param string $filename Specific filename to save to, or composer.phar + * @throws RuntimeException If the installation directory is not writable + */ + protected function initTargets($installDir, $filename) + { + $this->displayPath = ($installDir ? rtrim($installDir, '/').'/' : '').$filename; + $installDir = $installDir ? realpath($installDir) : getcwd(); + + if (!is_writeable($installDir)) { + throw new RuntimeException('The installation directory "'.$installDir.'" is not writable'); + } + + $this->target = $installDir.DIRECTORY_SEPARATOR.$filename; + $this->tmpFile = $installDir.DIRECTORY_SEPARATOR.basename($this->target, '.phar').'-temp.phar'; + + $uriScheme = $this->disableTls ? 'http' : 'https'; + $this->baseUrl = $uriScheme.'://getcomposer.org'; + } + + /** + * A wrapper around methods to check tls and write public keys + * @throws RuntimeException If SHA384 is not supported + */ + protected function initTls() + { + if ($this->disableTls) { + return; + } + + if (!in_array('sha384', array_map('strtolower', openssl_get_md_methods()))) { + throw new RuntimeException('SHA384 is not supported by your openssl extension'); + } + + $this->algo = defined('OPENSSL_ALGO_SHA384') ? OPENSSL_ALGO_SHA384 : 'SHA384'; + $home = $this->getComposerHome(); + + $this->pubKeys = array( + 'dev' => $this->installKey(self::getPKDev(), $home, 'keys.dev.pub'), + 'tags' => $this->installKey(self::getPKTags(), $home, 'keys.tags.pub') + ); + + if (empty($this->cafile) && !HttpClient::getSystemCaRootBundlePath()) { + $this->cafile = $this->tmpCafile = $this->installKey(HttpClient::getPackagedCaFile(), $home, 'cacert-temp.pem'); + } + } + + /** + * Returns the Composer home directory, creating it if required + * @throws RuntimeException If the directory cannot be created + * + * @return string + */ + protected function getComposerHome() + { + $home = getHomeDir(); + + if (!is_dir($home)) { + $this->errHandler->start(); + + if (!mkdir($home, 0777, true)) { + throw new RuntimeException(sprintf( + 'Unable to create Composer home directory "%s": %s', + $home, + $this->errHandler->message + )); + } + $this->installs[] = $home; + $this->errHandler->stop(); + } + return $home; + } + + /** + * Writes public key data to disc + * + * @param string $data The public key(s) in pem format + * @param string $path The directory to write to + * @param string $filename The name of the file + * @throws RuntimeException If the file cannot be written + * + * @return string The path to the saved data + */ + protected function installKey($data, $path, $filename) + { + $this->errHandler->start(); + + $target = $path.DIRECTORY_SEPARATOR.$filename; + $installed = file_exists($target); + $write = file_put_contents($target, $data, LOCK_EX); + @chmod($target, 0644); + + $this->errHandler->stop(); + + if (!$write) { + throw new RuntimeException(sprintf('Unable to write %s to: %s', $filename, $path)); + } + + if (!$installed) { + $this->installs[] = $target; + } + + return $target; + } + + /** + * The main install function + * + * @param mixed $version Specific version to install, or false + * @param string $channel Version channel to use + * + * @return bool If the installation succeeded + */ + protected function install($version, $channel) + { + $retries = 3; + $result = false; + $infoMsg = 'Downloading...'; + $infoType = 'info'; + + while ($retries--) { + if (!$this->quiet) { + out($infoMsg, $infoType); + $infoMsg = 'Retrying...'; + $infoType = 'error'; + } + + if (!$this->getVersion($channel, $version, $url, $error)) { + out($error, 'error'); + continue; + } + + if (!$this->downloadToTmp($url, $signature, $error)) { + out($error, 'error'); + continue; + } + + if (!$this->verifyAndSave($version, $signature, $error)) { + out($error, 'error'); + continue; + } + + $result = true; + break; + } + + if (!$this->quiet) { + if ($result) { + out(PHP_EOL."Composer (version {$version}) successfully installed to: {$this->target}", 'success'); + out("Use it: php {$this->displayPath}", 'info'); + out(''); + } else { + out('The download failed repeatedly, aborting.', 'error'); + } + } + return $result; + } + + /** + * Sets the version url, downloading version data if required + * + * @param string $channel Version channel to use + * @param false|string $version Version to install, or set by method + * @param null|string $url The versioned url, set by method + * @param null|string $error Set by method on failure + * + * @return bool If the operation succeeded + */ + protected function getVersion($channel, &$version, &$url, &$error) + { + $error = ''; + + if ($version) { + if (empty($url)) { + $url = $this->baseUrl."/download/{$version}/composer.phar"; + } + return true; + } + + $this->errHandler->start(); + + if ($this->downloadVersionData($data, $error)) { + $this->parseVersionData($data, $channel, $version, $url); + } + + $this->errHandler->stop(); + return empty($error); + } + + /** + * Downloads and json-decodes version data + * + * @param null|array $data Downloaded version data, set by method + * @param null|string $error Set by method on failure + * + * @return bool If the operation succeeded + */ + protected function downloadVersionData(&$data, &$error) + { + $url = $this->baseUrl.'/versions'; + $errFmt = 'The "%s" file could not be %s: %s'; + + if (!$json = $this->httpClient->get($url)) { + $error = sprintf($errFmt, $url, 'downloaded', $this->errHandler->message); + return false; + } + + if (!$data = json_decode($json, true)) { + $error = sprintf($errFmt, $url, 'json-decoded', $this->getJsonError()); + return false; + } + return true; + } + + /** + * A wrapper around the methods needed to download and save the phar + * + * @param string $url The versioned download url + * @param null|string $signature Set by method on successful download + * @param null|string $error Set by method on failure + * + * @return bool If the operation succeeded + */ + protected function downloadToTmp($url, &$signature, &$error) + { + $error = ''; + $errFmt = 'The "%s" file could not be downloaded: %s'; + $sigUrl = $url.'.sig'; + $this->errHandler->start(); + + if (!$fh = fopen($this->tmpFile, 'w')) { + $error = sprintf('Could not create file "%s": %s', $this->tmpFile, $this->errHandler->message); + + } elseif (!$this->getSignature($sigUrl, $signature)) { + $error = sprintf($errFmt, $sigUrl, $this->errHandler->message); + + } elseif (!fwrite($fh, $this->httpClient->get($url))) { + $error = sprintf($errFmt, $url, $this->errHandler->message); + } + + if (is_resource($fh)) { + fclose($fh); + } + $this->errHandler->stop(); + return empty($error); + } + + /** + * Verifies the downloaded file and saves it to the target location + * + * @param string $version The composer version downloaded + * @param string $signature The digital signature to check + * @param null|string $error Set by method on failure + * + * @return bool If the operation succeeded + */ + protected function verifyAndSave($version, $signature, &$error) + { + $error = ''; + + if (!$this->validatePhar($this->tmpFile, $pharError)) { + $error = 'The download is corrupt: '.$pharError; + + } elseif (!$this->verifySignature($version, $signature, $this->tmpFile)) { + $error = 'Signature mismatch, could not verify the phar file integrity'; + + } else { + $this->errHandler->start(); + + if (!rename($this->tmpFile, $this->target)) { + $error = sprintf('Could not write to file "%s": %s', $this->target, $this->errHandler->message); + } + chmod($this->target, 0755); + $this->errHandler->stop(); + } + + return empty($error); + } + + /** + * Parses an array of version data to match the required channel + * + * @param array $data Downloaded version data + * @param mixed $channel Version channel to use + * @param false|string $version Set by method + * @param mixed $url The versioned url, set by method + */ + protected function parseVersionData(array $data, $channel, &$version, &$url) + { + foreach ($data[$channel] as $candidate) { + if ($candidate['min-php'] <= PHP_VERSION_ID) { + $version = $candidate['version']; + $url = $this->baseUrl.$candidate['path']; + break; + } + } + + if (!$version) { + $error = sprintf( + 'None of the %d %s version(s) of Composer matches your PHP version (%s / ID: %d)', + count($data[$channel]), + $channel, + PHP_VERSION, + PHP_VERSION_ID + ); + throw new RuntimeException($error); + } + } + + /** + * Downloads the digital signature of required phar file + * + * @param string $url The signature url + * @param null|string $signature Set by method on success + * + * @return bool If the download succeeded + */ + protected function getSignature($url, &$signature) + { + if (!$result = $this->disableTls) { + $signature = $this->httpClient->get($url); + + if ($signature) { + $signature = json_decode($signature, true); + $signature = base64_decode($signature['sha384']); + $result = true; + } + } + + return $result; + } + + /** + * Verifies the signature of the downloaded phar + * + * @param string $version The composer versione + * @param string $signature The downloaded digital signature + * @param string $file The temp phar file + * + * @return bool If the operation succeeded + */ + protected function verifySignature($version, $signature, $file) + { + if (!$result = $this->disableTls) { + $path = preg_match('{^[0-9a-f]{40}$}', $version) ? $this->pubKeys['dev'] : $this->pubKeys['tags']; + $pubkeyid = openssl_pkey_get_public('file://'.$path); + + $result = 1 === openssl_verify( + file_get_contents($file), + $signature, + $pubkeyid, + $this->algo + ); + + // PHP 8 automatically frees the key instance and deprecates the function + if (PHP_VERSION_ID < 80000) { + openssl_free_key($pubkeyid); + } + } + + return $result; + } + + /** + * Validates the downloaded phar file + * + * @param string $pharFile The temp phar file + * @param null|string $error Set by method on failure + * + * @return bool If the operation succeeded + */ + protected function validatePhar($pharFile, &$error) + { + if (ini_get('phar.readonly')) { + return true; + } + + try { + // Test the phar validity + $phar = new Phar($pharFile); + // Free the variable to unlock the file + unset($phar); + $result = true; + + } catch (Exception $e) { + if (!$e instanceof UnexpectedValueException && !$e instanceof PharException) { + throw $e; + } + $error = $e->getMessage(); + $result = false; + } + return $result; + } + + /** + * Returns a string representation of the last json error + * + * @return string The error string or code + */ + protected function getJsonError() + { + if (function_exists('json_last_error_msg')) { + return json_last_error_msg(); + } else { + return 'json_last_error = '.json_last_error(); + } + } + + /** + * Cleans up resources at the end of the installation + * + * @param bool $result If the installation succeeded + */ + protected function cleanUp($result) + { + if ($this->quiet) { + // Ensure output buffers are emptied + $errors = explode(PHP_EOL, (string) ob_get_clean()); + } + + if (!$result) { + // Output buffered errors + if ($this->quiet) { + $this->outputErrors($errors); + } + // Clean up stuff we created + $this->uninstall(); + } elseif ($this->tmpCafile !== null) { + @unlink($this->tmpCafile); + } + } + + /** + * Outputs unique errors when in quiet mode + * + */ + protected function outputErrors(array $errors) + { + $shown = array(); + + foreach ($errors as $error) { + if ($error && !in_array($error, $shown)) { + out($error, 'error'); + $shown[] = $error; + } + } + } + + /** + * Uninstalls newly-created files and directories on failure + * + */ + protected function uninstall() + { + foreach (array_reverse($this->installs) as $target) { + if (is_file($target)) { + @unlink($target); + } elseif (is_dir($target)) { + @rmdir($target); + } + } + + if ($this->tmpFile !== null && file_exists($this->tmpFile)) { + @unlink($this->tmpFile); + } + } + + public static function getPKDev() + { + return <<message) { + $this->message .= PHP_EOL; + } + $this->message .= preg_replace('{^file_get_contents\(.*?\): }', '', $msg); + } + + /** + * Starts error-handling if not already active + * + * Any message is cleared + */ + public function start() + { + if (!$this->active) { + set_error_handler(array($this, 'handleError')); + $this->active = true; + } + $this->message = ''; + } + + /** + * Stops error-handling if active + * + * Any message is preserved until the next call to start() + */ + public function stop() + { + if ($this->active) { + restore_error_handler(); + $this->active = false; + } + } +} + +class NoProxyPattern +{ + private $composerInNoProxy = false; + private $rulePorts = array(); + + public function __construct($pattern) + { + $rules = preg_split('{[\s,]+}', $pattern, null, PREG_SPLIT_NO_EMPTY); + + if ($matches = preg_grep('{getcomposer\.org(?::\d+)?}i', $rules)) { + $this->composerInNoProxy = true; + + foreach ($matches as $match) { + if (strpos($match, ':') !== false) { + list(, $port) = explode(':', $match); + $this->rulePorts[] = (int) $port; + } + } + } + } + + /** + * Returns true if NO_PROXY contains getcomposer.org + * + * @param string $url http(s)://getcomposer.org + * + * @return bool + */ + public function test($url) + { + if (!$this->composerInNoProxy) { + return false; + } + + if (empty($this->rulePorts)) { + return true; + } + + if (strpos($url, 'http://') === 0) { + $port = 80; + } else { + $port = 443; + } + + return in_array($port, $this->rulePorts); + } +} + +class HttpClient { + + /** @var null|string */ + private static $caPath; + + private $options = array('http' => array()); + private $disableTls = false; + + public function __construct($disableTls = false, $cafile = false) + { + $this->disableTls = $disableTls; + if ($this->disableTls === false) { + if (!empty($cafile) && !is_dir($cafile)) { + if (!is_readable($cafile) || !validateCaFile(file_get_contents($cafile))) { + throw new RuntimeException('The configured cafile (' .$cafile. ') was not valid or could not be read.'); + } + } + $options = $this->getTlsStreamContextDefaults($cafile); + $this->options = array_replace_recursive($this->options, $options); + } + } + + public function get($url) + { + $context = $this->getStreamContext($url); + $result = file_get_contents($url, false, $context); + + if ($result && extension_loaded('zlib')) { + $headers = PHP_VERSION_ID >= 80400 ? http_get_last_response_headers() : $http_response_header; + $decode = false; + foreach ($headers as $header) { + if (preg_match('{^content-encoding: *gzip *$}i', $header)) { + $decode = true; + continue; + } elseif (preg_match('{^HTTP/}i', $header)) { + $decode = false; + } + } + + if ($decode) { + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + $result = zlib_decode($result); + } else { + // work around issue with gzuncompress & co that do not work with all gzip checksums + $result = file_get_contents('compress.zlib://data:application/octet-stream;base64,'.base64_encode($result)); + } + + if (!$result) { + throw new RuntimeException('Failed to decode zlib stream'); + } + } + } + + return $result; + } + + protected function getStreamContext($url) + { + if ($this->disableTls === false) { + if (PHP_VERSION_ID < 50600) { + $this->options['ssl']['SNI_server_name'] = parse_url($url, PHP_URL_HOST); + } + } + // Keeping the above mostly isolated from the code copied from Composer. + return $this->getMergedStreamContext($url); + } + + protected function getTlsStreamContextDefaults($cafile) + { + $ciphers = implode(':', array( + 'ECDHE-RSA-AES128-GCM-SHA256', + 'ECDHE-ECDSA-AES128-GCM-SHA256', + 'ECDHE-RSA-AES256-GCM-SHA384', + 'ECDHE-ECDSA-AES256-GCM-SHA384', + 'DHE-RSA-AES128-GCM-SHA256', + 'DHE-DSS-AES128-GCM-SHA256', + 'kEDH+AESGCM', + 'ECDHE-RSA-AES128-SHA256', + 'ECDHE-ECDSA-AES128-SHA256', + 'ECDHE-RSA-AES128-SHA', + 'ECDHE-ECDSA-AES128-SHA', + 'ECDHE-RSA-AES256-SHA384', + 'ECDHE-ECDSA-AES256-SHA384', + 'ECDHE-RSA-AES256-SHA', + 'ECDHE-ECDSA-AES256-SHA', + 'DHE-RSA-AES128-SHA256', + 'DHE-RSA-AES128-SHA', + 'DHE-DSS-AES128-SHA256', + 'DHE-RSA-AES256-SHA256', + 'DHE-DSS-AES256-SHA', + 'DHE-RSA-AES256-SHA', + 'AES128-GCM-SHA256', + 'AES256-GCM-SHA384', + 'AES128-SHA256', + 'AES256-SHA256', + 'AES128-SHA', + 'AES256-SHA', + 'AES', + 'CAMELLIA', + 'DES-CBC3-SHA', + '!aNULL', + '!eNULL', + '!EXPORT', + '!DES', + '!RC4', + '!MD5', + '!PSK', + '!aECDH', + '!EDH-DSS-DES-CBC3-SHA', + '!EDH-RSA-DES-CBC3-SHA', + '!KRB5-DES-CBC3-SHA', + )); + + /** + * CN_match and SNI_server_name are only known once a URL is passed. + * They will be set in the getOptionsForUrl() method which receives a URL. + * + * cafile or capath can be overridden by passing in those options to constructor. + */ + $options = array( + 'ssl' => array( + 'ciphers' => $ciphers, + 'verify_peer' => true, + 'verify_depth' => 7, + 'SNI_enabled' => true, + ) + ); + + /** + * Attempt to find a local cafile or throw an exception. + * The user may go download one if this occurs. + */ + if (!$cafile) { + $cafile = self::getSystemCaRootBundlePath(); + } + if (is_dir($cafile)) { + $options['ssl']['capath'] = $cafile; + } elseif ($cafile) { + $options['ssl']['cafile'] = $cafile; + } else { + throw new RuntimeException('A valid cafile could not be located automatically.'); + } + + /** + * Disable TLS compression to prevent CRIME attacks where supported. + */ + if (version_compare(PHP_VERSION, '5.4.13') >= 0) { + $options['ssl']['disable_compression'] = true; + } + + return $options; + } + + /** + * function copied from Composer\Util\StreamContextFactory::initOptions + * + * Any changes should be applied there as well, or backported here. + * + * @param string $url URL the context is to be used for + * @return resource Default context + * @throws \RuntimeException if https proxy required and OpenSSL uninstalled + */ + protected function getMergedStreamContext($url) + { + $options = $this->options; + + // Handle HTTP_PROXY/http_proxy on CLI only for security reasons + if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy']))) { + $proxy = parse_url(!empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']); + } + + // Prefer CGI_HTTP_PROXY if available + if (!empty($_SERVER['CGI_HTTP_PROXY'])) { + $proxy = parse_url($_SERVER['CGI_HTTP_PROXY']); + } + + // Override with HTTPS proxy if present and URL is https + if (preg_match('{^https://}i', $url) && (!empty($_SERVER['HTTPS_PROXY']) || !empty($_SERVER['https_proxy']))) { + $proxy = parse_url(!empty($_SERVER['https_proxy']) ? $_SERVER['https_proxy'] : $_SERVER['HTTPS_PROXY']); + } + + // Remove proxy if URL matches no_proxy directive + if (!empty($_SERVER['NO_PROXY']) || !empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) { + $pattern = new NoProxyPattern(!empty($_SERVER['no_proxy']) ? $_SERVER['no_proxy'] : $_SERVER['NO_PROXY']); + if ($pattern->test($url)) { + unset($proxy); + } + } + + if (!empty($proxy)) { + $proxyURL = isset($proxy['scheme']) ? $proxy['scheme'] . '://' : ''; + $proxyURL .= isset($proxy['host']) ? $proxy['host'] : ''; + + if (isset($proxy['port'])) { + $proxyURL .= ":" . $proxy['port']; + } elseif (strpos($proxyURL, 'http://') === 0) { + $proxyURL .= ":80"; + } elseif (strpos($proxyURL, 'https://') === 0) { + $proxyURL .= ":443"; + } + + // check for a secure proxy + if (strpos($proxyURL, 'https://') === 0) { + if (!extension_loaded('openssl')) { + throw new RuntimeException('You must enable the openssl extension to use a secure proxy.'); + } + if (strpos($url, 'https://') === 0) { + throw new RuntimeException('PHP does not support https requests through a secure proxy.'); + } + } + + // http(s):// is not supported in proxy + $proxyURL = str_replace(array('http://', 'https://'), array('tcp://', 'ssl://'), $proxyURL); + + $options['http'] = array( + 'proxy' => $proxyURL, + ); + + // add request_fulluri for http requests + if ('http' === parse_url($url, PHP_URL_SCHEME)) { + $options['http']['request_fulluri'] = true; + } + + // handle proxy auth if present + if (isset($proxy['user'])) { + $auth = rawurldecode($proxy['user']); + if (isset($proxy['pass'])) { + $auth .= ':' . rawurldecode($proxy['pass']); + } + $auth = base64_encode($auth); + + $options['http']['header'] = "Proxy-Authorization: Basic {$auth}\r\n"; + } + } + + if (isset($options['http']['header'])) { + $options['http']['header'] .= "Connection: close\r\n"; + } else { + $options['http']['header'] = "Connection: close\r\n"; + } + if (extension_loaded('zlib')) { + $options['http']['header'] .= "Accept-Encoding: gzip\r\n"; + } + $options['http']['header'] .= "User-Agent: ".COMPOSER_INSTALLER."\r\n"; + $options['http']['protocol_version'] = 1.1; + $options['http']['timeout'] = 600; + + return stream_context_create($options); + } + + /** + * This method was adapted from Sslurp. + * https://github.com/EvanDotPro/Sslurp + * + * (c) Evan Coury + * + * For the full copyright and license information, please see below: + * + * Copyright (c) 2013, Evan Coury + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + public static function getSystemCaRootBundlePath() + { + if (self::$caPath !== null) { + return self::$caPath; + } + + // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $envCertFile = getenv('SSL_CERT_FILE'); + if ($envCertFile && is_readable($envCertFile) && validateCaFile(file_get_contents($envCertFile))) { + return self::$caPath = $envCertFile; + } + + // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $envCertDir = getenv('SSL_CERT_DIR'); + if ($envCertDir && is_dir($envCertDir) && is_readable($envCertDir)) { + return self::$caPath = $envCertDir; + } + + $configured = ini_get('openssl.cafile'); + if ($configured && strlen($configured) > 0 && is_readable($configured) && validateCaFile(file_get_contents($configured))) { + return self::$caPath = $configured; + } + + $configured = ini_get('openssl.capath'); + if ($configured && is_dir($configured) && is_readable($configured)) { + return self::$caPath = $configured; + } + + $caBundlePaths = array( + '/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package) + '/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package) + '/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package) + '/usr/ssl/certs/ca-bundle.crt', // Cygwin + '/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package + '/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option) + '/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat? + '/etc/ssl/cert.pem', // OpenBSD + '/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x + '/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package + '/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package + '/opt/homebrew/etc/openssl@3/cert.pem', // macOS silicon homebrew, openssl@3 package + '/opt/homebrew/etc/openssl@1.1/cert.pem', // macOS silicon homebrew, openssl@1.1 package + ); + + foreach ($caBundlePaths as $caBundle) { + if (@is_readable($caBundle) && validateCaFile(file_get_contents($caBundle))) { + return self::$caPath = $caBundle; + } + } + + foreach ($caBundlePaths as $caBundle) { + $caBundle = dirname($caBundle); + if (is_dir($caBundle) && glob($caBundle.'/*')) { + return self::$caPath = $caBundle; + } + } + + return self::$caPath = false; + } + + public static function getPackagedCaFile() + { + return <<=1.2.3", + "squizlabs/php_codesniffer": "^4.0", + "symfony/process": "^6.0||^7.0", + "webmozart/assert": "^1.11" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "https://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://cloud.google.com/php/docs/reference/auth/latest", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.48.1" + }, + "time": "2025-09-30T04:22:33+00:00" + }, + { + "name": "google/cloud-dialogflow", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-dialogflow.git", + "reference": "b536e04b66e518505dbc0266c7f288f4d692cf7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-dialogflow/zipball/b536e04b66e518505dbc0266c7f288f4d692cf7a", + "reference": "b536e04b66e518505dbc0266c7f288f4d692cf7a", + "shasum": "" + }, + "require": { + "google/gax": "^1.38.0", + "php": "^8.1" + }, + "require-dev": { + "google/cloud-core": "^1.52.7", + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google." + }, + "type": "library", + "extra": { + "component": { + "id": "cloud-dialogflow", + "path": "Dialogflow", + "entry": null, + "target": "googleapis/google-cloud-php-dialogflow.git" + } + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\Dialogflow\\": "src", + "GPBMetadata\\Google\\Cloud\\Dialogflow\\": "metadata" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Cloud Dialogflow Client for PHP", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-dialogflow/tree/v2.2.0" + }, + "time": "2025-09-20T01:29:44+00:00" + }, + { + "name": "google/common-protos", + "version": "4.12.4", + "source": { + "type": "git", + "url": "https://github.com/googleapis/common-protos-php.git", + "reference": "0127156899af0df2681bd42024c60bd5360d64e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/0127156899af0df2681bd42024c60bd5360d64e3", + "reference": "0127156899af0df2681bd42024c60bd5360d64e3", + "shasum": "" + }, + "require": { + "google/protobuf": "^4.31", + "php": "^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "type": "library", + "extra": { + "component": { + "id": "common-protos", + "path": "CommonProtos", + "entry": "README.md", + "target": "googleapis/common-protos-php.git" + } + }, + "autoload": { + "psr-4": { + "Google\\Api\\": "src/Api", + "Google\\Iam\\": "src/Iam", + "Google\\Rpc\\": "src/Rpc", + "Google\\Type\\": "src/Type", + "Google\\Cloud\\": "src/Cloud", + "GPBMetadata\\Google\\Api\\": "metadata/Api", + "GPBMetadata\\Google\\Iam\\": "metadata/Iam", + "GPBMetadata\\Google\\Rpc\\": "metadata/Rpc", + "GPBMetadata\\Google\\Type\\": "metadata/Type", + "GPBMetadata\\Google\\Cloud\\": "metadata/Cloud", + "GPBMetadata\\Google\\Logging\\": "metadata/Logging" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google API Common Protos for PHP", + "homepage": "https://github.com/googleapis/common-protos-php", + "keywords": [ + "google" + ], + "support": { + "source": "https://github.com/googleapis/common-protos-php/tree/v4.12.4" + }, + "time": "2025-09-20T01:29:44+00:00" + }, + { + "name": "google/gax", + "version": "v1.38.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/gax-php.git", + "reference": "0e1bce4a30722e85485bbb132b2fa811d66b397b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/0e1bce4a30722e85485bbb132b2fa811d66b397b", + "reference": "0e1bce4a30722e85485bbb132b2fa811d66b397b", + "shasum": "" + }, + "require": { + "google/auth": "^1.45", + "google/common-protos": "^4.4", + "google/grpc-gcp": "^0.4", + "google/longrunning": "~0.4", + "google/protobuf": "^4.31", + "grpc/grpc": "^1.13", + "guzzlehttp/promises": "^2.0", + "guzzlehttp/psr7": "^2.0", + "php": "^8.1", + "ramsey/uuid": "^4.0" + }, + "conflict": { + "ext-protobuf": "<4.31.0" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "4.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\ApiCore\\": "src", + "GPBMetadata\\ApiCore\\": "metadata/ApiCore" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Google API Core for PHP", + "homepage": "https://github.com/googleapis/gax-php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/gax-php/issues", + "source": "https://github.com/googleapis/gax-php/tree/v1.38.0" + }, + "time": "2025-09-17T18:22:14+00:00" + }, + { + "name": "google/grpc-gcp", + "version": "v0.4.1", + "source": { + "type": "git", + "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "shasum": "" + }, + "require": { + "google/auth": "^1.3", + "google/protobuf": "^v3.25.3||^4.26.1", + "grpc/grpc": "^v1.13.0", + "php": "^8.0", + "psr/cache": "^1.0.1||^2.0.0||^3.0.0" + }, + "require-dev": { + "google/cloud-spanner": "^1.7", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Grpc\\Gcp\\": "src/" + }, + "classmap": [ + "src/generated/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC GCP library for channel management", + "support": { + "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.1" + }, + "time": "2025-02-19T21:53:22+00:00" + }, + { + "name": "google/longrunning", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/php-longrunning.git", + "reference": "715519ab4aaf3c4268adb2b551ee0f34135c8c5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/715519ab4aaf3c4268adb2b551ee0f34135c8c5f", + "reference": "715519ab4aaf3c4268adb2b551ee0f34135c8c5f", + "shasum": "" + }, + "require-dev": { + "google/gax": "^1.38.0", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "component": { + "id": "longrunning", + "path": "LongRunning", + "entry": null, + "target": "googleapis/php-longrunning" + } + }, + "autoload": { + "psr-4": { + "Google\\LongRunning\\": "src/LongRunning", + "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", + "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google LongRunning Client for PHP", + "support": { + "source": "https://github.com/googleapis/php-longrunning/tree/v0.5.0" + }, + "time": "2025-09-20T01:29:44+00:00" + }, + { + "name": "google/protobuf", + "version": "v4.32.1", + "source": { + "type": "git", + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", + "shasum": "" + }, + "require": { + "php": ">=8.1.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0 <8.5.27" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.32.1" + }, + "time": "2025-09-14T05:14:52+00:00" + }, + { + "name": "grpc/grpc", + "version": "1.74.0", + "source": { + "type": "git", + "url": "https://github.com/grpc/grpc-php.git", + "reference": "32bf4dba256d60d395582fb6e4e8d3936bcdb713" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grpc/grpc-php/zipball/32bf4dba256d60d395582fb6e4e8d3936bcdb713", + "reference": "32bf4dba256d60d395582fb6e4e8d3936bcdb713", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "google/auth": "^v1.3.0" + }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, + "type": "library", + "autoload": { + "psr-4": { + "Grpc\\": "src/lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC library for PHP", + "homepage": "https://grpc.io", + "keywords": [ + "rpc" + ], + "support": { + "source": "https://github.com/grpc/grpc-php/tree/v1.74.0" + }, + "time": "2025-07-24T20:02:16+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-08-23T22:36:01+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:34:08+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "21dc724a0583619cd1652f673303492272778051" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", + "reference": "21dc724a0583619cd1652f673303492272778051", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2025-08-23T21:21:41+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.1.1" + }, + "time": "2025-03-22T05:38:12+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.9.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.9.1" + }, + "time": "2025-09-04T20:59:21+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/gcp_creds/dialogflow_key.json b/gcp_creds/dialogflow_key.json new file mode 100644 index 0000000..e12a346 --- /dev/null +++ b/gcp_creds/dialogflow_key.json @@ -0,0 +1,28 @@ +{ "type": "service_account", "project_id": "chrivia-asxi", "private_key_id": "6053badd24ceb066aba55c264b0dc5051bb3ce69", "private_key": "-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMCXYJzgk2AR64 +rxAVMq9Kf8yD4uYCjIxjtZcYoyrSSmC6V/i6GqQ/CRASzaY5L9NTRWEUN0Ukvlub +lYvIHQoBnsr+Zm28PmuougyJdjLr4GKH++HhviNellkQ/QvwGtBG8WAMwu4HuCyK +8yeEl6mJpdlJGthOvgt2w23BCsfLjOf6aA1dgZwohCzS5GJhsgwggREPjWnSyRIK +YDZaXyfYBgM4imcBSh3lA0ekR87yb+zUY03KLDEo3uWuOplI2d9heKt1ZZoYJCSe +UwZ0kFYwCsPDI8vDVV/dLjX7cB8eqZAHLlgYbGJyFBqTZ3qZv8ezAXUYRdOYcpgg +nyz8dt3nAgMBAAECggEALlil0dNVv0kg19WYIyCItbTy2TBki8auKwX4BNYnZ24S +q7FI48kibtkZqBPDgrDs4TjctNFbKN3+hAhDoJiMCdMui/vrSDuri797EoxhQ7gL +2ZSq+fKNKTKgl53LJOaKUdsJNMzgcatxnrxdyR4EGiqsgRESekxr4TXCC/vtZzw6 +GVUBJMAxh8UY8sSCMO4QWBmxbfth722scCs0eCb1yp9K+1M5g24qFxan4fZVHmDE +z/0r+caLSE9KPf+oGnJaccKGz7mcAEOla24/GALrW3JMgnXlcgB1DYNQyUxul+/G +c3xT6TR5OG/T4MKDknN9eaHmRd8H5sMwdmj/BT5g2QKBgQDuBZwASn9LzPpwwbVq +gNLvo03NRwicLhoSe+Kl8Yao+m7GOKbpfzZgFej2zgq40jgBAJ2zSds1VKEBwKeX +CSaXJenKk3DN5trtzTsj3H8AvagNyZcV3YKlKLMc0HUPAWVKX5O6h322SJT3JV30 +NZTM46rTAD7dFeb9m+JmZ8+B7wKBgQDbcrgCNcijvtSApVw/hXLyhqzPqLDUGGhS +XtXx0r6mVuMKOVkgr48/mO/xgSL4wjs4Ps4S0/yqtt5PSFloCOuytpWeTQrBCLL0 +Or9dPuS+qLmJxkvWV1uoZkfdKpTY2s2ovyilQtovPdoACJnK83pdwArWp3VkrM9 +Al6Hp0v7iQKBgAx27rx1KkVl7peJDV8Ob/1sp95gIetL3sGpCy11gH/I3ZQz00nX +B5nwi8qg757OI3Cp/5gr/fbE/8l/tUcLi6HOsneRUQ73T++0F6zBF0WKqQpPzEGw +3+6WOwr/P6IRiKRkbPAPuF2bX3Gx20G2rJwuL/vsv14Ej5woVarXNN6xAoGAaUP9 +SmocRZfLfa5Uss/D1NyPVslXkVXn7OM7A1YRR99T51qdC1XLhDlLl/BXIzagi5ls +5pEzmXxA5Y0R/hqRXVfCK35PU0tl9Eud8g+yUFbFMXaieD1NZNkzTb8YSXGjx3dy ++ts3p+z66dNurUjQ7FW+Cg3cuk81lWVmjPHOO+kCgYEA5TJu0h6YSPr5dnNjPgrw +UxaGC0wtKX61w+tYOmpUKKCawi2K2tVTa3r/jJy27ClLHodwrNka4R/tNQD7EuRb +jD58iSXrHeaPVtbvBZCTASM+ssxEVrhDouz9KH8pKi7TLgA8WNQQjXoV9XRdg4Vj +7GFbXwUhhsoOgFWjAKjLol0= +-----END PRIVATE KEY-----", "client_email": "chirivia@chrivia-asxi.iam.gserviceaccount.com", "client_id": "109471356352632635196", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/chirivia%40chrivia-asxi.iam.gserviceaccount.com" } \ No newline at end of file diff --git a/index.php b/index.php index 7b6cd7c..09cb9b5 100644 --- a/index.php +++ b/index.php @@ -330,7 +330,8 @@ if (!isset($_SESSION['streak'])) {
diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..1d19169 --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,22 @@ +* +- `MathException` now extends `Exception` instead of `RuntimeException` + +* You may now run into type errors if you were passing `Stringable` objects to `of()` or any of the methods +internally calling `of()`, with `strict_types` enabled. You can fix this by casting `Stringable` objects to `string` +first. + +## [0.10.2](https://github.com/brick/math/releases/tag/0.10.2) - 2022-08-11 + +👌 **Improvements** + +- `BigRational::toFloat()` now simplifies the fraction before performing division (#73) thanks to @olsavmic + +## [0.10.1](https://github.com/brick/math/releases/tag/0.10.1) - 2022-08-02 + +✨ **New features** + +- `BigInteger::gcdMultiple()` returns the GCD of multiple `BigInteger` numbers + +## [0.10.0](https://github.com/brick/math/releases/tag/0.10.0) - 2022-06-18 + +💥 **Breaking changes** + +- Minimum PHP version is now 7.4 + +## [0.9.3](https://github.com/brick/math/releases/tag/0.9.3) - 2021-08-15 + +🚀 **Compatibility with PHP 8.1** + +- Support for custom object serialization; this removes a warning on PHP 8.1 due to the `Serializable` interface being deprecated (#60) thanks @TRowbotham + +## [0.9.2](https://github.com/brick/math/releases/tag/0.9.2) - 2021-01-20 + +🐛 **Bug fix** + +- Incorrect results could be returned when using the BCMath calculator, with a default scale set with `bcscale()`, on PHP >= 7.2 (#55). + +## [0.9.1](https://github.com/brick/math/releases/tag/0.9.1) - 2020-08-19 + +✨ **New features** + +- `BigInteger::not()` returns the bitwise `NOT` value + +🐛 **Bug fixes** + +- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers +- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available + +## [0.9.0](https://github.com/brick/math/releases/tag/0.9.0) - 2020-08-18 + +👌 **Improvements** + +- `BigNumber::of()` now accepts `.123` and `123.` formats, both of which return a `BigDecimal` + +💥 **Breaking changes** + +- Deprecated method `BigInteger::powerMod()` has been removed - use `modPow()` instead +- Deprecated method `BigInteger::parse()` has been removed - use `fromBase()` instead + +## [0.8.17](https://github.com/brick/math/releases/tag/0.8.17) - 2020-08-19 + +🐛 **Bug fix** + +- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers +- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available + +## [0.8.16](https://github.com/brick/math/releases/tag/0.8.16) - 2020-08-18 + +🚑 **Critical fix** + +- This version reintroduces the deprecated `BigInteger::parse()` method, that has been removed by mistake in version `0.8.9` and should have lasted for the whole `0.8` release cycle. + +✨ **New features** + +- `BigInteger::modInverse()` calculates a modular multiplicative inverse +- `BigInteger::fromBytes()` creates a `BigInteger` from a byte string +- `BigInteger::toBytes()` converts a `BigInteger` to a byte string +- `BigInteger::randomBits()` creates a pseudo-random `BigInteger` of a given bit length +- `BigInteger::randomRange()` creates a pseudo-random `BigInteger` between two bounds + +💩 **Deprecations** + +- `BigInteger::powerMod()` is now deprecated in favour of `modPow()` + +## [0.8.15](https://github.com/brick/math/releases/tag/0.8.15) - 2020-04-15 + +🐛 **Fixes** + +- added missing `ext-json` requirement, due to `BigNumber` implementing `JsonSerializable` + +⚡️ **Optimizations** + +- additional optimization in `BigInteger::remainder()` + +## [0.8.14](https://github.com/brick/math/releases/tag/0.8.14) - 2020-02-18 + +✨ **New features** + +- `BigInteger::getLowestSetBit()` returns the index of the rightmost one bit + +## [0.8.13](https://github.com/brick/math/releases/tag/0.8.13) - 2020-02-16 + +✨ **New features** + +- `BigInteger::isEven()` tests whether the number is even +- `BigInteger::isOdd()` tests whether the number is odd +- `BigInteger::testBit()` tests if a bit is set +- `BigInteger::getBitLength()` returns the number of bits in the minimal representation of the number + +## [0.8.12](https://github.com/brick/math/releases/tag/0.8.12) - 2020-02-03 + +🛠️ **Maintenance release** + +Classes are now annotated for better static analysis with [psalm](https://psalm.dev/). + +This is a maintenance release: no bug fixes, no new features, no breaking changes. + +## [0.8.11](https://github.com/brick/math/releases/tag/0.8.11) - 2020-01-23 + +✨ **New feature** + +`BigInteger::powerMod()` performs a power-with-modulo operation. Useful for crypto. + +## [0.8.10](https://github.com/brick/math/releases/tag/0.8.10) - 2020-01-21 + +✨ **New feature** + +`BigInteger::mod()` returns the **modulo** of two numbers. The *modulo* differs from the *remainder* when the signs of the operands are different. + +## [0.8.9](https://github.com/brick/math/releases/tag/0.8.9) - 2020-01-08 + +⚡️ **Performance improvements** + +A few additional optimizations in `BigInteger` and `BigDecimal` when one of the operands can be returned as is. Thanks to @tomtomsen in #24. + +## [0.8.8](https://github.com/brick/math/releases/tag/0.8.8) - 2019-04-25 + +🐛 **Bug fixes** + +- `BigInteger::toBase()` could return an empty string for zero values (BCMath & Native calculators only, GMP calculator unaffected) + +✨ **New features** + +- `BigInteger::toArbitraryBase()` converts a number to an arbitrary base, using a custom alphabet +- `BigInteger::fromArbitraryBase()` converts a string in an arbitrary base, using a custom alphabet, back to a number + +These methods can be used as the foundation to convert strings between different bases/alphabets, using BigInteger as an intermediate representation. + +💩 **Deprecations** + +- `BigInteger::parse()` is now deprecated in favour of `fromBase()` + +`BigInteger::fromBase()` works the same way as `parse()`, with 2 minor differences: + +- the `$base` parameter is required, it does not default to `10` +- it throws a `NumberFormatException` instead of an `InvalidArgumentException` when the number is malformed + +## [0.8.7](https://github.com/brick/math/releases/tag/0.8.7) - 2019-04-20 + +**Improvements** + +- Safer conversion from `float` when using custom locales +- **Much faster** `NativeCalculator` implementation 🚀 + +You can expect **at least a 3x performance improvement** for common arithmetic operations when using the library on systems without GMP or BCMath; it gets exponentially faster on multiplications with a high number of digits. This is due to calculations now being performed on whole blocks of digits (the block size depending on the platform, 32-bit or 64-bit) instead of digit-by-digit as before. + +## [0.8.6](https://github.com/brick/math/releases/tag/0.8.6) - 2019-04-11 + +**New method** + +`BigNumber::sum()` returns the sum of one or more numbers. + +## [0.8.5](https://github.com/brick/math/releases/tag/0.8.5) - 2019-02-12 + +**Bug fix**: `of()` factory methods could fail when passing a `float` in environments using a `LC_NUMERIC` locale with a decimal separator other than `'.'` (#20). + +Thanks @manowark 👍 + +## [0.8.4](https://github.com/brick/math/releases/tag/0.8.4) - 2018-12-07 + +**New method** + +`BigDecimal::sqrt()` calculates the square root of a decimal number, to a given scale. + +## [0.8.3](https://github.com/brick/math/releases/tag/0.8.3) - 2018-12-06 + +**New method** + +`BigInteger::sqrt()` calculates the square root of a number (thanks @peter279k). + +**New exception** + +`NegativeNumberException` is thrown when calling `sqrt()` on a negative number. + +## [0.8.2](https://github.com/brick/math/releases/tag/0.8.2) - 2018-11-08 + +**Performance update** + +- Further improvement of `toInt()` performance +- `NativeCalculator` can now perform some multiplications more efficiently + +## [0.8.1](https://github.com/brick/math/releases/tag/0.8.1) - 2018-11-07 + +Performance optimization of `toInt()` methods. + +## [0.8.0](https://github.com/brick/math/releases/tag/0.8.0) - 2018-10-13 + +**Breaking changes** + +The following deprecated methods have been removed. Use the new method name instead: + +| Method removed | Replacement method | +| --- | --- | +| `BigDecimal::getIntegral()` | `BigDecimal::getIntegralPart()` | +| `BigDecimal::getFraction()` | `BigDecimal::getFractionalPart()` | + +--- + +**New features** + +`BigInteger` has been augmented with 5 new methods for bitwise operations: + +| New method | Description | +| --- | --- | +| `and()` | performs a bitwise `AND` operation on two numbers | +| `or()` | performs a bitwise `OR` operation on two numbers | +| `xor()` | performs a bitwise `XOR` operation on two numbers | +| `shiftedLeft()` | returns the number shifted left by a number of bits | +| `shiftedRight()` | returns the number shifted right by a number of bits | + +Thanks to @DASPRiD 👍 + +## [0.7.3](https://github.com/brick/math/releases/tag/0.7.3) - 2018-08-20 + +**New method:** `BigDecimal::hasNonZeroFractionalPart()` + +**Renamed/deprecated methods:** + +- `BigDecimal::getIntegral()` has been renamed to `getIntegralPart()` and is now deprecated +- `BigDecimal::getFraction()` has been renamed to `getFractionalPart()` and is now deprecated + +## [0.7.2](https://github.com/brick/math/releases/tag/0.7.2) - 2018-07-21 + +**Performance update** + +`BigInteger::parse()` and `toBase()` now use GMP's built-in base conversion features when available. + +## [0.7.1](https://github.com/brick/math/releases/tag/0.7.1) - 2018-03-01 + +This is a maintenance release, no code has been changed. + +- When installed with `--no-dev`, the autoloader does not autoload tests anymore +- Tests and other files unnecessary for production are excluded from the dist package + +This will help make installations more compact. + +## [0.7.0](https://github.com/brick/math/releases/tag/0.7.0) - 2017-10-02 + +Methods renamed: + +- `BigNumber:sign()` has been renamed to `getSign()` +- `BigDecimal::unscaledValue()` has been renamed to `getUnscaledValue()` +- `BigDecimal::scale()` has been renamed to `getScale()` +- `BigDecimal::integral()` has been renamed to `getIntegral()` +- `BigDecimal::fraction()` has been renamed to `getFraction()` +- `BigRational::numerator()` has been renamed to `getNumerator()` +- `BigRational::denominator()` has been renamed to `getDenominator()` + +Classes renamed: + +- `ArithmeticException` has been renamed to `MathException` + +## [0.6.2](https://github.com/brick/math/releases/tag/0.6.2) - 2017-10-02 + +The base class for all exceptions is now `MathException`. +`ArithmeticException` has been deprecated, and will be removed in 0.7.0. + +## [0.6.1](https://github.com/brick/math/releases/tag/0.6.1) - 2017-10-02 + +A number of methods have been renamed: + +- `BigNumber:sign()` is deprecated; use `getSign()` instead +- `BigDecimal::unscaledValue()` is deprecated; use `getUnscaledValue()` instead +- `BigDecimal::scale()` is deprecated; use `getScale()` instead +- `BigDecimal::integral()` is deprecated; use `getIntegral()` instead +- `BigDecimal::fraction()` is deprecated; use `getFraction()` instead +- `BigRational::numerator()` is deprecated; use `getNumerator()` instead +- `BigRational::denominator()` is deprecated; use `getDenominator()` instead + +The old methods will be removed in version 0.7.0. + +## [0.6.0](https://github.com/brick/math/releases/tag/0.6.0) - 2017-08-25 + +- Minimum PHP version is now [7.1](https://gophp71.org/); for PHP 5.6 and PHP 7.0 support, use version `0.5` +- Deprecated method `BigDecimal::withScale()` has been removed; use `toScale()` instead +- Method `BigNumber::toInteger()` has been renamed to `toInt()` + +## [0.5.4](https://github.com/brick/math/releases/tag/0.5.4) - 2016-10-17 + +`BigNumber` classes now implement [JsonSerializable](http://php.net/manual/en/class.jsonserializable.php). +The JSON output is always a string. + +## [0.5.3](https://github.com/brick/math/releases/tag/0.5.3) - 2016-03-31 + +This is a bugfix release. Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. + +## [0.5.2](https://github.com/brick/math/releases/tag/0.5.2) - 2015-08-06 + +The `$scale` parameter of `BigDecimal::dividedBy()` is now optional again. + +## [0.5.1](https://github.com/brick/math/releases/tag/0.5.1) - 2015-07-05 + +**New method: `BigNumber::toScale()`** + +This allows to convert any `BigNumber` to a `BigDecimal` with a given scale, using rounding if necessary. + +## [0.5.0](https://github.com/brick/math/releases/tag/0.5.0) - 2015-07-04 + +**New features** +- Common `BigNumber` interface for all classes, with the following methods: + - `sign()` and derived methods (`isZero()`, `isPositive()`, ...) + - `compareTo()` and derived methods (`isEqualTo()`, `isGreaterThan()`, ...) that work across different `BigNumber` types + - `toBigInteger()`, `toBigDecimal()`, `toBigRational`() conversion methods + - `toInteger()` and `toFloat()` conversion methods to native types +- Unified `of()` behaviour: every class now accepts any type of number, provided that it can be safely converted to the current type +- New method: `BigDecimal::exactlyDividedBy()`; this method automatically computes the scale of the result, provided that the division yields a finite number of digits +- New methods: `BigRational::quotient()` and `remainder()` +- Fine-grained exceptions: `DivisionByZeroException`, `RoundingNecessaryException`, `NumberFormatException` +- Factory methods `zero()`, `one()` and `ten()` available in all classes +- Rounding mode reintroduced in `BigInteger::dividedBy()` + +This release also comes with many performance improvements. + +--- + +**Breaking changes** +- `BigInteger`: + - `getSign()` is renamed to `sign()` + - `toString()` is renamed to `toBase()` + - `BigInteger::dividedBy()` now throws an exception by default if the remainder is not zero; use `quotient()` to get the previous behaviour +- `BigDecimal`: + - `getSign()` is renamed to `sign()` + - `getUnscaledValue()` is renamed to `unscaledValue()` + - `getScale()` is renamed to `scale()` + - `getIntegral()` is renamed to `integral()` + - `getFraction()` is renamed to `fraction()` + - `divideAndRemainder()` is renamed to `quotientAndRemainder()` + - `dividedBy()` now takes a **mandatory** `$scale` parameter **before** the rounding mode + - `toBigInteger()` does not accept a `$roundingMode` parameter anymore + - `toBigRational()` does not simplify the fraction anymore; explicitly add `->simplified()` to get the previous behaviour +- `BigRational`: + - `getSign()` is renamed to `sign()` + - `getNumerator()` is renamed to `numerator()` + - `getDenominator()` is renamed to `denominator()` + - `of()` is renamed to `nd()`, while `parse()` is renamed to `of()` +- Miscellaneous: + - `ArithmeticException` is moved to an `Exception\` sub-namespace + - `of()` factory methods now throw `NumberFormatException` instead of `InvalidArgumentException` + +## [0.4.3](https://github.com/brick/math/releases/tag/0.4.3) - 2016-03-31 + +Backport of two bug fixes from the 0.5 branch: +- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected +- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. + +## [0.4.2](https://github.com/brick/math/releases/tag/0.4.2) - 2015-06-16 + +New method: `BigDecimal::stripTrailingZeros()` + +## [0.4.1](https://github.com/brick/math/releases/tag/0.4.1) - 2015-06-12 + +Introducing a `BigRational` class, to perform calculations on fractions of any size. + +## [0.4.0](https://github.com/brick/math/releases/tag/0.4.0) - 2015-06-12 + +Rounding modes have been removed from `BigInteger`, and are now a concept specific to `BigDecimal`. + +`BigInteger::dividedBy()` now always returns the quotient of the division. + +## [0.3.5](https://github.com/brick/math/releases/tag/0.3.5) - 2016-03-31 + +Backport of two bug fixes from the 0.5 branch: + +- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected +- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. + +## [0.3.4](https://github.com/brick/math/releases/tag/0.3.4) - 2015-06-11 + +New methods: +- `BigInteger::remainder()` returns the remainder of a division only +- `BigInteger::gcd()` returns the greatest common divisor of two numbers + +## [0.3.3](https://github.com/brick/math/releases/tag/0.3.3) - 2015-06-07 + +Fix `toString()` not handling negative numbers. + +## [0.3.2](https://github.com/brick/math/releases/tag/0.3.2) - 2015-06-07 + +`BigInteger` and `BigDecimal` now have a `getSign()` method that returns: +- `-1` if the number is negative +- `0` if the number is zero +- `1` if the number is positive + +## [0.3.1](https://github.com/brick/math/releases/tag/0.3.1) - 2015-06-05 + +Minor performance improvements + +## [0.3.0](https://github.com/brick/math/releases/tag/0.3.0) - 2015-06-04 + +The `$roundingMode` and `$scale` parameters have been swapped in `BigDecimal::dividedBy()`. + +## [0.2.2](https://github.com/brick/math/releases/tag/0.2.2) - 2015-06-04 + +Stronger immutability guarantee for `BigInteger` and `BigDecimal`. + +So far, it would have been possible to break immutability of these classes by calling the `unserialize()` internal function. This release fixes that. + +## [0.2.1](https://github.com/brick/math/releases/tag/0.2.1) - 2015-06-02 + +Added `BigDecimal::divideAndRemainder()` + +## [0.2.0](https://github.com/brick/math/releases/tag/0.2.0) - 2015-05-22 + +- `min()` and `max()` do not accept an `array` anymore, but a variable number of parameters +- **minimum PHP version is now 5.6** +- continuous integration with PHP 7 + +## [0.1.1](https://github.com/brick/math/releases/tag/0.1.1) - 2014-09-01 + +- Added `BigInteger::power()` +- Added HHVM support + +## [0.1.0](https://github.com/brick/math/releases/tag/0.1.0) - 2014-08-31 + +First beta release. + diff --git a/vendor/brick/math/LICENSE b/vendor/brick/math/LICENSE new file mode 100644 index 0000000..f9b724f --- /dev/null +++ b/vendor/brick/math/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013-present Benjamin Morel + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/brick/math/composer.json b/vendor/brick/math/composer.json new file mode 100644 index 0000000..ad1dfe0 --- /dev/null +++ b/vendor/brick/math/composer.json @@ -0,0 +1,39 @@ +{ + "name": "brick/math", + "description": "Arbitrary-precision arithmetic library", + "type": "library", + "keywords": [ + "Brick", + "Math", + "Mathematics", + "Arbitrary-precision", + "Arithmetic", + "BigInteger", + "BigDecimal", + "BigRational", + "BigNumber", + "Bignum", + "Decimal", + "Rational", + "Integer" + ], + "license": "MIT", + "require": { + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.5", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "2.1.22" + }, + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Brick\\Math\\Tests\\": "tests/" + } + } +} diff --git a/vendor/brick/math/phpstan.neon b/vendor/brick/math/phpstan.neon new file mode 100644 index 0000000..216ba1e --- /dev/null +++ b/vendor/brick/math/phpstan.neon @@ -0,0 +1,14 @@ +parameters: + level: 10 + checkUninitializedProperties: true + paths: + - src + ignoreErrors: + - '~Impure call to function array_shift\(\) in pure method~' + - '~Possibly impure call to function assert\(\) in pure method~' + - '~Possibly impure call to function hex2bin\(\) in pure method~' + - '~Possibly impure call to function preg_match\(\) in pure method~' + - '~Impure static variable in pure method Brick\\Math\\Big(Integer|Decimal|Rational)::(zero|one|ten)\(\)~' + - + message: '~Parameter #\d \$\S+ of function bc\S+ expects numeric-string, string given~' + path: src/Internal/Calculator/BcMathCalculator.php diff --git a/vendor/brick/math/src/BigDecimal.php b/vendor/brick/math/src/BigDecimal.php new file mode 100644 index 0000000..1a540c7 --- /dev/null +++ b/vendor/brick/math/src/BigDecimal.php @@ -0,0 +1,862 @@ +value = $value; + $this->scale = $scale; + } + + #[Override] + protected static function from(BigNumber $number): static + { + return $number->toBigDecimal(); + } + + /** + * Creates a BigDecimal from an unscaled value and a scale. + * + * Example: `(12345, 3)` will result in the BigDecimal `12.345`. + * + * @param BigNumber|int|float|string $value The unscaled value. Must be convertible to a BigInteger. + * @param int $scale The scale of the number. If negative, the scale will be set to zero + * and the unscaled value will be adjusted accordingly. + * + * @pure + */ + public static function ofUnscaledValue(BigNumber|int|float|string $value, int $scale = 0) : BigDecimal + { + $value = (string) BigInteger::of($value); + + if ($scale < 0) { + if ($value !== '0') { + $value .= \str_repeat('0', -$scale); + } + $scale = 0; + } + + return new BigDecimal($value, $scale); + } + + /** + * Returns a BigDecimal representing zero, with a scale of zero. + * + * @pure + */ + public static function zero() : BigDecimal + { + /** @var BigDecimal|null $zero */ + static $zero; + + if ($zero === null) { + $zero = new BigDecimal('0'); + } + + return $zero; + } + + /** + * Returns a BigDecimal representing one, with a scale of zero. + * + * @pure + */ + public static function one() : BigDecimal + { + /** @var BigDecimal|null $one */ + static $one; + + if ($one === null) { + $one = new BigDecimal('1'); + } + + return $one; + } + + /** + * Returns a BigDecimal representing ten, with a scale of zero. + * + * @pure + */ + public static function ten() : BigDecimal + { + /** @var BigDecimal|null $ten */ + static $ten; + + if ($ten === null) { + $ten = new BigDecimal('10'); + } + + return $ten; + } + + /** + * Returns the sum of this number and the given one. + * + * The result has a scale of `max($this->scale, $that->scale)`. + * + * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigDecimal. + * + * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. + * + * @pure + */ + public function plus(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->value === '0' && $that->scale <= $this->scale) { + return $this; + } + + if ($this->value === '0' && $this->scale <= $that->scale) { + return $that; + } + + [$a, $b] = $this->scaleValues($this, $that); + + $value = CalculatorRegistry::get()->add($a, $b); + $scale = $this->scale > $that->scale ? $this->scale : $that->scale; + + return new BigDecimal($value, $scale); + } + + /** + * Returns the difference of this number and the given one. + * + * The result has a scale of `max($this->scale, $that->scale)`. + * + * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigDecimal. + * + * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. + * + * @pure + */ + public function minus(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->value === '0' && $that->scale <= $this->scale) { + return $this; + } + + [$a, $b] = $this->scaleValues($this, $that); + + $value = CalculatorRegistry::get()->sub($a, $b); + $scale = $this->scale > $that->scale ? $this->scale : $that->scale; + + return new BigDecimal($value, $scale); + } + + /** + * Returns the product of this number and the given one. + * + * The result has a scale of `$this->scale + $that->scale`. + * + * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigDecimal. + * + * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigDecimal. + * + * @pure + */ + public function multipliedBy(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->value === '1' && $that->scale === 0) { + return $this; + } + + if ($this->value === '1' && $this->scale === 0) { + return $that; + } + + $value = CalculatorRegistry::get()->mul($this->value, $that->value); + $scale = $this->scale + $that->scale; + + return new BigDecimal($value, $scale); + } + + /** + * Returns the result of the division of this number by the given one, at the given scale. + * + * @param BigNumber|int|float|string $that The divisor. + * @param int|null $scale The desired scale, or null to use the scale of this number. + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. + * + * @throws \InvalidArgumentException If the scale or rounding mode is invalid. + * @throws MathException If the number is invalid, is zero, or rounding was necessary. + * + * @pure + */ + public function dividedBy(BigNumber|int|float|string $that, ?int $scale = null, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->isZero()) { + throw DivisionByZeroException::divisionByZero(); + } + + if ($scale === null) { + $scale = $this->scale; + } elseif ($scale < 0) { + throw new \InvalidArgumentException('Scale cannot be negative.'); + } + + if ($that->value === '1' && $that->scale === 0 && $scale === $this->scale) { + return $this; + } + + $p = $this->valueWithMinScale($that->scale + $scale); + $q = $that->valueWithMinScale($this->scale - $scale); + + $result = CalculatorRegistry::get()->divRound($p, $q, $roundingMode); + + return new BigDecimal($result, $scale); + } + + /** + * Returns the exact result of the division of this number by the given one. + * + * The scale of the result is automatically calculated to fit all the fraction digits. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. + * + * @throws MathException If the divisor is not a valid number, is not convertible to a BigDecimal, is zero, + * or the result yields an infinite number of digits. + * + * @pure + */ + public function exactlyDividedBy(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->value === '0') { + throw DivisionByZeroException::divisionByZero(); + } + + [, $b] = $this->scaleValues($this, $that); + + $d = \rtrim($b, '0'); + $scale = \strlen($b) - \strlen($d); + + $calculator = CalculatorRegistry::get(); + + foreach ([5, 2] as $prime) { + for (;;) { + $lastDigit = (int) $d[-1]; + + if ($lastDigit % $prime !== 0) { + break; + } + + $d = $calculator->divQ($d, (string) $prime); + $scale++; + } + } + + return $this->dividedBy($that, $scale)->stripTrailingZeros(); + } + + /** + * Limits (clamps) this number between the given minimum and maximum values. + * + * If the number is lower than $min, returns a copy of $min. + * If the number is greater than $max, returns a copy of $max. + * Otherwise, returns this number unchanged. + * + * @param BigNumber|int|float|string $min The minimum. Must be convertible to a BigDecimal. + * @param BigNumber|int|float|string $max The maximum. Must be convertible to a BigDecimal. + * + * @throws MathException If min/max are not convertible to a BigDecimal. + */ + public function clamp(BigNumber|int|float|string $min, BigNumber|int|float|string $max) : BigDecimal + { + if ($this->isLessThan($min)) { + return BigDecimal::of($min); + } elseif ($this->isGreaterThan($max)) { + return BigDecimal::of($max); + } + return $this; + } + + /** + * Returns this number exponentiated to the given value. + * + * The result has a scale of `$this->scale * $exponent`. + * + * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. + * + * @pure + */ + public function power(int $exponent) : BigDecimal + { + if ($exponent === 0) { + return BigDecimal::one(); + } + + if ($exponent === 1) { + return $this; + } + + if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { + throw new \InvalidArgumentException(\sprintf( + 'The exponent %d is not in the range 0 to %d.', + $exponent, + Calculator::MAX_POWER + )); + } + + return new BigDecimal(CalculatorRegistry::get()->pow($this->value, $exponent), $this->scale * $exponent); + } + + /** + * Returns the quotient of the division of this number by the given one. + * + * The quotient has a scale of `0`. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. + * + * @throws MathException If the divisor is not a valid decimal number, or is zero. + * + * @pure + */ + public function quotient(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->isZero()) { + throw DivisionByZeroException::divisionByZero(); + } + + $p = $this->valueWithMinScale($that->scale); + $q = $that->valueWithMinScale($this->scale); + + $quotient = CalculatorRegistry::get()->divQ($p, $q); + + return new BigDecimal($quotient, 0); + } + + /** + * Returns the remainder of the division of this number by the given one. + * + * The remainder has a scale of `max($this->scale, $that->scale)`. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. + * + * @throws MathException If the divisor is not a valid decimal number, or is zero. + * + * @pure + */ + public function remainder(BigNumber|int|float|string $that) : BigDecimal + { + $that = BigDecimal::of($that); + + if ($that->isZero()) { + throw DivisionByZeroException::divisionByZero(); + } + + $p = $this->valueWithMinScale($that->scale); + $q = $that->valueWithMinScale($this->scale); + + $remainder = CalculatorRegistry::get()->divR($p, $q); + + $scale = $this->scale > $that->scale ? $this->scale : $that->scale; + + return new BigDecimal($remainder, $scale); + } + + /** + * Returns the quotient and remainder of the division of this number by the given one. + * + * The quotient has a scale of `0`, and the remainder has a scale of `max($this->scale, $that->scale)`. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. + * + * @return array{BigDecimal, BigDecimal} An array containing the quotient and the remainder. + * + * @throws MathException If the divisor is not a valid decimal number, or is zero. + * + * @pure + */ + public function quotientAndRemainder(BigNumber|int|float|string $that) : array + { + $that = BigDecimal::of($that); + + if ($that->isZero()) { + throw DivisionByZeroException::divisionByZero(); + } + + $p = $this->valueWithMinScale($that->scale); + $q = $that->valueWithMinScale($this->scale); + + [$quotient, $remainder] = CalculatorRegistry::get()->divQR($p, $q); + + $scale = $this->scale > $that->scale ? $this->scale : $that->scale; + + $quotient = new BigDecimal($quotient, 0); + $remainder = new BigDecimal($remainder, $scale); + + return [$quotient, $remainder]; + } + + /** + * Returns the square root of this number, rounded down to the given number of decimals. + * + * @throws \InvalidArgumentException If the scale is negative. + * @throws NegativeNumberException If this number is negative. + * + * @pure + */ + public function sqrt(int $scale) : BigDecimal + { + if ($scale < 0) { + throw new \InvalidArgumentException('Scale cannot be negative.'); + } + + if ($this->value === '0') { + return new BigDecimal('0', $scale); + } + + if ($this->value[0] === '-') { + throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); + } + + $value = $this->value; + $addDigits = 2 * $scale - $this->scale; + + if ($addDigits > 0) { + // add zeros + $value .= \str_repeat('0', $addDigits); + } elseif ($addDigits < 0) { + // trim digits + if (-$addDigits >= \strlen($this->value)) { + // requesting a scale too low, will always yield a zero result + return new BigDecimal('0', $scale); + } + + $value = \substr($value, 0, $addDigits); + } + + $value = CalculatorRegistry::get()->sqrt($value); + + return new BigDecimal($value, $scale); + } + + /** + * Returns a copy of this BigDecimal with the decimal point moved $n places to the left. + * + * @pure + */ + public function withPointMovedLeft(int $n) : BigDecimal + { + if ($n === 0) { + return $this; + } + + if ($n < 0) { + return $this->withPointMovedRight(-$n); + } + + return new BigDecimal($this->value, $this->scale + $n); + } + + /** + * Returns a copy of this BigDecimal with the decimal point moved $n places to the right. + * + * @pure + */ + public function withPointMovedRight(int $n) : BigDecimal + { + if ($n === 0) { + return $this; + } + + if ($n < 0) { + return $this->withPointMovedLeft(-$n); + } + + $value = $this->value; + $scale = $this->scale - $n; + + if ($scale < 0) { + if ($value !== '0') { + $value .= \str_repeat('0', -$scale); + } + $scale = 0; + } + + return new BigDecimal($value, $scale); + } + + /** + * Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part. + * + * @pure + */ + public function stripTrailingZeros() : BigDecimal + { + if ($this->scale === 0) { + return $this; + } + + $trimmedValue = \rtrim($this->value, '0'); + + if ($trimmedValue === '') { + return BigDecimal::zero(); + } + + $trimmableZeros = \strlen($this->value) - \strlen($trimmedValue); + + if ($trimmableZeros === 0) { + return $this; + } + + if ($trimmableZeros > $this->scale) { + $trimmableZeros = $this->scale; + } + + $value = \substr($this->value, 0, -$trimmableZeros); + $scale = $this->scale - $trimmableZeros; + + return new BigDecimal($value, $scale); + } + + /** + * Returns the absolute value of this number. + * + * @pure + */ + public function abs() : BigDecimal + { + return $this->isNegative() ? $this->negated() : $this; + } + + /** + * Returns the negated value of this number. + * + * @pure + */ + public function negated() : BigDecimal + { + return new BigDecimal(CalculatorRegistry::get()->neg($this->value), $this->scale); + } + + #[Override] + public function compareTo(BigNumber|int|float|string $that) : int + { + $that = BigNumber::of($that); + + if ($that instanceof BigInteger) { + $that = $that->toBigDecimal(); + } + + if ($that instanceof BigDecimal) { + [$a, $b] = $this->scaleValues($this, $that); + + return CalculatorRegistry::get()->cmp($a, $b); + } + + return - $that->compareTo($this); + } + + #[Override] + public function getSign() : int + { + return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); + } + + /** + * @pure + */ + public function getUnscaledValue() : BigInteger + { + return self::newBigInteger($this->value); + } + + /** + * @pure + */ + public function getScale() : int + { + return $this->scale; + } + + /** + * Returns the number of significant digits in the number. + * + * This is the number of digits to both sides of the decimal point, stripped of leading zeros. + * The sign has no impact on the result. + * + * Examples: + * 0 => 0 + * 0.0 => 0 + * 123 => 3 + * 123.456 => 6 + * 0.00123 => 3 + * 0.0012300 => 5 + * + * @pure + */ + public function getPrecision(): int + { + $value = $this->value; + + if ($value === '0') { + return 0; + } + + $length = \strlen($value); + + return ($value[0] === '-') ? $length - 1 : $length; + } + + /** + * Returns a string representing the integral part of this decimal number. + * + * Example: `-123.456` => `-123`. + * + * @pure + */ + public function getIntegralPart() : string + { + if ($this->scale === 0) { + return $this->value; + } + + $value = $this->getUnscaledValueWithLeadingZeros(); + + return \substr($value, 0, -$this->scale); + } + + /** + * Returns a string representing the fractional part of this decimal number. + * + * If the scale is zero, an empty string is returned. + * + * Examples: `-123.456` => '456', `123` => ''. + * + * @pure + */ + public function getFractionalPart() : string + { + if ($this->scale === 0) { + return ''; + } + + $value = $this->getUnscaledValueWithLeadingZeros(); + + return \substr($value, -$this->scale); + } + + /** + * Returns whether this decimal number has a non-zero fractional part. + * + * @pure + */ + public function hasNonZeroFractionalPart() : bool + { + return $this->getFractionalPart() !== \str_repeat('0', $this->scale); + } + + #[Override] + public function toBigInteger() : BigInteger + { + $zeroScaleDecimal = $this->scale === 0 ? $this : $this->dividedBy(1, 0); + + return self::newBigInteger($zeroScaleDecimal->value); + } + + #[Override] + public function toBigDecimal() : BigDecimal + { + return $this; + } + + #[Override] + public function toBigRational() : BigRational + { + $numerator = self::newBigInteger($this->value); + $denominator = self::newBigInteger('1' . \str_repeat('0', $this->scale)); + + return self::newBigRational($numerator, $denominator, false); + } + + #[Override] + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + { + if ($scale === $this->scale) { + return $this; + } + + return $this->dividedBy(BigDecimal::one(), $scale, $roundingMode); + } + + #[Override] + public function toInt() : int + { + return $this->toBigInteger()->toInt(); + } + + #[Override] + public function toFloat() : float + { + return (float) (string) $this; + } + + /** + * @return numeric-string + */ + #[Override] + public function __toString() : string + { + if ($this->scale === 0) { + /** @var numeric-string */ + return $this->value; + } + + $value = $this->getUnscaledValueWithLeadingZeros(); + + /** @phpstan-ignore return.type */ + return \substr($value, 0, -$this->scale) . '.' . \substr($value, -$this->scale); + } + + /** + * This method is required for serializing the object and SHOULD NOT be accessed directly. + * + * @internal + * + * @return array{value: string, scale: int} + */ + public function __serialize(): array + { + return ['value' => $this->value, 'scale' => $this->scale]; + } + + /** + * This method is only here to allow unserializing the object and cannot be accessed directly. + * + * @internal + * + * @param array{value: string, scale: int} $data + * + * @throws \LogicException + */ + public function __unserialize(array $data): void + { + /** @phpstan-ignore isset.initializedProperty */ + if (isset($this->value)) { + throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); + } + + /** @phpstan-ignore deadCode.unreachable */ + $this->value = $data['value']; + $this->scale = $data['scale']; + } + + /** + * Puts the internal values of the given decimal numbers on the same scale. + * + * @return array{string, string} The scaled integer values of $x and $y. + * + * @pure + */ + private function scaleValues(BigDecimal $x, BigDecimal $y) : array + { + $a = $x->value; + $b = $y->value; + + if ($b !== '0' && $x->scale > $y->scale) { + $b .= \str_repeat('0', $x->scale - $y->scale); + } elseif ($a !== '0' && $x->scale < $y->scale) { + $a .= \str_repeat('0', $y->scale - $x->scale); + } + + return [$a, $b]; + } + + /** + * @pure + */ + private function valueWithMinScale(int $scale) : string + { + $value = $this->value; + + if ($this->value !== '0' && $scale > $this->scale) { + $value .= \str_repeat('0', $scale - $this->scale); + } + + return $value; + } + + /** + * Adds leading zeros if necessary to the unscaled value to represent the full decimal number. + * + * @pure + */ + private function getUnscaledValueWithLeadingZeros() : string + { + $value = $this->value; + $targetLength = $this->scale + 1; + $negative = ($value[0] === '-'); + $length = \strlen($value); + + if ($negative) { + $length--; + } + + if ($length >= $targetLength) { + return $this->value; + } + + if ($negative) { + $value = \substr($value, 1); + } + + $value = \str_pad($value, $targetLength, '0', STR_PAD_LEFT); + + if ($negative) { + $value = '-' . $value; + } + + return $value; + } +} diff --git a/vendor/brick/math/src/BigInteger.php b/vendor/brick/math/src/BigInteger.php new file mode 100644 index 0000000..48a7bb3 --- /dev/null +++ b/vendor/brick/math/src/BigInteger.php @@ -0,0 +1,1139 @@ +value = $value; + } + + #[Override] + protected static function from(BigNumber $number): static + { + return $number->toBigInteger(); + } + + /** + * Creates a number from a string in a given base. + * + * The string can optionally be prefixed with the `+` or `-` sign. + * + * Bases greater than 36 are not supported by this method, as there is no clear consensus on which of the lowercase + * or uppercase characters should come first. Instead, this method accepts any base up to 36, and does not + * differentiate lowercase and uppercase characters, which are considered equal. + * + * For bases greater than 36, and/or custom alphabets, use the fromArbitraryBase() method. + * + * @param string $number The number to convert, in the given base. + * @param int $base The base of the number, between 2 and 36. + * + * @throws NumberFormatException If the number is empty, or contains invalid chars for the given base. + * @throws \InvalidArgumentException If the base is out of range. + * + * @pure + */ + public static function fromBase(string $number, int $base) : BigInteger + { + if ($number === '') { + throw new NumberFormatException('The number cannot be empty.'); + } + + if ($base < 2 || $base > 36) { + throw new \InvalidArgumentException(\sprintf('Base %d is not in range 2 to 36.', $base)); + } + + if ($number[0] === '-') { + $sign = '-'; + $number = \substr($number, 1); + } elseif ($number[0] === '+') { + $sign = ''; + $number = \substr($number, 1); + } else { + $sign = ''; + } + + if ($number === '') { + throw new NumberFormatException('The number cannot be empty.'); + } + + $number = \ltrim($number, '0'); + + if ($number === '') { + // The result will be the same in any base, avoid further calculation. + return BigInteger::zero(); + } + + if ($number === '1') { + // The result will be the same in any base, avoid further calculation. + return new BigInteger($sign . '1'); + } + + $pattern = '/[^' . \substr(Calculator::ALPHABET, 0, $base) . ']/'; + + if (\preg_match($pattern, \strtolower($number), $matches) === 1) { + throw new NumberFormatException(\sprintf('"%s" is not a valid character in base %d.', $matches[0], $base)); + } + + if ($base === 10) { + // The number is usable as is, avoid further calculation. + return new BigInteger($sign . $number); + } + + $result = CalculatorRegistry::get()->fromBase($number, $base); + + return new BigInteger($sign . $result); + } + + /** + * Parses a string containing an integer in an arbitrary base, using a custom alphabet. + * + * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers. + * + * @param string $number The number to parse. + * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. + * + * @throws NumberFormatException If the given number is empty or contains invalid chars for the given alphabet. + * @throws \InvalidArgumentException If the alphabet does not contain at least 2 chars. + * + * @pure + */ + public static function fromArbitraryBase(string $number, string $alphabet) : BigInteger + { + if ($number === '') { + throw new NumberFormatException('The number cannot be empty.'); + } + + $base = \strlen($alphabet); + + if ($base < 2) { + throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); + } + + $pattern = '/[^' . \preg_quote($alphabet, '/') . ']/'; + + if (\preg_match($pattern, $number, $matches) === 1) { + throw NumberFormatException::charNotInAlphabet($matches[0]); + } + + $number = CalculatorRegistry::get()->fromArbitraryBase($number, $alphabet, $base); + + return new BigInteger($number); + } + + /** + * Translates a string of bytes containing the binary representation of a BigInteger into a BigInteger. + * + * The input string is assumed to be in big-endian byte-order: the most significant byte is in the zeroth element. + * + * If `$signed` is true, the input is assumed to be in two's-complement representation, and the leading bit is + * interpreted as a sign bit. If `$signed` is false, the input is interpreted as an unsigned number, and the + * resulting BigInteger will always be positive or zero. + * + * This method can be used to retrieve a number exported by `toBytes()`, as long as the `$signed` flags match. + * + * @param string $value The byte string. + * @param bool $signed Whether to interpret as a signed number in two's-complement representation with a leading + * sign bit. + * + * @throws NumberFormatException If the string is empty. + * + * @pure + */ + public static function fromBytes(string $value, bool $signed = true) : BigInteger + { + if ($value === '') { + throw new NumberFormatException('The byte string must not be empty.'); + } + + $twosComplement = false; + + if ($signed) { + $x = \ord($value[0]); + + if (($twosComplement = ($x >= 0x80))) { + $value = ~$value; + } + } + + $number = self::fromBase(\bin2hex($value), 16); + + if ($twosComplement) { + return $number->plus(1)->negated(); + } + + return $number; + } + + /** + * Generates a pseudo-random number in the range 0 to 2^numBits - 1. + * + * Using the default random bytes generator, this method is suitable for cryptographic use. + * + * @param int $numBits The number of bits. + * @param (callable(int): string)|null $randomBytesGenerator A function that accepts a number of bytes, and returns + * a string of random bytes of the given length. Defaults + * to the `random_bytes()` function. + * + * @throws \InvalidArgumentException If $numBits is negative. + */ + public static function randomBits(int $numBits, ?callable $randomBytesGenerator = null) : BigInteger + { + if ($numBits < 0) { + throw new \InvalidArgumentException('The number of bits cannot be negative.'); + } + + if ($numBits === 0) { + return BigInteger::zero(); + } + + if ($randomBytesGenerator === null) { + $randomBytesGenerator = random_bytes(...); + } + + /** @var int<1, max> $byteLength */ + $byteLength = \intdiv($numBits - 1, 8) + 1; + + $extraBits = ($byteLength * 8 - $numBits); + $bitmask = \chr(0xFF >> $extraBits); + + $randomBytes = $randomBytesGenerator($byteLength); + $randomBytes[0] = $randomBytes[0] & $bitmask; + + return self::fromBytes($randomBytes, false); + } + + /** + * Generates a pseudo-random number between `$min` and `$max`. + * + * Using the default random bytes generator, this method is suitable for cryptographic use. + * + * @param BigNumber|int|float|string $min The lower bound. Must be convertible to a BigInteger. + * @param BigNumber|int|float|string $max The upper bound. Must be convertible to a BigInteger. + * @param (callable(int): string)|null $randomBytesGenerator A function that accepts a number of bytes, and returns + * a string of random bytes of the given length. Defaults + * to the `random_bytes()` function. + * + * @throws MathException If one of the parameters cannot be converted to a BigInteger, + * or `$min` is greater than `$max`. + */ + public static function randomRange( + BigNumber|int|float|string $min, + BigNumber|int|float|string $max, + ?callable $randomBytesGenerator = null + ) : BigInteger { + $min = BigInteger::of($min); + $max = BigInteger::of($max); + + if ($min->isGreaterThan($max)) { + throw new MathException('$min cannot be greater than $max.'); + } + + if ($min->isEqualTo($max)) { + return $min; + } + + $diff = $max->minus($min); + $bitLength = $diff->getBitLength(); + + // try until the number is in range (50% to 100% chance of success) + do { + $randomNumber = self::randomBits($bitLength, $randomBytesGenerator); + } while ($randomNumber->isGreaterThan($diff)); + + return $randomNumber->plus($min); + } + + /** + * Returns a BigInteger representing zero. + * + * @pure + */ + public static function zero() : BigInteger + { + /** @var BigInteger|null $zero */ + static $zero; + + if ($zero === null) { + $zero = new BigInteger('0'); + } + + return $zero; + } + + /** + * Returns a BigInteger representing one. + * + * @pure + */ + public static function one() : BigInteger + { + /** @var BigInteger|null $one */ + static $one; + + if ($one === null) { + $one = new BigInteger('1'); + } + + return $one; + } + + /** + * Returns a BigInteger representing ten. + * + * @pure + */ + public static function ten() : BigInteger + { + /** @var BigInteger|null $ten */ + static $ten; + + if ($ten === null) { + $ten = new BigInteger('10'); + } + + return $ten; + } + + /** + * @pure + */ + public static function gcdMultiple(BigInteger $a, BigInteger ...$n): BigInteger + { + $result = $a; + + foreach ($n as $next) { + $result = $result->gcd($next); + + if ($result->isEqualTo(1)) { + return $result; + } + } + + return $result; + } + + /** + * Returns the sum of this number and the given one. + * + * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigInteger. + * + * @throws MathException If the number is not valid, or is not convertible to a BigInteger. + * + * @pure + */ + public function plus(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '0') { + return $this; + } + + if ($this->value === '0') { + return $that; + } + + $value = CalculatorRegistry::get()->add($this->value, $that->value); + + return new BigInteger($value); + } + + /** + * Returns the difference of this number and the given one. + * + * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigInteger. + * + * @throws MathException If the number is not valid, or is not convertible to a BigInteger. + * + * @pure + */ + public function minus(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '0') { + return $this; + } + + $value = CalculatorRegistry::get()->sub($this->value, $that->value); + + return new BigInteger($value); + } + + /** + * Returns the product of this number and the given one. + * + * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigInteger. + * + * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigInteger. + * + * @pure + */ + public function multipliedBy(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '1') { + return $this; + } + + if ($this->value === '1') { + return $that; + } + + $value = CalculatorRegistry::get()->mul($this->value, $that->value); + + return new BigInteger($value); + } + + /** + * Returns the result of the division of this number by the given one. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. + * + * @throws MathException If the divisor is not a valid number, is not convertible to a BigInteger, is zero, + * or RoundingMode::UNNECESSARY is used and the remainder is not zero. + * + * @pure + */ + public function dividedBy(BigNumber|int|float|string $that, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '1') { + return $this; + } + + if ($that->value === '0') { + throw DivisionByZeroException::divisionByZero(); + } + + $result = CalculatorRegistry::get()->divRound($this->value, $that->value, $roundingMode); + + return new BigInteger($result); + } + + /** + * Limits (clamps) this number between the given minimum and maximum values. + * + * If the number is lower than $min, returns a copy of $min. + * If the number is greater than $max, returns a copy of $max. + * Otherwise, returns this number unchanged. + * + * @param BigNumber|int|float|string $min The minimum. Must be convertible to a BigInteger. + * @param BigNumber|int|float|string $max The maximum. Must be convertible to a BigInteger. + * + * @throws MathException If min/max are not convertible to a BigInteger. + */ + public function clamp(BigNumber|int|float|string $min, BigNumber|int|float|string $max) : BigInteger + { + if ($this->isLessThan($min)) { + return BigInteger::of($min); + } elseif ($this->isGreaterThan($max)) { + return BigInteger::of($max); + } + return $this; + } + + + /** + * Returns this number exponentiated to the given value. + * + * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. + * + * @pure + */ + public function power(int $exponent) : BigInteger + { + if ($exponent === 0) { + return BigInteger::one(); + } + + if ($exponent === 1) { + return $this; + } + + if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { + throw new \InvalidArgumentException(\sprintf( + 'The exponent %d is not in the range 0 to %d.', + $exponent, + Calculator::MAX_POWER + )); + } + + return new BigInteger(CalculatorRegistry::get()->pow($this->value, $exponent)); + } + + /** + * Returns the quotient of the division of this number by the given one. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. + * + * @throws DivisionByZeroException If the divisor is zero. + * + * @pure + */ + public function quotient(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '1') { + return $this; + } + + if ($that->value === '0') { + throw DivisionByZeroException::divisionByZero(); + } + + $quotient = CalculatorRegistry::get()->divQ($this->value, $that->value); + + return new BigInteger($quotient); + } + + /** + * Returns the remainder of the division of this number by the given one. + * + * The remainder, when non-zero, has the same sign as the dividend. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. + * + * @throws DivisionByZeroException If the divisor is zero. + * + * @pure + */ + public function remainder(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '1') { + return BigInteger::zero(); + } + + if ($that->value === '0') { + throw DivisionByZeroException::divisionByZero(); + } + + $remainder = CalculatorRegistry::get()->divR($this->value, $that->value); + + return new BigInteger($remainder); + } + + /** + * Returns the quotient and remainder of the division of this number by the given one. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. + * + * @return array{BigInteger, BigInteger} An array containing the quotient and the remainder. + * + * @throws DivisionByZeroException If the divisor is zero. + * + * @pure + */ + public function quotientAndRemainder(BigNumber|int|float|string $that) : array + { + $that = BigInteger::of($that); + + if ($that->value === '0') { + throw DivisionByZeroException::divisionByZero(); + } + + [$quotient, $remainder] = CalculatorRegistry::get()->divQR($this->value, $that->value); + + return [ + new BigInteger($quotient), + new BigInteger($remainder) + ]; + } + + /** + * Returns the modulo of this number and the given one. + * + * The modulo operation yields the same result as the remainder operation when both operands are of the same sign, + * and may differ when signs are different. + * + * The result of the modulo operation, when non-zero, has the same sign as the divisor. + * + * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. + * + * @throws DivisionByZeroException If the divisor is zero. + * + * @pure + */ + public function mod(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '0') { + throw DivisionByZeroException::modulusMustNotBeZero(); + } + + $value = CalculatorRegistry::get()->mod($this->value, $that->value); + + return new BigInteger($value); + } + + /** + * Returns the modular multiplicative inverse of this BigInteger modulo $m. + * + * @throws DivisionByZeroException If $m is zero. + * @throws NegativeNumberException If $m is negative. + * @throws MathException If this BigInteger has no multiplicative inverse mod m (that is, this BigInteger + * is not relatively prime to m). + * + * @pure + */ + public function modInverse(BigInteger $m) : BigInteger + { + if ($m->value === '0') { + throw DivisionByZeroException::modulusMustNotBeZero(); + } + + if ($m->isNegative()) { + throw new NegativeNumberException('Modulus must not be negative.'); + } + + if ($m->value === '1') { + return BigInteger::zero(); + } + + $value = CalculatorRegistry::get()->modInverse($this->value, $m->value); + + if ($value === null) { + throw new MathException('Unable to compute the modInverse for the given modulus.'); + } + + return new BigInteger($value); + } + + /** + * Returns this number raised into power with modulo. + * + * This operation only works on positive numbers. + * + * @param BigNumber|int|float|string $exp The exponent. Must be positive or zero. + * @param BigNumber|int|float|string $mod The modulus. Must be strictly positive. + * + * @throws NegativeNumberException If any of the operands is negative. + * @throws DivisionByZeroException If the modulus is zero. + * + * @pure + */ + public function modPow(BigNumber|int|float|string $exp, BigNumber|int|float|string $mod) : BigInteger + { + $exp = BigInteger::of($exp); + $mod = BigInteger::of($mod); + + if ($this->isNegative() || $exp->isNegative() || $mod->isNegative()) { + throw new NegativeNumberException('The operands cannot be negative.'); + } + + if ($mod->isZero()) { + throw DivisionByZeroException::modulusMustNotBeZero(); + } + + $result = CalculatorRegistry::get()->modPow($this->value, $exp->value, $mod->value); + + return new BigInteger($result); + } + + /** + * Returns the greatest common divisor of this number and the given one. + * + * The GCD is always positive, unless both operands are zero, in which case it is zero. + * + * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. + * + * @pure + */ + public function gcd(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + if ($that->value === '0' && $this->value[0] !== '-') { + return $this; + } + + if ($this->value === '0' && $that->value[0] !== '-') { + return $that; + } + + $value = CalculatorRegistry::get()->gcd($this->value, $that->value); + + return new BigInteger($value); + } + + /** + * Returns the integer square root number of this number, rounded down. + * + * The result is the largest x such that x² ≤ n. + * + * @throws NegativeNumberException If this number is negative. + * + * @pure + */ + public function sqrt() : BigInteger + { + if ($this->value[0] === '-') { + throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); + } + + $value = CalculatorRegistry::get()->sqrt($this->value); + + return new BigInteger($value); + } + + /** + * Returns the absolute value of this number. + * + * @pure + */ + public function abs() : BigInteger + { + return $this->isNegative() ? $this->negated() : $this; + } + + /** + * Returns the inverse of this number. + * + * @pure + */ + public function negated() : BigInteger + { + return new BigInteger(CalculatorRegistry::get()->neg($this->value)); + } + + /** + * Returns the integer bitwise-and combined with another integer. + * + * This method returns a negative BigInteger if and only if both operands are negative. + * + * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. + * + * @pure + */ + public function and(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + return new BigInteger(CalculatorRegistry::get()->and($this->value, $that->value)); + } + + /** + * Returns the integer bitwise-or combined with another integer. + * + * This method returns a negative BigInteger if and only if either of the operands is negative. + * + * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. + * + * @pure + */ + public function or(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + return new BigInteger(CalculatorRegistry::get()->or($this->value, $that->value)); + } + + /** + * Returns the integer bitwise-xor combined with another integer. + * + * This method returns a negative BigInteger if and only if exactly one of the operands is negative. + * + * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. + * + * @pure + */ + public function xor(BigNumber|int|float|string $that) : BigInteger + { + $that = BigInteger::of($that); + + return new BigInteger(CalculatorRegistry::get()->xor($this->value, $that->value)); + } + + /** + * Returns the bitwise-not of this BigInteger. + * + * @pure + */ + public function not() : BigInteger + { + return $this->negated()->minus(1); + } + + /** + * Returns the integer left shifted by a given number of bits. + * + * @pure + */ + public function shiftedLeft(int $distance) : BigInteger + { + if ($distance === 0) { + return $this; + } + + if ($distance < 0) { + return $this->shiftedRight(- $distance); + } + + return $this->multipliedBy(BigInteger::of(2)->power($distance)); + } + + /** + * Returns the integer right shifted by a given number of bits. + * + * @pure + */ + public function shiftedRight(int $distance) : BigInteger + { + if ($distance === 0) { + return $this; + } + + if ($distance < 0) { + return $this->shiftedLeft(- $distance); + } + + $operand = BigInteger::of(2)->power($distance); + + if ($this->isPositiveOrZero()) { + return $this->quotient($operand); + } + + return $this->dividedBy($operand, RoundingMode::UP); + } + + /** + * Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit. + * + * For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. + * Computes (ceil(log2(this < 0 ? -this : this+1))). + * + * @pure + */ + public function getBitLength() : int + { + if ($this->value === '0') { + return 0; + } + + if ($this->isNegative()) { + return $this->abs()->minus(1)->getBitLength(); + } + + return \strlen($this->toBase(2)); + } + + /** + * Returns the index of the rightmost (lowest-order) one bit in this BigInteger. + * + * Returns -1 if this BigInteger contains no one bits. + * + * @pure + */ + public function getLowestSetBit() : int + { + $n = $this; + $bitLength = $this->getBitLength(); + + for ($i = 0; $i <= $bitLength; $i++) { + if ($n->isOdd()) { + return $i; + } + + $n = $n->shiftedRight(1); + } + + return -1; + } + + /** + * Returns whether this number is even. + * + * @pure + */ + public function isEven() : bool + { + return \in_array($this->value[-1], ['0', '2', '4', '6', '8'], true); + } + + /** + * Returns whether this number is odd. + * + * @pure + */ + public function isOdd() : bool + { + return \in_array($this->value[-1], ['1', '3', '5', '7', '9'], true); + } + + /** + * Returns true if and only if the designated bit is set. + * + * Computes ((this & (1<shiftedRight($n)->isOdd(); + } + + #[Override] + public function compareTo(BigNumber|int|float|string $that) : int + { + $that = BigNumber::of($that); + + if ($that instanceof BigInteger) { + return CalculatorRegistry::get()->cmp($this->value, $that->value); + } + + return - $that->compareTo($this); + } + + #[Override] + public function getSign() : int + { + return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); + } + + #[Override] + public function toBigInteger() : BigInteger + { + return $this; + } + + #[Override] + public function toBigDecimal() : BigDecimal + { + return self::newBigDecimal($this->value); + } + + #[Override] + public function toBigRational() : BigRational + { + return self::newBigRational($this, BigInteger::one(), false); + } + + #[Override] + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + { + return $this->toBigDecimal()->toScale($scale, $roundingMode); + } + + #[Override] + public function toInt() : int + { + $intValue = (int) $this->value; + + if ($this->value !== (string) $intValue) { + throw IntegerOverflowException::toIntOverflow($this); + } + + return $intValue; + } + + #[Override] + public function toFloat() : float + { + return (float) $this->value; + } + + /** + * Returns a string representation of this number in the given base. + * + * The output will always be lowercase for bases greater than 10. + * + * @throws \InvalidArgumentException If the base is out of range. + * + * @pure + */ + public function toBase(int $base) : string + { + if ($base === 10) { + return $this->value; + } + + if ($base < 2 || $base > 36) { + throw new \InvalidArgumentException(\sprintf('Base %d is out of range [2, 36]', $base)); + } + + return CalculatorRegistry::get()->toBase($this->value, $base); + } + + /** + * Returns a string representation of this number in an arbitrary base with a custom alphabet. + * + * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers; + * a NegativeNumberException will be thrown when attempting to call this method on a negative number. + * + * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. + * + * @throws NegativeNumberException If this number is negative. + * @throws \InvalidArgumentException If the given alphabet does not contain at least 2 chars. + * + * @pure + */ + public function toArbitraryBase(string $alphabet) : string + { + $base = \strlen($alphabet); + + if ($base < 2) { + throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); + } + + if ($this->value[0] === '-') { + throw new NegativeNumberException(__FUNCTION__ . '() does not support negative numbers.'); + } + + return CalculatorRegistry::get()->toArbitraryBase($this->value, $alphabet, $base); + } + + /** + * Returns a string of bytes containing the binary representation of this BigInteger. + * + * The string is in big-endian byte-order: the most significant byte is in the zeroth element. + * + * If `$signed` is true, the output will be in two's-complement representation, and a sign bit will be prepended to + * the output. If `$signed` is false, no sign bit will be prepended, and this method will throw an exception if the + * number is negative. + * + * The string will contain the minimum number of bytes required to represent this BigInteger, including a sign bit + * if `$signed` is true. + * + * This representation is compatible with the `fromBytes()` factory method, as long as the `$signed` flags match. + * + * @param bool $signed Whether to output a signed number in two's-complement representation with a leading sign bit. + * + * @throws NegativeNumberException If $signed is false, and the number is negative. + * + * @pure + */ + public function toBytes(bool $signed = true) : string + { + if (! $signed && $this->isNegative()) { + throw new NegativeNumberException('Cannot convert a negative number to a byte string when $signed is false.'); + } + + $hex = $this->abs()->toBase(16); + + if (\strlen($hex) % 2 !== 0) { + $hex = '0' . $hex; + } + + $baseHexLength = \strlen($hex); + + if ($signed) { + if ($this->isNegative()) { + $bin = \hex2bin($hex); + assert($bin !== false); + + $hex = \bin2hex(~$bin); + $hex = self::fromBase($hex, 16)->plus(1)->toBase(16); + + $hexLength = \strlen($hex); + + if ($hexLength < $baseHexLength) { + $hex = \str_repeat('0', $baseHexLength - $hexLength) . $hex; + } + + if ($hex[0] < '8') { + $hex = 'FF' . $hex; + } + } else { + if ($hex[0] >= '8') { + $hex = '00' . $hex; + } + } + } + + $result = \hex2bin($hex); + assert($result !== false); + + return $result; + } + + /** + * @return numeric-string + */ + #[Override] + public function __toString() : string + { + /** @var numeric-string */ + return $this->value; + } + + /** + * This method is required for serializing the object and SHOULD NOT be accessed directly. + * + * @internal + * + * @return array{value: string} + */ + public function __serialize(): array + { + return ['value' => $this->value]; + } + + /** + * This method is only here to allow unserializing the object and cannot be accessed directly. + * + * @internal + * + * @param array{value: string} $data + * + * @throws \LogicException + */ + public function __unserialize(array $data): void + { + /** @phpstan-ignore isset.initializedProperty */ + if (isset($this->value)) { + throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); + } + + /** @phpstan-ignore deadCode.unreachable */ + $this->value = $data['value']; + } +} diff --git a/vendor/brick/math/src/BigNumber.php b/vendor/brick/math/src/BigNumber.php new file mode 100644 index 0000000..2fbdf69 --- /dev/null +++ b/vendor/brick/math/src/BigNumber.php @@ -0,0 +1,556 @@ +[\-\+])?' . + '(?[0-9]+)?' . + '(?\.)?' . + '(?[0-9]+)?' . + '(?:[eE](?[\-\+]?[0-9]+))?' . + '$/'; + + /** + * The regular expression used to parse rational numbers. + */ + private const PARSE_REGEXP_RATIONAL = + '/^' . + '(?[\-\+])?' . + '(?[0-9]+)' . + '\/?' . + '(?[0-9]+)' . + '$/'; + + /** + * Creates a BigNumber of the given value. + * + * When of() is called on BigNumber, the concrete return type is dependent on the given value, with the following + * rules: + * + * - BigNumber instances are returned as is + * - integer numbers are returned as BigInteger + * - floating point numbers are converted to a string then parsed as such + * - strings containing a `/` character are returned as BigRational + * - strings containing a `.` character or using an exponential notation are returned as BigDecimal + * - strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger + * + * When of() is called on BigInteger, BigDecimal, or BigRational, the resulting number is converted to an instance + * of the subclass when possible; otherwise a RoundingNecessaryException exception is thrown. + * + * @throws NumberFormatException If the format of the number is not valid. + * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. + * @throws RoundingNecessaryException If the value cannot be converted to an instance of the subclass without rounding. + * + * @pure + */ + final public static function of(BigNumber|int|float|string $value) : static + { + $value = self::_of($value); + + if (static::class === BigNumber::class) { + assert($value instanceof static); + + return $value; + } + + return static::from($value); + } + + /** + * @throws NumberFormatException If the format of the number is not valid. + * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. + * + * @pure + */ + private static function _of(BigNumber|int|float|string $value) : BigNumber + { + if ($value instanceof BigNumber) { + return $value; + } + + if (\is_int($value)) { + return new BigInteger((string) $value); + } + + if (is_float($value)) { + $value = (string) $value; + } + + if (str_contains($value, '/')) { + // Rational number + if (\preg_match(self::PARSE_REGEXP_RATIONAL, $value, $matches, PREG_UNMATCHED_AS_NULL) !== 1) { + throw NumberFormatException::invalidFormat($value); + } + + $sign = $matches['sign']; + $numerator = $matches['numerator']; + $denominator = $matches['denominator']; + + $numerator = self::cleanUp($sign, $numerator); + $denominator = self::cleanUp(null, $denominator); + + if ($denominator === '0') { + throw DivisionByZeroException::denominatorMustNotBeZero(); + } + + return new BigRational( + new BigInteger($numerator), + new BigInteger($denominator), + false + ); + } else { + // Integer or decimal number + if (\preg_match(self::PARSE_REGEXP_NUMERICAL, $value, $matches, PREG_UNMATCHED_AS_NULL) !== 1) { + throw NumberFormatException::invalidFormat($value); + } + + $sign = $matches['sign']; + $point = $matches['point']; + $integral = $matches['integral']; + $fractional = $matches['fractional']; + $exponent = $matches['exponent']; + + if ($integral === null && $fractional === null) { + throw NumberFormatException::invalidFormat($value); + } + + if ($integral === null) { + $integral = '0'; + } + + if ($point !== null || $exponent !== null) { + $fractional ??= ''; + $exponent = ($exponent !== null) ? (int)$exponent : 0; + + if ($exponent === PHP_INT_MIN || $exponent === PHP_INT_MAX) { + throw new NumberFormatException('Exponent too large.'); + } + + $unscaledValue = self::cleanUp($sign, $integral . $fractional); + + $scale = \strlen($fractional) - $exponent; + + if ($scale < 0) { + if ($unscaledValue !== '0') { + $unscaledValue .= \str_repeat('0', -$scale); + } + $scale = 0; + } + + return new BigDecimal($unscaledValue, $scale); + } + + $integral = self::cleanUp($sign, $integral); + + return new BigInteger($integral); + } + } + + /** + * Overridden by subclasses to convert a BigNumber to an instance of the subclass. + * + * @throws RoundingNecessaryException If the value cannot be converted. + * + * @pure + */ + abstract protected static function from(BigNumber $number): static; + + /** + * Proxy method to access BigInteger's protected constructor from sibling classes. + * + * @pure + * @internal + */ + final protected function newBigInteger(string $value) : BigInteger + { + return new BigInteger($value); + } + + /** + * Proxy method to access BigDecimal's protected constructor from sibling classes. + * + * @pure + * @internal + */ + final protected function newBigDecimal(string $value, int $scale = 0) : BigDecimal + { + return new BigDecimal($value, $scale); + } + + /** + * Proxy method to access BigRational's protected constructor from sibling classes. + * + * @pure + * @internal + */ + final protected function newBigRational(BigInteger $numerator, BigInteger $denominator, bool $checkDenominator) : BigRational + { + return new BigRational($numerator, $denominator, $checkDenominator); + } + + /** + * Returns the minimum of the given values. + * + * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible + * to an instance of the class this method is called on. + * + * @throws \InvalidArgumentException If no values are given. + * @throws MathException If an argument is not valid. + * + * @pure + */ + final public static function min(BigNumber|int|float|string ...$values) : static + { + $min = null; + + foreach ($values as $value) { + $value = static::of($value); + + if ($min === null || $value->isLessThan($min)) { + $min = $value; + } + } + + if ($min === null) { + throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); + } + + return $min; + } + + /** + * Returns the maximum of the given values. + * + * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible + * to an instance of the class this method is called on. + * + * @throws \InvalidArgumentException If no values are given. + * @throws MathException If an argument is not valid. + * + * @pure + */ + final public static function max(BigNumber|int|float|string ...$values) : static + { + $max = null; + + foreach ($values as $value) { + $value = static::of($value); + + if ($max === null || $value->isGreaterThan($max)) { + $max = $value; + } + } + + if ($max === null) { + throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); + } + + return $max; + } + + /** + * Returns the sum of the given values. + * + * When called on BigNumber, sum() accepts any supported type and returns a result whose type is the widest among + * the given values (BigInteger < BigDecimal < BigRational). + * + * When called on BigInteger, BigDecimal, or BigRational, sum() requires that all values can be converted to that + * specific subclass, and returns a result of the same type. + * + * @param BigNumber|int|float|string ...$values The values to add. All values must be convertible to the class on + * which this method is called. + * + * @throws \InvalidArgumentException If no values are given. + * @throws MathException If an argument is not valid. + * + * @pure + */ + final public static function sum(BigNumber|int|float|string ...$values) : static + { + $first = array_shift($values); + + if ($first === null) { + throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); + } + + $sum = static::of($first); + + foreach ($values as $value) { + $sum = self::add($sum, static::of($value)); + } + + assert($sum instanceof static); + + return $sum; + } + + /** + * Adds two BigNumber instances in the correct order to avoid a RoundingNecessaryException. + * + * @pure + */ + private static function add(BigNumber $a, BigNumber $b) : BigNumber + { + if ($a instanceof BigRational) { + return $a->plus($b); + } + + if ($b instanceof BigRational) { + return $b->plus($a); + } + + if ($a instanceof BigDecimal) { + return $a->plus($b); + } + + if ($b instanceof BigDecimal) { + return $b->plus($a); + } + + return $a->plus($b); + } + + /** + * Removes optional leading zeros and applies sign. + * + * @param string|null $sign The sign, '+' or '-', optional. Null is allowed for convenience and treated as '+'. + * @param string $number The number, validated as a string of digits. + * + * @pure + */ + private static function cleanUp(string|null $sign, string $number) : string + { + $number = \ltrim($number, '0'); + + if ($number === '') { + return '0'; + } + + return $sign === '-' ? '-' . $number : $number; + } + + /** + * Checks if this number is equal to the given one. + * + * @pure + */ + final public function isEqualTo(BigNumber|int|float|string $that) : bool + { + return $this->compareTo($that) === 0; + } + + /** + * Checks if this number is strictly lower than the given one. + * + * @pure + */ + final public function isLessThan(BigNumber|int|float|string $that) : bool + { + return $this->compareTo($that) < 0; + } + + /** + * Checks if this number is lower than or equal to the given one. + * + * @pure + */ + final public function isLessThanOrEqualTo(BigNumber|int|float|string $that) : bool + { + return $this->compareTo($that) <= 0; + } + + /** + * Checks if this number is strictly greater than the given one. + * + * @pure + */ + final public function isGreaterThan(BigNumber|int|float|string $that) : bool + { + return $this->compareTo($that) > 0; + } + + /** + * Checks if this number is greater than or equal to the given one. + * + * @pure + */ + final public function isGreaterThanOrEqualTo(BigNumber|int|float|string $that) : bool + { + return $this->compareTo($that) >= 0; + } + + /** + * Checks if this number equals zero. + * + * @pure + */ + final public function isZero() : bool + { + return $this->getSign() === 0; + } + + /** + * Checks if this number is strictly negative. + * + * @pure + */ + final public function isNegative() : bool + { + return $this->getSign() < 0; + } + + /** + * Checks if this number is negative or zero. + * + * @pure + */ + final public function isNegativeOrZero() : bool + { + return $this->getSign() <= 0; + } + + /** + * Checks if this number is strictly positive. + * + * @pure + */ + final public function isPositive() : bool + { + return $this->getSign() > 0; + } + + /** + * Checks if this number is positive or zero. + * + * @pure + */ + final public function isPositiveOrZero() : bool + { + return $this->getSign() >= 0; + } + + /** + * Returns the sign of this number. + * + * Returns -1 if the number is negative, 0 if zero, 1 if positive. + * + * @return -1|0|1 + * + * @pure + */ + abstract public function getSign() : int; + + /** + * Compares this number to the given one. + * + * Returns -1 if `$this` is lower than, 0 if equal to, 1 if greater than `$that`. + * + * @return -1|0|1 + * + * @throws MathException If the number is not valid. + * + * @pure + */ + abstract public function compareTo(BigNumber|int|float|string $that) : int; + + /** + * Converts this number to a BigInteger. + * + * @throws RoundingNecessaryException If this number cannot be converted to a BigInteger without rounding. + * + * @pure + */ + abstract public function toBigInteger() : BigInteger; + + /** + * Converts this number to a BigDecimal. + * + * @throws RoundingNecessaryException If this number cannot be converted to a BigDecimal without rounding. + * + * @pure + */ + abstract public function toBigDecimal() : BigDecimal; + + /** + * Converts this number to a BigRational. + * + * @pure + */ + abstract public function toBigRational() : BigRational; + + /** + * Converts this number to a BigDecimal with the given scale, using rounding if necessary. + * + * @param int $scale The scale of the resulting `BigDecimal`. + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. + * + * @throws RoundingNecessaryException If this number cannot be converted to the given scale without rounding. + * This only applies when RoundingMode::UNNECESSARY is used. + * + * @pure + */ + abstract public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal; + + /** + * Returns the exact value of this number as a native integer. + * + * If this number cannot be converted to a native integer without losing precision, an exception is thrown. + * Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit. + * + * @throws MathException If this number cannot be exactly converted to a native integer. + * + * @pure + */ + abstract public function toInt() : int; + + /** + * Returns an approximation of this number as a floating-point value. + * + * Note that this method can discard information as the precision of a floating-point value + * is inherently limited. + * + * If the number is greater than the largest representable floating point number, positive infinity is returned. + * If the number is less than the smallest representable floating point number, negative infinity is returned. + * + * @pure + */ + abstract public function toFloat() : float; + + /** + * Returns a string representation of this number. + * + * The output of this method can be parsed by the `of()` factory method; + * this will yield an object equal to this one, without any information loss. + * + * @pure + */ + abstract public function __toString() : string; + + #[Override] + final public function jsonSerialize() : string + { + return $this->__toString(); + } +} diff --git a/vendor/brick/math/src/BigRational.php b/vendor/brick/math/src/BigRational.php new file mode 100644 index 0000000..56045e5 --- /dev/null +++ b/vendor/brick/math/src/BigRational.php @@ -0,0 +1,441 @@ +isZero()) { + throw DivisionByZeroException::denominatorMustNotBeZero(); + } + + if ($denominator->isNegative()) { + $numerator = $numerator->negated(); + $denominator = $denominator->negated(); + } + } + + $this->numerator = $numerator; + $this->denominator = $denominator; + } + + #[Override] + protected static function from(BigNumber $number): static + { + return $number->toBigRational(); + } + + /** + * Creates a BigRational out of a numerator and a denominator. + * + * If the denominator is negative, the signs of both the numerator and the denominator + * will be inverted to ensure that the denominator is always positive. + * + * @param BigNumber|int|float|string $numerator The numerator. Must be convertible to a BigInteger. + * @param BigNumber|int|float|string $denominator The denominator. Must be convertible to a BigInteger. + * + * @throws NumberFormatException If an argument does not represent a valid number. + * @throws RoundingNecessaryException If an argument represents a non-integer number. + * @throws DivisionByZeroException If the denominator is zero. + * + * @pure + */ + public static function nd( + BigNumber|int|float|string $numerator, + BigNumber|int|float|string $denominator, + ) : BigRational { + $numerator = BigInteger::of($numerator); + $denominator = BigInteger::of($denominator); + + return new BigRational($numerator, $denominator, true); + } + + /** + * Returns a BigRational representing zero. + * + * @pure + */ + public static function zero() : BigRational + { + /** @var BigRational|null $zero */ + static $zero; + + if ($zero === null) { + $zero = new BigRational(BigInteger::zero(), BigInteger::one(), false); + } + + return $zero; + } + + /** + * Returns a BigRational representing one. + * + * @pure + */ + public static function one() : BigRational + { + /** @var BigRational|null $one */ + static $one; + + if ($one === null) { + $one = new BigRational(BigInteger::one(), BigInteger::one(), false); + } + + return $one; + } + + /** + * Returns a BigRational representing ten. + * + * @pure + */ + public static function ten() : BigRational + { + /** @var BigRational|null $ten */ + static $ten; + + if ($ten === null) { + $ten = new BigRational(BigInteger::ten(), BigInteger::one(), false); + } + + return $ten; + } + + /** + * @pure + */ + public function getNumerator() : BigInteger + { + return $this->numerator; + } + + /** + * @pure + */ + public function getDenominator() : BigInteger + { + return $this->denominator; + } + + /** + * Returns the quotient of the division of the numerator by the denominator. + * + * @pure + */ + public function quotient() : BigInteger + { + return $this->numerator->quotient($this->denominator); + } + + /** + * Returns the remainder of the division of the numerator by the denominator. + * + * @pure + */ + public function remainder() : BigInteger + { + return $this->numerator->remainder($this->denominator); + } + + /** + * Returns the quotient and remainder of the division of the numerator by the denominator. + * + * @return array{BigInteger, BigInteger} + * + * @pure + */ + public function quotientAndRemainder() : array + { + return $this->numerator->quotientAndRemainder($this->denominator); + } + + /** + * Returns the sum of this number and the given one. + * + * @param BigNumber|int|float|string $that The number to add. + * + * @throws MathException If the number is not valid. + * + * @pure + */ + public function plus(BigNumber|int|float|string $that) : BigRational + { + $that = BigRational::of($that); + + $numerator = $this->numerator->multipliedBy($that->denominator); + $numerator = $numerator->plus($that->numerator->multipliedBy($this->denominator)); + $denominator = $this->denominator->multipliedBy($that->denominator); + + return new BigRational($numerator, $denominator, false); + } + + /** + * Returns the difference of this number and the given one. + * + * @param BigNumber|int|float|string $that The number to subtract. + * + * @throws MathException If the number is not valid. + * + * @pure + */ + public function minus(BigNumber|int|float|string $that) : BigRational + { + $that = BigRational::of($that); + + $numerator = $this->numerator->multipliedBy($that->denominator); + $numerator = $numerator->minus($that->numerator->multipliedBy($this->denominator)); + $denominator = $this->denominator->multipliedBy($that->denominator); + + return new BigRational($numerator, $denominator, false); + } + + /** + * Returns the product of this number and the given one. + * + * @param BigNumber|int|float|string $that The multiplier. + * + * @throws MathException If the multiplier is not a valid number. + * + * @pure + */ + public function multipliedBy(BigNumber|int|float|string $that) : BigRational + { + $that = BigRational::of($that); + + $numerator = $this->numerator->multipliedBy($that->numerator); + $denominator = $this->denominator->multipliedBy($that->denominator); + + return new BigRational($numerator, $denominator, false); + } + + /** + * Returns the result of the division of this number by the given one. + * + * @param BigNumber|int|float|string $that The divisor. + * + * @throws MathException If the divisor is not a valid number, or is zero. + * + * @pure + */ + public function dividedBy(BigNumber|int|float|string $that) : BigRational + { + $that = BigRational::of($that); + + $numerator = $this->numerator->multipliedBy($that->denominator); + $denominator = $this->denominator->multipliedBy($that->numerator); + + return new BigRational($numerator, $denominator, true); + } + + /** + * Returns this number exponentiated to the given value. + * + * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. + * + * @pure + */ + public function power(int $exponent) : BigRational + { + if ($exponent === 0) { + $one = BigInteger::one(); + + return new BigRational($one, $one, false); + } + + if ($exponent === 1) { + return $this; + } + + return new BigRational( + $this->numerator->power($exponent), + $this->denominator->power($exponent), + false + ); + } + + /** + * Returns the reciprocal of this BigRational. + * + * The reciprocal has the numerator and denominator swapped. + * + * @throws DivisionByZeroException If the numerator is zero. + * + * @pure + */ + public function reciprocal() : BigRational + { + return new BigRational($this->denominator, $this->numerator, true); + } + + /** + * Returns the absolute value of this BigRational. + * + * @pure + */ + public function abs() : BigRational + { + return new BigRational($this->numerator->abs(), $this->denominator, false); + } + + /** + * Returns the negated value of this BigRational. + * + * @pure + */ + public function negated() : BigRational + { + return new BigRational($this->numerator->negated(), $this->denominator, false); + } + + /** + * Returns the simplified value of this BigRational. + * + * @pure + */ + public function simplified() : BigRational + { + $gcd = $this->numerator->gcd($this->denominator); + + $numerator = $this->numerator->quotient($gcd); + $denominator = $this->denominator->quotient($gcd); + + return new BigRational($numerator, $denominator, false); + } + + #[Override] + public function compareTo(BigNumber|int|float|string $that) : int + { + return $this->minus($that)->getSign(); + } + + #[Override] + public function getSign() : int + { + return $this->numerator->getSign(); + } + + #[Override] + public function toBigInteger() : BigInteger + { + $simplified = $this->simplified(); + + if (! $simplified->denominator->isEqualTo(1)) { + throw new RoundingNecessaryException('This rational number cannot be represented as an integer value without rounding.'); + } + + return $simplified->numerator; + } + + #[Override] + public function toBigDecimal() : BigDecimal + { + return $this->numerator->toBigDecimal()->exactlyDividedBy($this->denominator); + } + + #[Override] + public function toBigRational() : BigRational + { + return $this; + } + + #[Override] + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + { + return $this->numerator->toBigDecimal()->dividedBy($this->denominator, $scale, $roundingMode); + } + + #[Override] + public function toInt() : int + { + return $this->toBigInteger()->toInt(); + } + + #[Override] + public function toFloat() : float + { + $simplified = $this->simplified(); + return $simplified->numerator->toFloat() / $simplified->denominator->toFloat(); + } + + #[Override] + public function __toString() : string + { + $numerator = (string) $this->numerator; + $denominator = (string) $this->denominator; + + if ($denominator === '1') { + return $numerator; + } + + return $numerator . '/' . $denominator; + } + + /** + * This method is required for serializing the object and SHOULD NOT be accessed directly. + * + * @internal + * + * @return array{numerator: BigInteger, denominator: BigInteger} + */ + public function __serialize(): array + { + return ['numerator' => $this->numerator, 'denominator' => $this->denominator]; + } + + /** + * This method is only here to allow unserializing the object and cannot be accessed directly. + * + * @internal + * + * @param array{numerator: BigInteger, denominator: BigInteger} $data + * + * @throws \LogicException + */ + public function __unserialize(array $data): void + { + /** @phpstan-ignore isset.initializedProperty */ + if (isset($this->numerator)) { + throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); + } + + /** @phpstan-ignore deadCode.unreachable */ + $this->numerator = $data['numerator']; + $this->denominator = $data['denominator']; + } +} diff --git a/vendor/brick/math/src/Exception/DivisionByZeroException.php b/vendor/brick/math/src/Exception/DivisionByZeroException.php new file mode 100644 index 0000000..2daaf5e --- /dev/null +++ b/vendor/brick/math/src/Exception/DivisionByZeroException.php @@ -0,0 +1,35 @@ + 126) { + $char = \strtoupper(\dechex($ord)); + + if ($ord < 10) { + $char = '0' . $char; + } + } else { + $char = '"' . $char . '"'; + } + + return new self(\sprintf('Char %s is not a valid character in the given alphabet.', $char)); + } +} diff --git a/vendor/brick/math/src/Exception/RoundingNecessaryException.php b/vendor/brick/math/src/Exception/RoundingNecessaryException.php new file mode 100644 index 0000000..034a040 --- /dev/null +++ b/vendor/brick/math/src/Exception/RoundingNecessaryException.php @@ -0,0 +1,19 @@ +init($a, $b); + + if ($aNeg && ! $bNeg) { + return -1; + } + + if ($bNeg && ! $aNeg) { + return 1; + } + + $aLen = \strlen($aDig); + $bLen = \strlen($bDig); + + if ($aLen < $bLen) { + $result = -1; + } elseif ($aLen > $bLen) { + $result = 1; + } else { + $result = $aDig <=> $bDig; + } + + return $aNeg ? -$result : $result; + } + + /** + * Adds two numbers. + * + * @pure + */ + abstract public function add(string $a, string $b) : string; + + /** + * Subtracts two numbers. + * + * @pure + */ + abstract public function sub(string $a, string $b) : string; + + /** + * Multiplies two numbers. + * + * @pure + */ + abstract public function mul(string $a, string $b) : string; + + /** + * Returns the quotient of the division of two numbers. + * + * @param string $a The dividend. + * @param string $b The divisor, must not be zero. + * + * @return string The quotient. + * + * @pure + */ + abstract public function divQ(string $a, string $b) : string; + + /** + * Returns the remainder of the division of two numbers. + * + * @param string $a The dividend. + * @param string $b The divisor, must not be zero. + * + * @return string The remainder. + * + * @pure + */ + abstract public function divR(string $a, string $b) : string; + + /** + * Returns the quotient and remainder of the division of two numbers. + * + * @param string $a The dividend. + * @param string $b The divisor, must not be zero. + * + * @return array{string, string} An array containing the quotient and remainder. + * + * @pure + */ + abstract public function divQR(string $a, string $b) : array; + + /** + * Exponentiates a number. + * + * @param string $a The base number. + * @param int $e The exponent, validated as an integer between 0 and MAX_POWER. + * + * @return string The power. + * + * @pure + */ + abstract public function pow(string $a, int $e) : string; + + /** + * @param string $b The modulus; must not be zero. + * + * @pure + */ + public function mod(string $a, string $b) : string + { + return $this->divR($this->add($this->divR($a, $b), $b), $b); + } + + /** + * Returns the modular multiplicative inverse of $x modulo $m. + * + * If $x has no multiplicative inverse mod m, this method must return null. + * + * This method can be overridden by the concrete implementation if the underlying library has built-in support. + * + * @param string $m The modulus; must not be negative or zero. + * + * @pure + */ + public function modInverse(string $x, string $m) : ?string + { + if ($m === '1') { + return '0'; + } + + $modVal = $x; + + if ($x[0] === '-' || ($this->cmp($this->abs($x), $m) >= 0)) { + $modVal = $this->mod($x, $m); + } + + [$g, $x] = $this->gcdExtended($modVal, $m); + + if ($g !== '1') { + return null; + } + + return $this->mod($this->add($this->mod($x, $m), $m), $m); + } + + /** + * Raises a number into power with modulo. + * + * @param string $base The base number; must be positive or zero. + * @param string $exp The exponent; must be positive or zero. + * @param string $mod The modulus; must be strictly positive. + * + * @pure + */ + abstract public function modPow(string $base, string $exp, string $mod) : string; + + /** + * Returns the greatest common divisor of the two numbers. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for GCD calculations. + * + * @return string The GCD, always positive, or zero if both arguments are zero. + * + * @pure + */ + public function gcd(string $a, string $b) : string + { + if ($a === '0') { + return $this->abs($b); + } + + if ($b === '0') { + return $this->abs($a); + } + + return $this->gcd($b, $this->divR($a, $b)); + } + + /** + * @return array{string, string, string} GCD, X, Y + * + * @pure + */ + private function gcdExtended(string $a, string $b) : array + { + if ($a === '0') { + return [$b, '0', '1']; + } + + [$gcd, $x1, $y1] = $this->gcdExtended($this->mod($b, $a), $a); + + $x = $this->sub($y1, $this->mul($this->divQ($b, $a), $x1)); + $y = $x1; + + return [$gcd, $x, $y]; + } + + /** + * Returns the square root of the given number, rounded down. + * + * The result is the largest x such that x² ≤ n. + * The input MUST NOT be negative. + * + * @pure + */ + abstract public function sqrt(string $n) : string; + + /** + * Converts a number from an arbitrary base. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for base conversion. + * + * @param string $number The number, positive or zero, non-empty, case-insensitively validated for the given base. + * @param int $base The base of the number, validated from 2 to 36. + * + * @return string The converted number, following the Calculator conventions. + * + * @pure + */ + public function fromBase(string $number, int $base) : string + { + return $this->fromArbitraryBase(\strtolower($number), self::ALPHABET, $base); + } + + /** + * Converts a number to an arbitrary base. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for base conversion. + * + * @param string $number The number to convert, following the Calculator conventions. + * @param int $base The base to convert to, validated from 2 to 36. + * + * @return string The converted number, lowercase. + * + * @pure + */ + public function toBase(string $number, int $base) : string + { + $negative = ($number[0] === '-'); + + if ($negative) { + $number = \substr($number, 1); + } + + $number = $this->toArbitraryBase($number, self::ALPHABET, $base); + + if ($negative) { + return '-' . $number; + } + + return $number; + } + + /** + * Converts a non-negative number in an arbitrary base using a custom alphabet, to base 10. + * + * @param string $number The number to convert, validated as a non-empty string, + * containing only chars in the given alphabet/base. + * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. + * @param int $base The base of the number, validated from 2 to alphabet length. + * + * @return string The number in base 10, following the Calculator conventions. + * + * @pure + */ + final public function fromArbitraryBase(string $number, string $alphabet, int $base) : string + { + // remove leading "zeros" + $number = \ltrim($number, $alphabet[0]); + + if ($number === '') { + return '0'; + } + + // optimize for "one" + if ($number === $alphabet[1]) { + return '1'; + } + + $result = '0'; + $power = '1'; + + $base = (string) $base; + + for ($i = \strlen($number) - 1; $i >= 0; $i--) { + $index = \strpos($alphabet, $number[$i]); + + if ($index !== 0) { + $result = $this->add($result, ($index === 1) + ? $power + : $this->mul($power, (string) $index) + ); + } + + if ($i !== 0) { + $power = $this->mul($power, $base); + } + } + + return $result; + } + + /** + * Converts a non-negative number to an arbitrary base using a custom alphabet. + * + * @param string $number The number to convert, positive or zero, following the Calculator conventions. + * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. + * @param int $base The base to convert to, validated from 2 to alphabet length. + * + * @return string The converted number in the given alphabet. + * + * @pure + */ + final public function toArbitraryBase(string $number, string $alphabet, int $base) : string + { + if ($number === '0') { + return $alphabet[0]; + } + + $base = (string) $base; + $result = ''; + + while ($number !== '0') { + [$number, $remainder] = $this->divQR($number, $base); + $remainder = (int) $remainder; + + $result .= $alphabet[$remainder]; + } + + return \strrev($result); + } + + /** + * Performs a rounded division. + * + * Rounding is performed when the remainder of the division is not zero. + * + * @param string $a The dividend. + * @param string $b The divisor, must not be zero. + * @param RoundingMode $roundingMode The rounding mode. + * + * @throws RoundingNecessaryException If RoundingMode::UNNECESSARY is provided but rounding is necessary. + * + * @pure + */ + final public function divRound(string $a, string $b, RoundingMode $roundingMode) : string + { + [$quotient, $remainder] = $this->divQR($a, $b); + + $hasDiscardedFraction = ($remainder !== '0'); + $isPositiveOrZero = ($a[0] === '-') === ($b[0] === '-'); + + $discardedFractionSign = function() use ($remainder, $b) : int { + $r = $this->abs($this->mul($remainder, '2')); + $b = $this->abs($b); + + return $this->cmp($r, $b); + }; + + $increment = false; + + switch ($roundingMode) { + case RoundingMode::UNNECESSARY: + if ($hasDiscardedFraction) { + throw RoundingNecessaryException::roundingNecessary(); + } + break; + + case RoundingMode::UP: + $increment = $hasDiscardedFraction; + break; + + case RoundingMode::DOWN: + break; + + case RoundingMode::CEILING: + $increment = $hasDiscardedFraction && $isPositiveOrZero; + break; + + case RoundingMode::FLOOR: + $increment = $hasDiscardedFraction && ! $isPositiveOrZero; + break; + + case RoundingMode::HALF_UP: + $increment = $discardedFractionSign() >= 0; + break; + + case RoundingMode::HALF_DOWN: + $increment = $discardedFractionSign() > 0; + break; + + case RoundingMode::HALF_CEILING: + $increment = $isPositiveOrZero ? $discardedFractionSign() >= 0 : $discardedFractionSign() > 0; + break; + + case RoundingMode::HALF_FLOOR: + $increment = $isPositiveOrZero ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; + break; + + case RoundingMode::HALF_EVEN: + $lastDigit = (int) $quotient[-1]; + $lastDigitIsEven = ($lastDigit % 2 === 0); + $increment = $lastDigitIsEven ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; + break; + } + + if ($increment) { + return $this->add($quotient, $isPositiveOrZero ? '1' : '-1'); + } + + return $quotient; + } + + /** + * Calculates bitwise AND of two numbers. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for bitwise operations. + * + * @pure + */ + public function and(string $a, string $b) : string + { + return $this->bitwise('and', $a, $b); + } + + /** + * Calculates bitwise OR of two numbers. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for bitwise operations. + * + * @pure + */ + public function or(string $a, string $b) : string + { + return $this->bitwise('or', $a, $b); + } + + /** + * Calculates bitwise XOR of two numbers. + * + * This method can be overridden by the concrete implementation if the underlying library + * has built-in support for bitwise operations. + * + * @pure + */ + public function xor(string $a, string $b) : string + { + return $this->bitwise('xor', $a, $b); + } + + /** + * Performs a bitwise operation on a decimal number. + * + * @param 'and'|'or'|'xor' $operator The operator to use. + * @param string $a The left operand. + * @param string $b The right operand. + * + * @pure + */ + private function bitwise(string $operator, string $a, string $b) : string + { + [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); + + $aBin = $this->toBinary($aDig); + $bBin = $this->toBinary($bDig); + + $aLen = \strlen($aBin); + $bLen = \strlen($bBin); + + if ($aLen > $bLen) { + $bBin = \str_repeat("\x00", $aLen - $bLen) . $bBin; + } elseif ($bLen > $aLen) { + $aBin = \str_repeat("\x00", $bLen - $aLen) . $aBin; + } + + if ($aNeg) { + $aBin = $this->twosComplement($aBin); + } + if ($bNeg) { + $bBin = $this->twosComplement($bBin); + } + + $value = match ($operator) { + 'and' => $aBin & $bBin, + 'or' => $aBin | $bBin, + 'xor' => $aBin ^ $bBin, + }; + + $negative = match ($operator) { + 'and' => $aNeg and $bNeg, + 'or' => $aNeg or $bNeg, + 'xor' => $aNeg xor $bNeg, + }; + + if ($negative) { + $value = $this->twosComplement($value); + } + + $result = $this->toDecimal($value); + + return $negative ? $this->neg($result) : $result; + } + + /** + * @param string $number A positive, binary number. + * + * @pure + */ + private function twosComplement(string $number) : string + { + $xor = \str_repeat("\xff", \strlen($number)); + + $number ^= $xor; + + for ($i = \strlen($number) - 1; $i >= 0; $i--) { + $byte = \ord($number[$i]); + + if (++$byte !== 256) { + $number[$i] = \chr($byte); + break; + } + + $number[$i] = "\x00"; + + if ($i === 0) { + $number = "\x01" . $number; + } + } + + return $number; + } + + /** + * Converts a decimal number to a binary string. + * + * @param string $number The number to convert, positive or zero, only digits. + * + * @pure + */ + private function toBinary(string $number) : string + { + $result = ''; + + while ($number !== '0') { + [$number, $remainder] = $this->divQR($number, '256'); + $result .= \chr((int) $remainder); + } + + return \strrev($result); + } + + /** + * Returns the positive decimal representation of a binary number. + * + * @param string $bytes The bytes representing the number. + * + * @pure + */ + private function toDecimal(string $bytes) : string + { + $result = '0'; + $power = '1'; + + for ($i = \strlen($bytes) - 1; $i >= 0; $i--) { + $index = \ord($bytes[$i]); + + if ($index !== 0) { + $result = $this->add($result, ($index === 1) + ? $power + : $this->mul($power, (string) $index) + ); + } + + if ($i !== 0) { + $power = $this->mul($power, '256'); + } + } + + return $result; + } +} diff --git a/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php b/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php new file mode 100644 index 0000000..5ba961e --- /dev/null +++ b/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php @@ -0,0 +1,73 @@ +maxDigits = match (PHP_INT_SIZE) { + 4 => 9, + 8 => 18, + }; + } + + #[Override] + public function add(string $a, string $b) : string + { + /** + * @var numeric-string $a + * @var numeric-string $b + */ + $result = $a + $b; + + if (is_int($result)) { + return (string) $result; + } + + if ($a === '0') { + return $b; + } + + if ($b === '0') { + return $a; + } + + [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); + + $result = $aNeg === $bNeg ? $this->doAdd($aDig, $bDig) : $this->doSub($aDig, $bDig); + + if ($aNeg) { + $result = $this->neg($result); + } + + return $result; + } + + #[Override] + public function sub(string $a, string $b) : string + { + return $this->add($a, $this->neg($b)); + } + + #[Override] + public function mul(string $a, string $b) : string + { + /** + * @var numeric-string $a + * @var numeric-string $b + */ + $result = $a * $b; + + if (is_int($result)) { + return (string) $result; + } + + if ($a === '0' || $b === '0') { + return '0'; + } + + if ($a === '1') { + return $b; + } + + if ($b === '1') { + return $a; + } + + if ($a === '-1') { + return $this->neg($b); + } + + if ($b === '-1') { + return $this->neg($a); + } + + [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); + + $result = $this->doMul($aDig, $bDig); + + if ($aNeg !== $bNeg) { + $result = $this->neg($result); + } + + return $result; + } + + #[Override] + public function divQ(string $a, string $b) : string + { + return $this->divQR($a, $b)[0]; + } + + #[Override] + public function divR(string $a, string $b): string + { + return $this->divQR($a, $b)[1]; + } + + #[Override] + public function divQR(string $a, string $b) : array + { + if ($a === '0') { + return ['0', '0']; + } + + if ($a === $b) { + return ['1', '0']; + } + + if ($b === '1') { + return [$a, '0']; + } + + if ($b === '-1') { + return [$this->neg($a), '0']; + } + + /** @var numeric-string $a */ + $na = $a * 1; // cast to number + + if (is_int($na)) { + /** @var numeric-string $b */ + $nb = $b * 1; + + if (is_int($nb)) { + // the only division that may overflow is PHP_INT_MIN / -1, + // which cannot happen here as we've already handled a divisor of -1 above. + $q = intdiv($na, $nb); + $r = $na % $nb; + + return [ + (string) $q, + (string) $r + ]; + } + } + + [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); + + [$q, $r] = $this->doDiv($aDig, $bDig); + + if ($aNeg !== $bNeg) { + $q = $this->neg($q); + } + + if ($aNeg) { + $r = $this->neg($r); + } + + return [$q, $r]; + } + + #[Override] + public function pow(string $a, int $e) : string + { + if ($e === 0) { + return '1'; + } + + if ($e === 1) { + return $a; + } + + $odd = $e % 2; + $e -= $odd; + + $aa = $this->mul($a, $a); + + $result = $this->pow($aa, $e / 2); + + if ($odd === 1) { + $result = $this->mul($result, $a); + } + + return $result; + } + + /** + * Algorithm from: https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/ + */ + #[Override] + public function modPow(string $base, string $exp, string $mod) : string + { + // special case: the algorithm below fails with 0 power 0 mod 1 (returns 1 instead of 0) + if ($base === '0' && $exp === '0' && $mod === '1') { + return '0'; + } + + // special case: the algorithm below fails with power 0 mod 1 (returns 1 instead of 0) + if ($exp === '0' && $mod === '1') { + return '0'; + } + + $x = $base; + + $res = '1'; + + // numbers are positive, so we can use remainder instead of modulo + $x = $this->divR($x, $mod); + + while ($exp !== '0') { + if (in_array($exp[-1], ['1', '3', '5', '7', '9'])) { // odd + $res = $this->divR($this->mul($res, $x), $mod); + } + + $exp = $this->divQ($exp, '2'); + $x = $this->divR($this->mul($x, $x), $mod); + } + + return $res; + } + + /** + * Adapted from https://cp-algorithms.com/num_methods/roots_newton.html + */ + #[Override] + public function sqrt(string $n) : string + { + if ($n === '0') { + return '0'; + } + + // initial approximation + $x = \str_repeat('9', \intdiv(\strlen($n), 2) ?: 1); + + $decreased = false; + + for (;;) { + $nx = $this->divQ($this->add($x, $this->divQ($n, $x)), '2'); + + if ($x === $nx || $this->cmp($nx, $x) > 0 && $decreased) { + break; + } + + $decreased = $this->cmp($nx, $x) < 0; + $x = $nx; + } + + return $x; + } + + /** + * Performs the addition of two non-signed large integers. + * + * @pure + */ + private function doAdd(string $a, string $b) : string + { + [$a, $b, $length] = $this->pad($a, $b); + + $carry = 0; + $result = ''; + + for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { + $blockLength = $this->maxDigits; + + if ($i < 0) { + $blockLength += $i; + $i = 0; + } + + /** @var numeric-string $blockA */ + $blockA = \substr($a, $i, $blockLength); + + /** @var numeric-string $blockB */ + $blockB = \substr($b, $i, $blockLength); + + $sum = (string) ($blockA + $blockB + $carry); + $sumLength = \strlen($sum); + + if ($sumLength > $blockLength) { + $sum = \substr($sum, 1); + $carry = 1; + } else { + if ($sumLength < $blockLength) { + $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; + } + $carry = 0; + } + + $result = $sum . $result; + + if ($i === 0) { + break; + } + } + + if ($carry === 1) { + $result = '1' . $result; + } + + return $result; + } + + /** + * Performs the subtraction of two non-signed large integers. + * + * @pure + */ + private function doSub(string $a, string $b) : string + { + if ($a === $b) { + return '0'; + } + + // Ensure that we always subtract to a positive result: biggest minus smallest. + $cmp = $this->doCmp($a, $b); + + $invert = ($cmp === -1); + + if ($invert) { + $c = $a; + $a = $b; + $b = $c; + } + + [$a, $b, $length] = $this->pad($a, $b); + + $carry = 0; + $result = ''; + + $complement = 10 ** $this->maxDigits; + + for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { + $blockLength = $this->maxDigits; + + if ($i < 0) { + $blockLength += $i; + $i = 0; + } + + /** @var numeric-string $blockA */ + $blockA = \substr($a, $i, $blockLength); + + /** @var numeric-string $blockB */ + $blockB = \substr($b, $i, $blockLength); + + $sum = $blockA - $blockB - $carry; + + if ($sum < 0) { + $sum += $complement; + $carry = 1; + } else { + $carry = 0; + } + + $sum = (string) $sum; + $sumLength = \strlen($sum); + + if ($sumLength < $blockLength) { + $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; + } + + $result = $sum . $result; + + if ($i === 0) { + break; + } + } + + // Carry cannot be 1 when the loop ends, as a > b + assert($carry === 0); + + $result = \ltrim($result, '0'); + + if ($invert) { + $result = $this->neg($result); + } + + return $result; + } + + /** + * Performs the multiplication of two non-signed large integers. + * + * @pure + */ + private function doMul(string $a, string $b) : string + { + $x = \strlen($a); + $y = \strlen($b); + + $maxDigits = \intdiv($this->maxDigits, 2); + $complement = 10 ** $maxDigits; + + $result = '0'; + + for ($i = $x - $maxDigits;; $i -= $maxDigits) { + $blockALength = $maxDigits; + + if ($i < 0) { + $blockALength += $i; + $i = 0; + } + + $blockA = (int) \substr($a, $i, $blockALength); + + $line = ''; + $carry = 0; + + for ($j = $y - $maxDigits;; $j -= $maxDigits) { + $blockBLength = $maxDigits; + + if ($j < 0) { + $blockBLength += $j; + $j = 0; + } + + $blockB = (int) \substr($b, $j, $blockBLength); + + $mul = $blockA * $blockB + $carry; + $value = $mul % $complement; + $carry = ($mul - $value) / $complement; + + $value = (string) $value; + $value = \str_pad($value, $maxDigits, '0', STR_PAD_LEFT); + + $line = $value . $line; + + if ($j === 0) { + break; + } + } + + if ($carry !== 0) { + $line = $carry . $line; + } + + $line = \ltrim($line, '0'); + + if ($line !== '') { + $line .= \str_repeat('0', $x - $blockALength - $i); + $result = $this->add($result, $line); + } + + if ($i === 0) { + break; + } + } + + return $result; + } + + /** + * Performs the division of two non-signed large integers. + * + * @return string[] The quotient and remainder. + * + * @pure + */ + private function doDiv(string $a, string $b) : array + { + $cmp = $this->doCmp($a, $b); + + if ($cmp === -1) { + return ['0', $a]; + } + + $x = \strlen($a); + $y = \strlen($b); + + // we now know that a >= b && x >= y + + $q = '0'; // quotient + $r = $a; // remainder + $z = $y; // focus length, always $y or $y+1 + + /** @var numeric-string $b */ + $nb = $b * 1; // cast to number + // performance optimization in cases where the remainder will never cause int overflow + if (is_int(($nb - 1) * 10 + 9)) { + $r = (int) \substr($a, 0, $z - 1); + + for ($i = $z - 1; $i < $x; $i++) { + $n = $r * 10 + (int) $a[$i]; + /** @var int $nb */ + $q .= \intdiv($n, $nb); + $r = $n % $nb; + } + + return [\ltrim($q, '0') ?: '0', (string) $r]; + } + + for (;;) { + $focus = \substr($a, 0, $z); + + $cmp = $this->doCmp($focus, $b); + + if ($cmp === -1) { + if ($z === $x) { // remainder < dividend + break; + } + + $z++; + } + + $zeros = \str_repeat('0', $x - $z); + + $q = $this->add($q, '1' . $zeros); + $a = $this->sub($a, $b . $zeros); + + $r = $a; + + if ($r === '0') { // remainder == 0 + break; + } + + $x = \strlen($a); + + if ($x < $y) { // remainder < dividend + break; + } + + $z = $y; + } + + return [$q, $r]; + } + + /** + * Compares two non-signed large numbers. + * + * @return -1|0|1 + * + * @pure + */ + private function doCmp(string $a, string $b) : int + { + $x = \strlen($a); + $y = \strlen($b); + + $cmp = $x <=> $y; + + if ($cmp !== 0) { + return $cmp; + } + + return \strcmp($a, $b) <=> 0; // enforce -1|0|1 + } + + /** + * Pads the left of one of the given numbers with zeros if necessary to make both numbers the same length. + * + * The numbers must only consist of digits, without leading minus sign. + * + * @return array{string, string, int} + * + * @pure + */ + private function pad(string $a, string $b) : array + { + $x = \strlen($a); + $y = \strlen($b); + + if ($x > $y) { + $b = \str_repeat('0', $x - $y) . $b; + + return [$a, $b, $x]; + } + + if ($x < $y) { + $a = \str_repeat('0', $y - $x) . $a; + + return [$a, $b, $y]; + } + + return [$a, $b, $x]; + } +} diff --git a/vendor/brick/math/src/Internal/CalculatorRegistry.php b/vendor/brick/math/src/Internal/CalculatorRegistry.php new file mode 100644 index 0000000..394fae6 --- /dev/null +++ b/vendor/brick/math/src/Internal/CalculatorRegistry.php @@ -0,0 +1,73 @@ += 0.5; otherwise, behaves as for DOWN. + * Note that this is the rounding mode commonly taught at school. + */ + case HALF_UP; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. + * + * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. + */ + case HALF_DOWN; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. + * + * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. + */ + case HALF_CEILING; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. + * + * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. + */ + case HALF_FLOOR; + + /** + * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. + * + * Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; + * behaves as for HALF_DOWN if it's even. + * + * Note that this is the rounding mode that statistically minimizes + * cumulative error when applied repeatedly over a sequence of calculations. + * It is sometimes known as "Banker's rounding", and is chiefly used in the USA. + */ + case HALF_EVEN; +} diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php new file mode 100644 index 0000000..7824d8f --- /dev/null +++ b/vendor/composer/ClassLoader.php @@ -0,0 +1,579 @@ + + * Jordi Boggiano + * + * 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 + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + 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 list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $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 list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $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] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $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 list|string $paths The PSR-0 base directories + * + * @return void + */ + 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 list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + 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 + * + * @return void + */ + 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 + * + * @return void + */ + 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 + * + * @return void + */ + 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 + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * 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; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + 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; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..2052022 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,396 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to + * @internal + */ + private static $selfDir = null; + + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool + */ + private static $installedIsLocalDir; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + + // when using reload, we disable the duplicate protection to ensure that self::$installed data is + // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, + // so we have to assume it does not, and that may result in duplicate data being returned when listing + // all installed packages for example + self::$installedIsLocalDir = false; + } + + /** + * @return string + */ + private static function getSelfDir() + { + if (self::$selfDir === null) { + self::$selfDir = strtr(__DIR__, '\\', '/'); + } + + return self::$selfDir; + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + $copiedLocalDir = false; + + if (self::$canGetVendors) { + $selfDir = self::getSelfDir(); + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + $vendorDir = strtr($vendorDir, '\\', '/'); + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + self::$installedByVendor[$vendorDir] = $required; + $installed[] = $required; + if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { + self::$installed = $required; + self::$installedIsLocalDir = true; + } + } + if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { + $copiedLocalDir = true; + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array() && !$copiedLocalDir) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..c8f885c --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,16 @@ + $vendorDir . '/composer/InstalledVersions.php', + 'GPBMetadata\\GrpcGcp' => $vendorDir . '/google/grpc-gcp/src/generated/GPBMetadata/GrpcGcp.php', + 'Grpc\\Gcp\\AffinityConfig' => $vendorDir . '/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig.php', + 'Grpc\\Gcp\\AffinityConfig_Command' => $vendorDir . '/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig_Command.php', + 'Grpc\\Gcp\\ApiConfig' => $vendorDir . '/google/grpc-gcp/src/generated/Grpc/Gcp/ApiConfig.php', + 'Grpc\\Gcp\\ChannelPoolConfig' => $vendorDir . '/google/grpc-gcp/src/generated/Grpc/Gcp/ChannelPoolConfig.php', + 'Grpc\\Gcp\\MethodConfig' => $vendorDir . '/google/grpc-gcp/src/generated/Grpc/Gcp/MethodConfig.php', +); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 0000000..e0dff4e --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,13 @@ + $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..15a2ff3 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/ramsey/uuid/src'), + 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), + 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), + 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Grpc\\Gcp\\' => array($vendorDir . '/google/grpc-gcp/src'), + 'Grpc\\' => array($vendorDir . '/grpc/grpc/src/lib'), + 'Google\\Type\\' => array($vendorDir . '/google/common-protos/src/Type'), + 'Google\\Rpc\\' => array($vendorDir . '/google/common-protos/src/Rpc'), + 'Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/Google/Protobuf'), + 'Google\\LongRunning\\' => array($vendorDir . '/google/longrunning/src/LongRunning'), + 'Google\\Iam\\' => array($vendorDir . '/google/common-protos/src/Iam'), + 'Google\\Cloud\\Dialogflow\\' => array($vendorDir . '/google/cloud-dialogflow/src'), + 'Google\\Cloud\\' => array($vendorDir . '/google/common-protos/src/Cloud'), + 'Google\\Auth\\' => array($vendorDir . '/google/auth/src'), + 'Google\\Api\\' => array($vendorDir . '/google/common-protos/src/Api'), + 'Google\\ApiCore\\LongRunning\\' => array($vendorDir . '/google/longrunning/src/ApiCore/LongRunning'), + 'Google\\ApiCore\\' => array($vendorDir . '/google/gax/src'), + 'GPBMetadata\\Google\\Type\\' => array($vendorDir . '/google/common-protos/metadata/Type'), + 'GPBMetadata\\Google\\Rpc\\' => array($vendorDir . '/google/common-protos/metadata/Rpc'), + 'GPBMetadata\\Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/GPBMetadata/Google/Protobuf'), + 'GPBMetadata\\Google\\Longrunning\\' => array($vendorDir . '/google/longrunning/metadata/Longrunning'), + 'GPBMetadata\\Google\\Logging\\' => array($vendorDir . '/google/common-protos/metadata/Logging'), + 'GPBMetadata\\Google\\Iam\\' => array($vendorDir . '/google/common-protos/metadata/Iam'), + 'GPBMetadata\\Google\\Cloud\\Dialogflow\\' => array($vendorDir . '/google/cloud-dialogflow/metadata'), + 'GPBMetadata\\Google\\Cloud\\' => array($vendorDir . '/google/common-protos/metadata/Cloud'), + 'GPBMetadata\\Google\\Api\\' => array($vendorDir . '/google/common-protos/metadata/Api'), + 'GPBMetadata\\ApiCore\\' => array($vendorDir . '/google/gax/metadata/ApiCore'), + 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), + 'Brick\\Math\\' => array($vendorDir . '/brick/math/src'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..0655b22 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,50 @@ +register(true); + + $filesToLoad = \Composer\Autoload\ComposerStaticInit5835386f60e88a2d37220bdb9cc5dd48::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); + } + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..6d8cf64 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,227 @@ + __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'R' => + array ( + 'Ramsey\\Uuid\\' => 12, + 'Ramsey\\Collection\\' => 18, + ), + 'P' => + array ( + 'Psr\\Log\\' => 8, + 'Psr\\Http\\Message\\' => 17, + 'Psr\\Http\\Client\\' => 16, + 'Psr\\Cache\\' => 10, + ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + 'Grpc\\Gcp\\' => 9, + 'Grpc\\' => 5, + 'Google\\Type\\' => 12, + 'Google\\Rpc\\' => 11, + 'Google\\Protobuf\\' => 16, + 'Google\\LongRunning\\' => 19, + 'Google\\Iam\\' => 11, + 'Google\\Cloud\\Dialogflow\\' => 24, + 'Google\\Cloud\\' => 13, + 'Google\\Auth\\' => 12, + 'Google\\Api\\' => 11, + 'Google\\ApiCore\\LongRunning\\' => 27, + 'Google\\ApiCore\\' => 15, + 'GPBMetadata\\Google\\Type\\' => 24, + 'GPBMetadata\\Google\\Rpc\\' => 23, + 'GPBMetadata\\Google\\Protobuf\\' => 28, + 'GPBMetadata\\Google\\Longrunning\\' => 31, + 'GPBMetadata\\Google\\Logging\\' => 27, + 'GPBMetadata\\Google\\Iam\\' => 23, + 'GPBMetadata\\Google\\Cloud\\Dialogflow\\' => 36, + 'GPBMetadata\\Google\\Cloud\\' => 25, + 'GPBMetadata\\Google\\Api\\' => 23, + 'GPBMetadata\\ApiCore\\' => 20, + ), + 'F' => + array ( + 'Firebase\\JWT\\' => 13, + ), + 'B' => + array ( + 'Brick\\Math\\' => 11, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Ramsey\\Uuid\\' => + array ( + 0 => __DIR__ . '/..' . '/ramsey/uuid/src', + ), + 'Ramsey\\Collection\\' => + array ( + 0 => __DIR__ . '/..' . '/ramsey/collection/src', + ), + 'Psr\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/log/src', + ), + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-factory/src', + 1 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'Psr\\Http\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-client/src', + ), + 'Psr\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/cache/src', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Grpc\\Gcp\\' => + array ( + 0 => __DIR__ . '/..' . '/google/grpc-gcp/src', + ), + 'Grpc\\' => + array ( + 0 => __DIR__ . '/..' . '/grpc/grpc/src/lib', + ), + 'Google\\Type\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/src/Type', + ), + 'Google\\Rpc\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/src/Rpc', + ), + 'Google\\Protobuf\\' => + array ( + 0 => __DIR__ . '/..' . '/google/protobuf/src/Google/Protobuf', + ), + 'Google\\LongRunning\\' => + array ( + 0 => __DIR__ . '/..' . '/google/longrunning/src/LongRunning', + ), + 'Google\\Iam\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/src/Iam', + ), + 'Google\\Cloud\\Dialogflow\\' => + array ( + 0 => __DIR__ . '/..' . '/google/cloud-dialogflow/src', + ), + 'Google\\Cloud\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/src/Cloud', + ), + 'Google\\Auth\\' => + array ( + 0 => __DIR__ . '/..' . '/google/auth/src', + ), + 'Google\\Api\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/src/Api', + ), + 'Google\\ApiCore\\LongRunning\\' => + array ( + 0 => __DIR__ . '/..' . '/google/longrunning/src/ApiCore/LongRunning', + ), + 'Google\\ApiCore\\' => + array ( + 0 => __DIR__ . '/..' . '/google/gax/src', + ), + 'GPBMetadata\\Google\\Type\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Type', + ), + 'GPBMetadata\\Google\\Rpc\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Rpc', + ), + 'GPBMetadata\\Google\\Protobuf\\' => + array ( + 0 => __DIR__ . '/..' . '/google/protobuf/src/GPBMetadata/Google/Protobuf', + ), + 'GPBMetadata\\Google\\Longrunning\\' => + array ( + 0 => __DIR__ . '/..' . '/google/longrunning/metadata/Longrunning', + ), + 'GPBMetadata\\Google\\Logging\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Logging', + ), + 'GPBMetadata\\Google\\Iam\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Iam', + ), + 'GPBMetadata\\Google\\Cloud\\Dialogflow\\' => + array ( + 0 => __DIR__ . '/..' . '/google/cloud-dialogflow/metadata', + ), + 'GPBMetadata\\Google\\Cloud\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Cloud', + ), + 'GPBMetadata\\Google\\Api\\' => + array ( + 0 => __DIR__ . '/..' . '/google/common-protos/metadata/Api', + ), + 'GPBMetadata\\ApiCore\\' => + array ( + 0 => __DIR__ . '/..' . '/google/gax/metadata/ApiCore', + ), + 'Firebase\\JWT\\' => + array ( + 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', + ), + 'Brick\\Math\\' => + array ( + 0 => __DIR__ . '/..' . '/brick/math/src', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'GPBMetadata\\GrpcGcp' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/GPBMetadata/GrpcGcp.php', + 'Grpc\\Gcp\\AffinityConfig' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig.php', + 'Grpc\\Gcp\\AffinityConfig_Command' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig_Command.php', + 'Grpc\\Gcp\\ApiConfig' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/Grpc/Gcp/ApiConfig.php', + 'Grpc\\Gcp\\ChannelPoolConfig' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/Grpc/Gcp/ChannelPoolConfig.php', + 'Grpc\\Gcp\\MethodConfig' => __DIR__ . '/..' . '/google/grpc-gcp/src/generated/Grpc/Gcp/MethodConfig.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit5835386f60e88a2d37220bdb9cc5dd48::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit5835386f60e88a2d37220bdb9cc5dd48::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit5835386f60e88a2d37220bdb9cc5dd48::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..e1c8db7 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,1448 @@ +{ + "packages": [ + { + "name": "brick/math", + "version": "0.14.0", + "version_normalized": "0.14.0.0", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2", + "reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "2.1.22", + "phpunit/phpunit": "^11.5" + }, + "time": "2025-08-29T12:40:03+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.14.0" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "install-path": "../brick/math" + }, + { + "name": "firebase/php-jwt", + "version": "v6.11.1", + "version_normalized": "6.11.1.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^2.0||^3.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "time": "2025-04-09T20:32:01+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" + }, + "install-path": "../firebase/php-jwt" + }, + { + "name": "google/auth", + "version": "v1.48.1", + "version_normalized": "1.48.1.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "023f41a2c80fb98a493dfb9dffcab643481a7ab0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/023f41a2c80fb98a493dfb9dffcab643481a7ab0", + "reference": "023f41a2c80fb98a493dfb9dffcab643481a7ab0", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^6.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.4.5", + "php": "^8.1", + "psr/cache": "^2.0||^3.0", + "psr/http-message": "^1.1||^2.0", + "psr/log": "^3.0" + }, + "require-dev": { + "guzzlehttp/promises": "^2.0", + "kelvinmo/simplejwt": "0.7.1", + "phpseclib/phpseclib": "^3.0.35", + "phpspec/prophecy-phpunit": "^2.1", + "phpunit/phpunit": "^9.6", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^4.0", + "symfony/process": "^6.0||^7.0", + "webmozart/assert": "^1.11" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "time": "2025-09-30T04:22:33+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "https://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://cloud.google.com/php/docs/reference/auth/latest", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.48.1" + }, + "install-path": "../google/auth" + }, + { + "name": "google/cloud-dialogflow", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-dialogflow.git", + "reference": "b536e04b66e518505dbc0266c7f288f4d692cf7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-dialogflow/zipball/b536e04b66e518505dbc0266c7f288f4d692cf7a", + "reference": "b536e04b66e518505dbc0266c7f288f4d692cf7a", + "shasum": "" + }, + "require": { + "google/gax": "^1.38.0", + "php": "^8.1" + }, + "require-dev": { + "google/cloud-core": "^1.52.7", + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google." + }, + "time": "2025-09-20T01:29:44+00:00", + "type": "library", + "extra": { + "component": { + "id": "cloud-dialogflow", + "path": "Dialogflow", + "entry": null, + "target": "googleapis/google-cloud-php-dialogflow.git" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Cloud\\Dialogflow\\": "src", + "GPBMetadata\\Google\\Cloud\\Dialogflow\\": "metadata" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Cloud Dialogflow Client for PHP", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-dialogflow/tree/v2.2.0" + }, + "install-path": "../google/cloud-dialogflow" + }, + { + "name": "google/common-protos", + "version": "4.12.4", + "version_normalized": "4.12.4.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/common-protos-php.git", + "reference": "0127156899af0df2681bd42024c60bd5360d64e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/0127156899af0df2681bd42024c60bd5360d64e3", + "reference": "0127156899af0df2681bd42024c60bd5360d64e3", + "shasum": "" + }, + "require": { + "google/protobuf": "^4.31", + "php": "^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "time": "2025-09-20T01:29:44+00:00", + "type": "library", + "extra": { + "component": { + "id": "common-protos", + "path": "CommonProtos", + "entry": "README.md", + "target": "googleapis/common-protos-php.git" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Api\\": "src/Api", + "Google\\Iam\\": "src/Iam", + "Google\\Rpc\\": "src/Rpc", + "Google\\Type\\": "src/Type", + "Google\\Cloud\\": "src/Cloud", + "GPBMetadata\\Google\\Api\\": "metadata/Api", + "GPBMetadata\\Google\\Iam\\": "metadata/Iam", + "GPBMetadata\\Google\\Rpc\\": "metadata/Rpc", + "GPBMetadata\\Google\\Type\\": "metadata/Type", + "GPBMetadata\\Google\\Cloud\\": "metadata/Cloud", + "GPBMetadata\\Google\\Logging\\": "metadata/Logging" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google API Common Protos for PHP", + "homepage": "https://github.com/googleapis/common-protos-php", + "keywords": [ + "google" + ], + "support": { + "source": "https://github.com/googleapis/common-protos-php/tree/v4.12.4" + }, + "install-path": "../google/common-protos" + }, + { + "name": "google/gax", + "version": "v1.38.0", + "version_normalized": "1.38.0.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/gax-php.git", + "reference": "0e1bce4a30722e85485bbb132b2fa811d66b397b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/0e1bce4a30722e85485bbb132b2fa811d66b397b", + "reference": "0e1bce4a30722e85485bbb132b2fa811d66b397b", + "shasum": "" + }, + "require": { + "google/auth": "^1.45", + "google/common-protos": "^4.4", + "google/grpc-gcp": "^0.4", + "google/longrunning": "~0.4", + "google/protobuf": "^4.31", + "grpc/grpc": "^1.13", + "guzzlehttp/promises": "^2.0", + "guzzlehttp/psr7": "^2.0", + "php": "^8.1", + "ramsey/uuid": "^4.0" + }, + "conflict": { + "ext-protobuf": "<4.31.0" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "4.*" + }, + "time": "2025-09-17T18:22:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\ApiCore\\": "src", + "GPBMetadata\\ApiCore\\": "metadata/ApiCore" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Google API Core for PHP", + "homepage": "https://github.com/googleapis/gax-php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/gax-php/issues", + "source": "https://github.com/googleapis/gax-php/tree/v1.38.0" + }, + "install-path": "../google/gax" + }, + { + "name": "google/grpc-gcp", + "version": "v0.4.1", + "version_normalized": "0.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "shasum": "" + }, + "require": { + "google/auth": "^1.3", + "google/protobuf": "^v3.25.3||^4.26.1", + "grpc/grpc": "^v1.13.0", + "php": "^8.0", + "psr/cache": "^1.0.1||^2.0.0||^3.0.0" + }, + "require-dev": { + "google/cloud-spanner": "^1.7", + "phpunit/phpunit": "^9.0" + }, + "time": "2025-02-19T21:53:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Grpc\\Gcp\\": "src/" + }, + "classmap": [ + "src/generated/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC GCP library for channel management", + "support": { + "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.1" + }, + "install-path": "../google/grpc-gcp" + }, + { + "name": "google/longrunning", + "version": "0.5.0", + "version_normalized": "0.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/php-longrunning.git", + "reference": "715519ab4aaf3c4268adb2b551ee0f34135c8c5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/715519ab4aaf3c4268adb2b551ee0f34135c8c5f", + "reference": "715519ab4aaf3c4268adb2b551ee0f34135c8c5f", + "shasum": "" + }, + "require-dev": { + "google/gax": "^1.38.0", + "phpunit/phpunit": "^9.0" + }, + "time": "2025-09-20T01:29:44+00:00", + "type": "library", + "extra": { + "component": { + "id": "longrunning", + "path": "LongRunning", + "entry": null, + "target": "googleapis/php-longrunning" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\LongRunning\\": "src/LongRunning", + "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", + "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google LongRunning Client for PHP", + "support": { + "source": "https://github.com/googleapis/php-longrunning/tree/v0.5.0" + }, + "install-path": "../google/longrunning" + }, + { + "name": "google/protobuf", + "version": "v4.32.1", + "version_normalized": "4.32.1.0", + "source": { + "type": "git", + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", + "shasum": "" + }, + "require": { + "php": ">=8.1.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0 <8.5.27" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "time": "2025-09-14T05:14:52+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.32.1" + }, + "install-path": "../google/protobuf" + }, + { + "name": "grpc/grpc", + "version": "1.74.0", + "version_normalized": "1.74.0.0", + "source": { + "type": "git", + "url": "https://github.com/grpc/grpc-php.git", + "reference": "32bf4dba256d60d395582fb6e4e8d3936bcdb713" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grpc/grpc-php/zipball/32bf4dba256d60d395582fb6e4e8d3936bcdb713", + "reference": "32bf4dba256d60d395582fb6e4e8d3936bcdb713", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "google/auth": "^v1.3.0" + }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, + "time": "2025-07-24T20:02:16+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Grpc\\": "src/lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC library for PHP", + "homepage": "https://grpc.io", + "keywords": [ + "rpc" + ], + "support": { + "source": "https://github.com/grpc/grpc-php/tree/v1.74.0" + }, + "install-path": "../grpc/grpc" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "version_normalized": "7.10.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "time": "2025-08-23T22:36:01+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "version_normalized": "2.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "time": "2025-08-22T14:34:08+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "21dc724a0583619cd1652f673303492272778051" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", + "reference": "21dc724a0583619cd1652f673303492272778051", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2025-08-23T21:21:41+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2021-02-03T23:26:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "install-path": "../psr/cache" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "time": "2023-09-23T14:17:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "install-path": "../psr/http-client" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "time": "2024-04-15T12:06:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "install-path": "../psr/http-factory" + }, + { + "name": "psr/http-message", + "version": "2.0", + "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "time": "2023-04-04T09:54:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "install-path": "../psr/http-message" + }, + { + "name": "psr/log", + "version": "3.0.2", + "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2024-09-11T13:17:53+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "install-path": "../psr/log" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "ramsey/collection", + "version": "2.1.1", + "version_normalized": "2.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "time": "2025-03-22T05:38:12+00:00", + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.1.1" + }, + "install-path": "../ramsey/collection" + }, + { + "name": "ramsey/uuid", + "version": "4.9.1", + "version_normalized": "4.9.1.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "time": "2025-09-04T20:59:21+00:00", + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.9.1" + }, + "install-path": "../ramsey/uuid" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "version_normalized": "3.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "time": "2024-09-25T14:21:43+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..a3438ff --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,245 @@ + array( + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '923befa860dd5affe32046f42c857fdd3071b664', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '923befa860dd5affe32046f42c857fdd3071b664', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'brick/math' => array( + 'pretty_version' => '0.14.0', + 'version' => '0.14.0.0', + 'reference' => '113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../brick/math', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'firebase/php-jwt' => array( + 'pretty_version' => 'v6.11.1', + 'version' => '6.11.1.0', + 'reference' => 'd1e91ecf8c598d073d0995afa8cd5c75c6e19e66', + 'type' => 'library', + 'install_path' => __DIR__ . '/../firebase/php-jwt', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/auth' => array( + 'pretty_version' => 'v1.48.1', + 'version' => '1.48.1.0', + 'reference' => '023f41a2c80fb98a493dfb9dffcab643481a7ab0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/auth', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/cloud-dialogflow' => array( + 'pretty_version' => 'v2.2.0', + 'version' => '2.2.0.0', + 'reference' => 'b536e04b66e518505dbc0266c7f288f4d692cf7a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/cloud-dialogflow', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/common-protos' => array( + 'pretty_version' => '4.12.4', + 'version' => '4.12.4.0', + 'reference' => '0127156899af0df2681bd42024c60bd5360d64e3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/common-protos', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/gax' => array( + 'pretty_version' => 'v1.38.0', + 'version' => '1.38.0.0', + 'reference' => '0e1bce4a30722e85485bbb132b2fa811d66b397b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/gax', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/grpc-gcp' => array( + 'pretty_version' => 'v0.4.1', + 'version' => '0.4.1.0', + 'reference' => 'e585b7721bbe806ef45b5c52ae43dfc2bff89968', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/grpc-gcp', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/longrunning' => array( + 'pretty_version' => '0.5.0', + 'version' => '0.5.0.0', + 'reference' => '715519ab4aaf3c4268adb2b551ee0f34135c8c5f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/longrunning', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/protobuf' => array( + 'pretty_version' => 'v4.32.1', + 'version' => '4.32.1.0', + 'reference' => 'c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/protobuf', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'grpc/grpc' => array( + 'pretty_version' => '1.74.0', + 'version' => '1.74.0.0', + 'reference' => '32bf4dba256d60d395582fb6e4e8d3936bcdb713', + 'type' => 'library', + 'install_path' => __DIR__ . '/../grpc/grpc', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.10.0', + 'version' => '7.10.0.0', + 'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '2.3.0', + 'version' => '2.3.0.0', + 'reference' => '481557b130ef3790cf82b713667b43030dc9c957', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'reference' => '21dc724a0583619cd1652f673303492272778051', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/cache' => array( + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-factory' => array( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-factory', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-message' => array( + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/log' => array( + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ramsey/collection' => array( + 'pretty_version' => '2.1.1', + 'version' => '2.1.1.0', + 'reference' => '344572933ad0181accbf4ba763e85a0306a8c5e2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ramsey/collection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ramsey/uuid' => array( + 'pretty_version' => '4.9.1', + 'version' => '4.9.1.0', + 'reference' => '81f941f6f729b1e3ceea61d9d014f8b6c6800440', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ramsey/uuid', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'rhumsaa/uuid' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '4.9.1', + ), + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.6.0', + 'version' => '3.6.0.0', + 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 0000000..14bf88d --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,25 @@ += 80200)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + throw new \RuntimeException( + 'Composer detected issues in your platform: ' . implode(' ', $issues) + ); +} diff --git a/vendor/firebase/php-jwt/CHANGELOG.md b/vendor/firebase/php-jwt/CHANGELOG.md new file mode 100644 index 0000000..7b5f6ce --- /dev/null +++ b/vendor/firebase/php-jwt/CHANGELOG.md @@ -0,0 +1,205 @@ +# Changelog + +## [6.11.1](https://github.com/firebase/php-jwt/compare/v6.11.0...v6.11.1) (2025-04-09) + + +### Bug Fixes + +* update error text for consistency ([#528](https://github.com/firebase/php-jwt/issues/528)) ([c11113a](https://github.com/firebase/php-jwt/commit/c11113afa13265e016a669e75494b9203b8a7775)) + +## [6.11.0](https://github.com/firebase/php-jwt/compare/v6.10.2...v6.11.0) (2025-01-23) + + +### Features + +* support octet typed JWK ([#587](https://github.com/firebase/php-jwt/issues/587)) ([7cb8a26](https://github.com/firebase/php-jwt/commit/7cb8a265fa81edf2fa6ef8098f5bc5ae573c33ad)) + + +### Bug Fixes + +* refactor constructor Key to use PHP 8.0 syntax ([#577](https://github.com/firebase/php-jwt/issues/577)) ([29fa2ce](https://github.com/firebase/php-jwt/commit/29fa2ce9e0582cd397711eec1e80c05ce20fabca)) + +## [6.10.2](https://github.com/firebase/php-jwt/compare/v6.10.1...v6.10.2) (2024-11-24) + + +### Bug Fixes + +* Mitigate PHP8.4 deprecation warnings ([#570](https://github.com/firebase/php-jwt/issues/570)) ([76808fa](https://github.com/firebase/php-jwt/commit/76808fa227f3811aa5cdb3bf81233714b799a5b5)) +* support php 8.4 ([#583](https://github.com/firebase/php-jwt/issues/583)) ([e3d68b0](https://github.com/firebase/php-jwt/commit/e3d68b044421339443c74199edd020e03fb1887e)) + +## [6.10.1](https://github.com/firebase/php-jwt/compare/v6.10.0...v6.10.1) (2024-05-18) + + +### Bug Fixes + +* ensure ratelimit expiry is set every time ([#556](https://github.com/firebase/php-jwt/issues/556)) ([09cb208](https://github.com/firebase/php-jwt/commit/09cb2081c2c3bc0f61e2f2a5fbea5741f7498648)) +* ratelimit cache expiration ([#550](https://github.com/firebase/php-jwt/issues/550)) ([dda7250](https://github.com/firebase/php-jwt/commit/dda725033585ece30ff8cae8937320d7e9f18bae)) + +## [6.10.0](https://github.com/firebase/php-jwt/compare/v6.9.0...v6.10.0) (2023-11-28) + + +### Features + +* allow typ header override ([#546](https://github.com/firebase/php-jwt/issues/546)) ([79cb30b](https://github.com/firebase/php-jwt/commit/79cb30b729a22931b2fbd6b53f20629a83031ba9)) + +## [6.9.0](https://github.com/firebase/php-jwt/compare/v6.8.1...v6.9.0) (2023-10-04) + + +### Features + +* add payload to jwt exception ([#521](https://github.com/firebase/php-jwt/issues/521)) ([175edf9](https://github.com/firebase/php-jwt/commit/175edf958bb61922ec135b2333acf5622f2238a2)) + +## [6.8.1](https://github.com/firebase/php-jwt/compare/v6.8.0...v6.8.1) (2023-07-14) + + +### Bug Fixes + +* accept float claims but round down to ignore them ([#492](https://github.com/firebase/php-jwt/issues/492)) ([3936842](https://github.com/firebase/php-jwt/commit/39368423beeaacb3002afa7dcb75baebf204fe7e)) +* different BeforeValidException messages for nbf and iat ([#526](https://github.com/firebase/php-jwt/issues/526)) ([0a53cf2](https://github.com/firebase/php-jwt/commit/0a53cf2986e45c2bcbf1a269f313ebf56a154ee4)) + +## [6.8.0](https://github.com/firebase/php-jwt/compare/v6.7.0...v6.8.0) (2023-06-14) + + +### Features + +* add support for P-384 curve ([#515](https://github.com/firebase/php-jwt/issues/515)) ([5de4323](https://github.com/firebase/php-jwt/commit/5de4323f4baf4d70bca8663bd87682a69c656c3d)) + + +### Bug Fixes + +* handle invalid http responses ([#508](https://github.com/firebase/php-jwt/issues/508)) ([91c39c7](https://github.com/firebase/php-jwt/commit/91c39c72b22fc3e1191e574089552c1f2041c718)) + +## [6.7.0](https://github.com/firebase/php-jwt/compare/v6.6.0...v6.7.0) (2023-06-14) + + +### Features + +* add ed25519 support to JWK (public keys) ([#452](https://github.com/firebase/php-jwt/issues/452)) ([e53979a](https://github.com/firebase/php-jwt/commit/e53979abae927de916a75b9d239cfda8ce32be2a)) + +## [6.6.0](https://github.com/firebase/php-jwt/compare/v6.5.0...v6.6.0) (2023-06-13) + + +### Features + +* allow get headers when decoding token ([#442](https://github.com/firebase/php-jwt/issues/442)) ([fb85f47](https://github.com/firebase/php-jwt/commit/fb85f47cfaeffdd94faf8defdf07164abcdad6c3)) + + +### Bug Fixes + +* only check iat if nbf is not used ([#493](https://github.com/firebase/php-jwt/issues/493)) ([398ccd2](https://github.com/firebase/php-jwt/commit/398ccd25ea12fa84b9e4f1085d5ff448c21ec797)) + +## [6.5.0](https://github.com/firebase/php-jwt/compare/v6.4.0...v6.5.0) (2023-05-12) + + +### Bug Fixes + +* allow KID of '0' ([#505](https://github.com/firebase/php-jwt/issues/505)) ([9dc46a9](https://github.com/firebase/php-jwt/commit/9dc46a9c3e5801294249cfd2554c5363c9f9326a)) + + +### Miscellaneous Chores + +* drop support for PHP 7.3 ([#495](https://github.com/firebase/php-jwt/issues/495)) + +## [6.4.0](https://github.com/firebase/php-jwt/compare/v6.3.2...v6.4.0) (2023-02-08) + + +### Features + +* add support for W3C ES256K ([#462](https://github.com/firebase/php-jwt/issues/462)) ([213924f](https://github.com/firebase/php-jwt/commit/213924f51936291fbbca99158b11bd4ae56c2c95)) +* improve caching by only decoding jwks when necessary ([#486](https://github.com/firebase/php-jwt/issues/486)) ([78d3ed1](https://github.com/firebase/php-jwt/commit/78d3ed1073553f7d0bbffa6c2010009a0d483d5c)) + +## [6.3.2](https://github.com/firebase/php-jwt/compare/v6.3.1...v6.3.2) (2022-11-01) + + +### Bug Fixes + +* check kid before using as array index ([bad1b04](https://github.com/firebase/php-jwt/commit/bad1b040d0c736bbf86814c6b5ae614f517cf7bd)) + +## [6.3.1](https://github.com/firebase/php-jwt/compare/v6.3.0...v6.3.1) (2022-11-01) + + +### Bug Fixes + +* casing of GET for PSR compat ([#451](https://github.com/firebase/php-jwt/issues/451)) ([60b52b7](https://github.com/firebase/php-jwt/commit/60b52b71978790eafcf3b95cfbd83db0439e8d22)) +* string interpolation format for php 8.2 ([#446](https://github.com/firebase/php-jwt/issues/446)) ([2e07d8a](https://github.com/firebase/php-jwt/commit/2e07d8a1524d12b69b110ad649f17461d068b8f2)) + +## 6.3.0 / 2022-07-15 + + - Added ES256 support to JWK parsing ([#399](https://github.com/firebase/php-jwt/pull/399)) + - Fixed potential caching error in `CachedKeySet` by caching jwks as strings ([#435](https://github.com/firebase/php-jwt/pull/435)) + +## 6.2.0 / 2022-05-14 + + - Added `CachedKeySet` ([#397](https://github.com/firebase/php-jwt/pull/397)) + - Added `$defaultAlg` parameter to `JWT::parseKey` and `JWT::parseKeySet` ([#426](https://github.com/firebase/php-jwt/pull/426)). + +## 6.1.0 / 2022-03-23 + + - Drop support for PHP 5.3, 5.4, 5.5, 5.6, and 7.0 + - Add parameter typing and return types where possible + +## 6.0.0 / 2022-01-24 + + - **Backwards-Compatibility Breaking Changes**: See the [Release Notes](https://github.com/firebase/php-jwt/releases/tag/v6.0.0) for more information. + - New Key object to prevent key/algorithm type confusion (#365) + - Add JWK support (#273) + - Add ES256 support (#256) + - Add ES384 support (#324) + - Add Ed25519 support (#343) + +## 5.0.0 / 2017-06-26 +- Support RS384 and RS512. + See [#117](https://github.com/firebase/php-jwt/pull/117). Thanks [@joostfaassen](https://github.com/joostfaassen)! +- Add an example for RS256 openssl. + See [#125](https://github.com/firebase/php-jwt/pull/125). Thanks [@akeeman](https://github.com/akeeman)! +- Detect invalid Base64 encoding in signature. + See [#162](https://github.com/firebase/php-jwt/pull/162). Thanks [@psignoret](https://github.com/psignoret)! +- Update `JWT::verify` to handle OpenSSL errors. + See [#159](https://github.com/firebase/php-jwt/pull/159). Thanks [@bshaffer](https://github.com/bshaffer)! +- Add `array` type hinting to `decode` method + See [#101](https://github.com/firebase/php-jwt/pull/101). Thanks [@hywak](https://github.com/hywak)! +- Add all JSON error types. + See [#110](https://github.com/firebase/php-jwt/pull/110). Thanks [@gbalduzzi](https://github.com/gbalduzzi)! +- Bugfix 'kid' not in given key list. + See [#129](https://github.com/firebase/php-jwt/pull/129). Thanks [@stampycode](https://github.com/stampycode)! +- Miscellaneous cleanup, documentation and test fixes. + See [#107](https://github.com/firebase/php-jwt/pull/107), [#115](https://github.com/firebase/php-jwt/pull/115), + [#160](https://github.com/firebase/php-jwt/pull/160), [#161](https://github.com/firebase/php-jwt/pull/161), and + [#165](https://github.com/firebase/php-jwt/pull/165). Thanks [@akeeman](https://github.com/akeeman), + [@chinedufn](https://github.com/chinedufn), and [@bshaffer](https://github.com/bshaffer)! + +## 4.0.0 / 2016-07-17 +- Add support for late static binding. See [#88](https://github.com/firebase/php-jwt/pull/88) for details. Thanks to [@chappy84](https://github.com/chappy84)! +- Use static `$timestamp` instead of `time()` to improve unit testing. See [#93](https://github.com/firebase/php-jwt/pull/93) for details. Thanks to [@josephmcdermott](https://github.com/josephmcdermott)! +- Fixes to exceptions classes. See [#81](https://github.com/firebase/php-jwt/pull/81) for details. Thanks to [@Maks3w](https://github.com/Maks3w)! +- Fixes to PHPDoc. See [#76](https://github.com/firebase/php-jwt/pull/76) for details. Thanks to [@akeeman](https://github.com/akeeman)! + +## 3.0.0 / 2015-07-22 +- Minimum PHP version updated from `5.2.0` to `5.3.0`. +- Add `\Firebase\JWT` namespace. See +[#59](https://github.com/firebase/php-jwt/pull/59) for details. Thanks to +[@Dashron](https://github.com/Dashron)! +- Require a non-empty key to decode and verify a JWT. See +[#60](https://github.com/firebase/php-jwt/pull/60) for details. Thanks to +[@sjones608](https://github.com/sjones608)! +- Cleaner documentation blocks in the code. See +[#62](https://github.com/firebase/php-jwt/pull/62) for details. Thanks to +[@johanderuijter](https://github.com/johanderuijter)! + +## 2.2.0 / 2015-06-22 +- Add support for adding custom, optional JWT headers to `JWT::encode()`. See +[#53](https://github.com/firebase/php-jwt/pull/53/files) for details. Thanks to +[@mcocaro](https://github.com/mcocaro)! + +## 2.1.0 / 2015-05-20 +- Add support for adding a leeway to `JWT:decode()` that accounts for clock skew +between signing and verifying entities. Thanks to [@lcabral](https://github.com/lcabral)! +- Add support for passing an object implementing the `ArrayAccess` interface for +`$keys` argument in `JWT::decode()`. Thanks to [@aztech-dev](https://github.com/aztech-dev)! + +## 2.0.0 / 2015-04-01 +- **Note**: It is strongly recommended that you update to > v2.0.0 to address + known security vulnerabilities in prior versions when both symmetric and + asymmetric keys are used together. +- Update signature for `JWT::decode(...)` to require an array of supported + algorithms to use when verifying token signatures. diff --git a/vendor/firebase/php-jwt/LICENSE b/vendor/firebase/php-jwt/LICENSE new file mode 100644 index 0000000..11c0146 --- /dev/null +++ b/vendor/firebase/php-jwt/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2011, Neuman Vong + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the copyright holder nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/firebase/php-jwt/README.md b/vendor/firebase/php-jwt/README.md new file mode 100644 index 0000000..e45ccb8 --- /dev/null +++ b/vendor/firebase/php-jwt/README.md @@ -0,0 +1,425 @@ +![Build Status](https://github.com/firebase/php-jwt/actions/workflows/tests.yml/badge.svg) +[![Latest Stable Version](https://poser.pugx.org/firebase/php-jwt/v/stable)](https://packagist.org/packages/firebase/php-jwt) +[![Total Downloads](https://poser.pugx.org/firebase/php-jwt/downloads)](https://packagist.org/packages/firebase/php-jwt) +[![License](https://poser.pugx.org/firebase/php-jwt/license)](https://packagist.org/packages/firebase/php-jwt) + +PHP-JWT +======= +A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to [RFC 7519](https://tools.ietf.org/html/rfc7519). + +Installation +------------ + +Use composer to manage your dependencies and download PHP-JWT: + +```bash +composer require firebase/php-jwt +``` + +Optionally, install the `paragonie/sodium_compat` package from composer if your +php env does not have libsodium installed: + +```bash +composer require paragonie/sodium_compat +``` + +Example +------- +```php +use Firebase\JWT\JWT; +use Firebase\JWT\Key; + +$key = 'example_key'; +$payload = [ + 'iss' => 'http://example.org', + 'aud' => 'http://example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +/** + * IMPORTANT: + * You must specify supported algorithms for your application. See + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40 + * for a list of spec-compliant algorithms. + */ +$jwt = JWT::encode($payload, $key, 'HS256'); +$decoded = JWT::decode($jwt, new Key($key, 'HS256')); +print_r($decoded); + +// Pass a stdClass in as the third parameter to get the decoded header values +$headers = new stdClass(); +$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers); +print_r($headers); + +/* + NOTE: This will now be an object instead of an associative array. To get + an associative array, you will need to cast it as such: +*/ + +$decoded_array = (array) $decoded; + +/** + * You can add a leeway to account for when there is a clock skew times between + * the signing and verifying servers. It is recommended that this leeway should + * not be bigger than a few minutes. + * + * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef + */ +JWT::$leeway = 60; // $leeway in seconds +$decoded = JWT::decode($jwt, new Key($key, 'HS256')); +``` +Example encode/decode headers +------- +Decoding the JWT headers without verifying the JWT first is NOT recommended, and is not supported by +this library. This is because without verifying the JWT, the header values could have been tampered with. +Any value pulled from an unverified header should be treated as if it could be any string sent in from an +attacker. If this is something you still want to do in your application for whatever reason, it's possible to +decode the header values manually simply by calling `json_decode` and `base64_decode` on the JWT +header part: +```php +use Firebase\JWT\JWT; + +$key = 'example_key'; +$payload = [ + 'iss' => 'http://example.org', + 'aud' => 'http://example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +$headers = [ + 'x-forwarded-for' => 'www.google.com' +]; + +// Encode headers in the JWT string +$jwt = JWT::encode($payload, $key, 'HS256', null, $headers); + +// Decode headers from the JWT string WITHOUT validation +// **IMPORTANT**: This operation is vulnerable to attacks, as the JWT has not yet been verified. +// These headers could be any value sent by an attacker. +list($headersB64, $payloadB64, $sig) = explode('.', $jwt); +$decoded = json_decode(base64_decode($headersB64), true); + +print_r($decoded); +``` +Example with RS256 (openssl) +---------------------------- +```php +use Firebase\JWT\JWT; +use Firebase\JWT\Key; + +$privateKey = << 'example.org', + 'aud' => 'example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +$jwt = JWT::encode($payload, $privateKey, 'RS256'); +echo "Encode:\n" . print_r($jwt, true) . "\n"; + +$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256')); + +/* + NOTE: This will now be an object instead of an associative array. To get + an associative array, you will need to cast it as such: +*/ + +$decoded_array = (array) $decoded; +echo "Decode:\n" . print_r($decoded_array, true) . "\n"; +``` + +Example with a passphrase +------------------------- + +```php +use Firebase\JWT\JWT; +use Firebase\JWT\Key; + +// Your passphrase +$passphrase = '[YOUR_PASSPHRASE]'; + +// Your private key file with passphrase +// Can be generated with "ssh-keygen -t rsa -m pem" +$privateKeyFile = '/path/to/key-with-passphrase.pem'; + +// Create a private key of type "resource" +$privateKey = openssl_pkey_get_private( + file_get_contents($privateKeyFile), + $passphrase +); + +$payload = [ + 'iss' => 'example.org', + 'aud' => 'example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +$jwt = JWT::encode($payload, $privateKey, 'RS256'); +echo "Encode:\n" . print_r($jwt, true) . "\n"; + +// Get public key from the private key, or pull from from a file. +$publicKey = openssl_pkey_get_details($privateKey)['key']; + +$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256')); +echo "Decode:\n" . print_r((array) $decoded, true) . "\n"; +``` + +Example with EdDSA (libsodium and Ed25519 signature) +---------------------------- +```php +use Firebase\JWT\JWT; +use Firebase\JWT\Key; + +// Public and private keys are expected to be Base64 encoded. The last +// non-empty line is used so that keys can be generated with +// sodium_crypto_sign_keypair(). The secret keys generated by other tools may +// need to be adjusted to match the input expected by libsodium. + +$keyPair = sodium_crypto_sign_keypair(); + +$privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair)); + +$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair)); + +$payload = [ + 'iss' => 'example.org', + 'aud' => 'example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +$jwt = JWT::encode($payload, $privateKey, 'EdDSA'); +echo "Encode:\n" . print_r($jwt, true) . "\n"; + +$decoded = JWT::decode($jwt, new Key($publicKey, 'EdDSA')); +echo "Decode:\n" . print_r((array) $decoded, true) . "\n"; +```` + +Example with multiple keys +-------------------------- +```php +use Firebase\JWT\JWT; +use Firebase\JWT\Key; + +// Example RSA keys from previous example +// $privateKey1 = '...'; +// $publicKey1 = '...'; + +// Example EdDSA keys from previous example +// $privateKey2 = '...'; +// $publicKey2 = '...'; + +$payload = [ + 'iss' => 'example.org', + 'aud' => 'example.com', + 'iat' => 1356999524, + 'nbf' => 1357000000 +]; + +$jwt1 = JWT::encode($payload, $privateKey1, 'RS256', 'kid1'); +$jwt2 = JWT::encode($payload, $privateKey2, 'EdDSA', 'kid2'); +echo "Encode 1:\n" . print_r($jwt1, true) . "\n"; +echo "Encode 2:\n" . print_r($jwt2, true) . "\n"; + +$keys = [ + 'kid1' => new Key($publicKey1, 'RS256'), + 'kid2' => new Key($publicKey2, 'EdDSA'), +]; + +$decoded1 = JWT::decode($jwt1, $keys); +$decoded2 = JWT::decode($jwt2, $keys); + +echo "Decode 1:\n" . print_r((array) $decoded1, true) . "\n"; +echo "Decode 2:\n" . print_r((array) $decoded2, true) . "\n"; +``` + +Using JWKs +---------- + +```php +use Firebase\JWT\JWK; +use Firebase\JWT\JWT; + +// Set of keys. The "keys" key is required. For example, the JSON response to +// this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk +$jwks = ['keys' => []]; + +// JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key +// objects. Pass this as the second parameter to JWT::decode. +JWT::decode($jwt, JWK::parseKeySet($jwks)); +``` + +Using Cached Key Sets +--------------------- + +The `CachedKeySet` class can be used to fetch and cache JWKS (JSON Web Key Sets) from a public URI. +This has the following advantages: + +1. The results are cached for performance. +2. If an unrecognized key is requested, the cache is refreshed, to accomodate for key rotation. +3. If rate limiting is enabled, the JWKS URI will not make more than 10 requests a second. + +```php +use Firebase\JWT\CachedKeySet; +use Firebase\JWT\JWT; + +// The URI for the JWKS you wish to cache the results from +$jwksUri = 'https://www.gstatic.com/iap/verify/public_key-jwk'; + +// Create an HTTP client (can be any PSR-7 compatible HTTP client) +$httpClient = new GuzzleHttp\Client(); + +// Create an HTTP request factory (can be any PSR-17 compatible HTTP request factory) +$httpFactory = new GuzzleHttp\Psr\HttpFactory(); + +// Create a cache item pool (can be any PSR-6 compatible cache item pool) +$cacheItemPool = Phpfastcache\CacheManager::getInstance('files'); + +$keySet = new CachedKeySet( + $jwksUri, + $httpClient, + $httpFactory, + $cacheItemPool, + null, // $expiresAfter int seconds to set the JWKS to expire + true // $rateLimit true to enable rate limit of 10 RPS on lookup of invalid keys +); + +$jwt = 'eyJhbGci...'; // Some JWT signed by a key from the $jwkUri above +$decoded = JWT::decode($jwt, $keySet); +``` + +Miscellaneous +------------- + +#### Exception Handling + +When a call to `JWT::decode` is invalid, it will throw one of the following exceptions: + +```php +use Firebase\JWT\JWT; +use Firebase\JWT\SignatureInvalidException; +use Firebase\JWT\BeforeValidException; +use Firebase\JWT\ExpiredException; +use DomainException; +use InvalidArgumentException; +use UnexpectedValueException; + +try { + $decoded = JWT::decode($jwt, $keys); +} catch (InvalidArgumentException $e) { + // provided key/key-array is empty or malformed. +} catch (DomainException $e) { + // provided algorithm is unsupported OR + // provided key is invalid OR + // unknown error thrown in openSSL or libsodium OR + // libsodium is required but not available. +} catch (SignatureInvalidException $e) { + // provided JWT signature verification failed. +} catch (BeforeValidException $e) { + // provided JWT is trying to be used before "nbf" claim OR + // provided JWT is trying to be used before "iat" claim. +} catch (ExpiredException $e) { + // provided JWT is trying to be used after "exp" claim. +} catch (UnexpectedValueException $e) { + // provided JWT is malformed OR + // provided JWT is missing an algorithm / using an unsupported algorithm OR + // provided JWT algorithm does not match provided key OR + // provided key ID in key/key-array is empty or invalid. +} +``` + +All exceptions in the `Firebase\JWT` namespace extend `UnexpectedValueException`, and can be simplified +like this: + +```php +use Firebase\JWT\JWT; +use UnexpectedValueException; +try { + $decoded = JWT::decode($jwt, $keys); +} catch (LogicException $e) { + // errors having to do with environmental setup or malformed JWT Keys +} catch (UnexpectedValueException $e) { + // errors having to do with JWT signature and claims +} +``` + +#### Casting to array + +The return value of `JWT::decode` is the generic PHP object `stdClass`. If you'd like to handle with arrays +instead, you can do the following: + +```php +// return type is stdClass +$decoded = JWT::decode($jwt, $keys); + +// cast to array +$decoded = json_decode(json_encode($decoded), true); +``` + +Tests +----- +Run the tests using phpunit: + +```bash +$ pear install PHPUnit +$ phpunit --configuration phpunit.xml.dist +PHPUnit 3.7.10 by Sebastian Bergmann. +..... +Time: 0 seconds, Memory: 2.50Mb +OK (5 tests, 5 assertions) +``` + +New Lines in private keys +----- + +If your private key contains `\n` characters, be sure to wrap it in double quotes `""` +and not single quotes `''` in order to properly interpret the escaped characters. + +License +------- +[3-Clause BSD](http://opensource.org/licenses/BSD-3-Clause). diff --git a/vendor/firebase/php-jwt/composer.json b/vendor/firebase/php-jwt/composer.json new file mode 100644 index 0000000..816cfd0 --- /dev/null +++ b/vendor/firebase/php-jwt/composer.json @@ -0,0 +1,42 @@ +{ + "name": "firebase/php-jwt", + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "php", + "jwt" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "license": "BSD-3-Clause", + "require": { + "php": "^8.0" + }, + "suggest": { + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present", + "ext-sodium": "Support EdDSA (Ed25519) signatures" + }, + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^2.0||^3.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + } +} diff --git a/vendor/firebase/php-jwt/src/BeforeValidException.php b/vendor/firebase/php-jwt/src/BeforeValidException.php new file mode 100644 index 0000000..595164b --- /dev/null +++ b/vendor/firebase/php-jwt/src/BeforeValidException.php @@ -0,0 +1,18 @@ +payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } +} diff --git a/vendor/firebase/php-jwt/src/CachedKeySet.php b/vendor/firebase/php-jwt/src/CachedKeySet.php new file mode 100644 index 0000000..8e8e8d6 --- /dev/null +++ b/vendor/firebase/php-jwt/src/CachedKeySet.php @@ -0,0 +1,274 @@ + + */ +class CachedKeySet implements ArrayAccess +{ + /** + * @var string + */ + private $jwksUri; + /** + * @var ClientInterface + */ + private $httpClient; + /** + * @var RequestFactoryInterface + */ + private $httpFactory; + /** + * @var CacheItemPoolInterface + */ + private $cache; + /** + * @var ?int + */ + private $expiresAfter; + /** + * @var ?CacheItemInterface + */ + private $cacheItem; + /** + * @var array> + */ + private $keySet; + /** + * @var string + */ + private $cacheKey; + /** + * @var string + */ + private $cacheKeyPrefix = 'jwks'; + /** + * @var int + */ + private $maxKeyLength = 64; + /** + * @var bool + */ + private $rateLimit; + /** + * @var string + */ + private $rateLimitCacheKey; + /** + * @var int + */ + private $maxCallsPerMinute = 10; + /** + * @var string|null + */ + private $defaultAlg; + + public function __construct( + string $jwksUri, + ClientInterface $httpClient, + RequestFactoryInterface $httpFactory, + CacheItemPoolInterface $cache, + ?int $expiresAfter = null, + bool $rateLimit = false, + ?string $defaultAlg = null + ) { + $this->jwksUri = $jwksUri; + $this->httpClient = $httpClient; + $this->httpFactory = $httpFactory; + $this->cache = $cache; + $this->expiresAfter = $expiresAfter; + $this->rateLimit = $rateLimit; + $this->defaultAlg = $defaultAlg; + $this->setCacheKeys(); + } + + /** + * @param string $keyId + * @return Key + */ + public function offsetGet($keyId): Key + { + if (!$this->keyIdExists($keyId)) { + throw new OutOfBoundsException('Key ID not found'); + } + return JWK::parseKey($this->keySet[$keyId], $this->defaultAlg); + } + + /** + * @param string $keyId + * @return bool + */ + public function offsetExists($keyId): bool + { + return $this->keyIdExists($keyId); + } + + /** + * @param string $offset + * @param Key $value + */ + public function offsetSet($offset, $value): void + { + throw new LogicException('Method not implemented'); + } + + /** + * @param string $offset + */ + public function offsetUnset($offset): void + { + throw new LogicException('Method not implemented'); + } + + /** + * @return array + */ + private function formatJwksForCache(string $jwks): array + { + $jwks = json_decode($jwks, true); + + if (!isset($jwks['keys'])) { + throw new UnexpectedValueException('"keys" member must exist in the JWK Set'); + } + + if (empty($jwks['keys'])) { + throw new InvalidArgumentException('JWK Set did not contain any keys'); + } + + $keys = []; + foreach ($jwks['keys'] as $k => $v) { + $kid = isset($v['kid']) ? $v['kid'] : $k; + $keys[(string) $kid] = $v; + } + + return $keys; + } + + private function keyIdExists(string $keyId): bool + { + if (null === $this->keySet) { + $item = $this->getCacheItem(); + // Try to load keys from cache + if ($item->isHit()) { + // item found! retrieve it + $this->keySet = $item->get(); + // If the cached item is a string, the JWKS response was cached (previous behavior). + // Parse this into expected format array instead. + if (\is_string($this->keySet)) { + $this->keySet = $this->formatJwksForCache($this->keySet); + } + } + } + + if (!isset($this->keySet[$keyId])) { + if ($this->rateLimitExceeded()) { + return false; + } + $request = $this->httpFactory->createRequest('GET', $this->jwksUri); + $jwksResponse = $this->httpClient->sendRequest($request); + if ($jwksResponse->getStatusCode() !== 200) { + throw new UnexpectedValueException( + \sprintf('HTTP Error: %d %s for URI "%s"', + $jwksResponse->getStatusCode(), + $jwksResponse->getReasonPhrase(), + $this->jwksUri, + ), + $jwksResponse->getStatusCode() + ); + } + $this->keySet = $this->formatJwksForCache((string) $jwksResponse->getBody()); + + if (!isset($this->keySet[$keyId])) { + return false; + } + + $item = $this->getCacheItem(); + $item->set($this->keySet); + if ($this->expiresAfter) { + $item->expiresAfter($this->expiresAfter); + } + $this->cache->save($item); + } + + return true; + } + + private function rateLimitExceeded(): bool + { + if (!$this->rateLimit) { + return false; + } + + $cacheItem = $this->cache->getItem($this->rateLimitCacheKey); + + $cacheItemData = []; + if ($cacheItem->isHit() && \is_array($data = $cacheItem->get())) { + $cacheItemData = $data; + } + + $callsPerMinute = $cacheItemData['callsPerMinute'] ?? 0; + $expiry = $cacheItemData['expiry'] ?? new \DateTime('+60 seconds', new \DateTimeZone('UTC')); + + if (++$callsPerMinute > $this->maxCallsPerMinute) { + return true; + } + + $cacheItem->set(['expiry' => $expiry, 'callsPerMinute' => $callsPerMinute]); + $cacheItem->expiresAt($expiry); + $this->cache->save($cacheItem); + return false; + } + + private function getCacheItem(): CacheItemInterface + { + if (\is_null($this->cacheItem)) { + $this->cacheItem = $this->cache->getItem($this->cacheKey); + } + + return $this->cacheItem; + } + + private function setCacheKeys(): void + { + if (empty($this->jwksUri)) { + throw new RuntimeException('JWKS URI is empty'); + } + + // ensure we do not have illegal characters + $key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $this->jwksUri); + + // add prefix + $key = $this->cacheKeyPrefix . $key; + + // Hash keys if they exceed $maxKeyLength of 64 + if (\strlen($key) > $this->maxKeyLength) { + $key = substr(hash('sha256', $key), 0, $this->maxKeyLength); + } + + $this->cacheKey = $key; + + if ($this->rateLimit) { + // add prefix + $rateLimitKey = $this->cacheKeyPrefix . 'ratelimit' . $key; + + // Hash keys if they exceed $maxKeyLength of 64 + if (\strlen($rateLimitKey) > $this->maxKeyLength) { + $rateLimitKey = substr(hash('sha256', $rateLimitKey), 0, $this->maxKeyLength); + } + + $this->rateLimitCacheKey = $rateLimitKey; + } + } +} diff --git a/vendor/firebase/php-jwt/src/ExpiredException.php b/vendor/firebase/php-jwt/src/ExpiredException.php new file mode 100644 index 0000000..12fef09 --- /dev/null +++ b/vendor/firebase/php-jwt/src/ExpiredException.php @@ -0,0 +1,18 @@ +payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } +} diff --git a/vendor/firebase/php-jwt/src/JWK.php b/vendor/firebase/php-jwt/src/JWK.php new file mode 100644 index 0000000..405dcc4 --- /dev/null +++ b/vendor/firebase/php-jwt/src/JWK.php @@ -0,0 +1,355 @@ + + * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD + * @link https://github.com/firebase/php-jwt + */ +class JWK +{ + private const OID = '1.2.840.10045.2.1'; + private const ASN1_OBJECT_IDENTIFIER = 0x06; + private const ASN1_SEQUENCE = 0x10; // also defined in JWT + private const ASN1_BIT_STRING = 0x03; + private const EC_CURVES = [ + 'P-256' => '1.2.840.10045.3.1.7', // Len: 64 + 'secp256k1' => '1.3.132.0.10', // Len: 64 + 'P-384' => '1.3.132.0.34', // Len: 96 + // 'P-521' => '1.3.132.0.35', // Len: 132 (not supported) + ]; + + // For keys with "kty" equal to "OKP" (Octet Key Pair), the "crv" parameter must contain the key subtype. + // This library supports the following subtypes: + private const OKP_SUBTYPES = [ + 'Ed25519' => true, // RFC 8037 + ]; + + /** + * Parse a set of JWK keys + * + * @param array $jwks The JSON Web Key Set as an associative array + * @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the + * JSON Web Key Set + * + * @return array An associative array of key IDs (kid) to Key objects + * + * @throws InvalidArgumentException Provided JWK Set is empty + * @throws UnexpectedValueException Provided JWK Set was invalid + * @throws DomainException OpenSSL failure + * + * @uses parseKey + */ + public static function parseKeySet(array $jwks, ?string $defaultAlg = null): array + { + $keys = []; + + if (!isset($jwks['keys'])) { + throw new UnexpectedValueException('"keys" member must exist in the JWK Set'); + } + + if (empty($jwks['keys'])) { + throw new InvalidArgumentException('JWK Set did not contain any keys'); + } + + foreach ($jwks['keys'] as $k => $v) { + $kid = isset($v['kid']) ? $v['kid'] : $k; + if ($key = self::parseKey($v, $defaultAlg)) { + $keys[(string) $kid] = $key; + } + } + + if (0 === \count($keys)) { + throw new UnexpectedValueException('No supported algorithms found in JWK Set'); + } + + return $keys; + } + + /** + * Parse a JWK key + * + * @param array $jwk An individual JWK + * @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the + * JSON Web Key Set + * + * @return Key The key object for the JWK + * + * @throws InvalidArgumentException Provided JWK is empty + * @throws UnexpectedValueException Provided JWK was invalid + * @throws DomainException OpenSSL failure + * + * @uses createPemFromModulusAndExponent + */ + public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key + { + if (empty($jwk)) { + throw new InvalidArgumentException('JWK must not be empty'); + } + + if (!isset($jwk['kty'])) { + throw new UnexpectedValueException('JWK must contain a "kty" parameter'); + } + + if (!isset($jwk['alg'])) { + if (\is_null($defaultAlg)) { + // The "alg" parameter is optional in a KTY, but an algorithm is required + // for parsing in this library. Use the $defaultAlg parameter when parsing the + // key set in order to prevent this error. + // @see https://datatracker.ietf.org/doc/html/rfc7517#section-4.4 + throw new UnexpectedValueException('JWK must contain an "alg" parameter'); + } + $jwk['alg'] = $defaultAlg; + } + + switch ($jwk['kty']) { + case 'RSA': + if (!empty($jwk['d'])) { + throw new UnexpectedValueException('RSA private keys are not supported'); + } + if (!isset($jwk['n']) || !isset($jwk['e'])) { + throw new UnexpectedValueException('RSA keys must contain values for both "n" and "e"'); + } + + $pem = self::createPemFromModulusAndExponent($jwk['n'], $jwk['e']); + $publicKey = \openssl_pkey_get_public($pem); + if (false === $publicKey) { + throw new DomainException( + 'OpenSSL error: ' . \openssl_error_string() + ); + } + return new Key($publicKey, $jwk['alg']); + case 'EC': + if (isset($jwk['d'])) { + // The key is actually a private key + throw new UnexpectedValueException('Key data must be for a public key'); + } + + if (empty($jwk['crv'])) { + throw new UnexpectedValueException('crv not set'); + } + + if (!isset(self::EC_CURVES[$jwk['crv']])) { + throw new DomainException('Unrecognised or unsupported EC curve'); + } + + if (empty($jwk['x']) || empty($jwk['y'])) { + throw new UnexpectedValueException('x and y not set'); + } + + $publicKey = self::createPemFromCrvAndXYCoordinates($jwk['crv'], $jwk['x'], $jwk['y']); + return new Key($publicKey, $jwk['alg']); + case 'OKP': + if (isset($jwk['d'])) { + // The key is actually a private key + throw new UnexpectedValueException('Key data must be for a public key'); + } + + if (!isset($jwk['crv'])) { + throw new UnexpectedValueException('crv not set'); + } + + if (empty(self::OKP_SUBTYPES[$jwk['crv']])) { + throw new DomainException('Unrecognised or unsupported OKP key subtype'); + } + + if (empty($jwk['x'])) { + throw new UnexpectedValueException('x not set'); + } + + // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. + $publicKey = JWT::convertBase64urlToBase64($jwk['x']); + return new Key($publicKey, $jwk['alg']); + case 'oct': + if (!isset($jwk['k'])) { + throw new UnexpectedValueException('k not set'); + } + + return new Key(JWT::urlsafeB64Decode($jwk['k']), $jwk['alg']); + default: + break; + } + + return null; + } + + /** + * Converts the EC JWK values to pem format. + * + * @param string $crv The EC curve (only P-256 & P-384 is supported) + * @param string $x The EC x-coordinate + * @param string $y The EC y-coordinate + * + * @return string + */ + private static function createPemFromCrvAndXYCoordinates(string $crv, string $x, string $y): string + { + $pem = + self::encodeDER( + self::ASN1_SEQUENCE, + self::encodeDER( + self::ASN1_SEQUENCE, + self::encodeDER( + self::ASN1_OBJECT_IDENTIFIER, + self::encodeOID(self::OID) + ) + . self::encodeDER( + self::ASN1_OBJECT_IDENTIFIER, + self::encodeOID(self::EC_CURVES[$crv]) + ) + ) . + self::encodeDER( + self::ASN1_BIT_STRING, + \chr(0x00) . \chr(0x04) + . JWT::urlsafeB64Decode($x) + . JWT::urlsafeB64Decode($y) + ) + ); + + return \sprintf( + "-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n", + wordwrap(base64_encode($pem), 64, "\n", true) + ); + } + + /** + * Create a public key represented in PEM format from RSA modulus and exponent information + * + * @param string $n The RSA modulus encoded in Base64 + * @param string $e The RSA exponent encoded in Base64 + * + * @return string The RSA public key represented in PEM format + * + * @uses encodeLength + */ + private static function createPemFromModulusAndExponent( + string $n, + string $e + ): string { + $mod = JWT::urlsafeB64Decode($n); + $exp = JWT::urlsafeB64Decode($e); + + $modulus = \pack('Ca*a*', 2, self::encodeLength(\strlen($mod)), $mod); + $publicExponent = \pack('Ca*a*', 2, self::encodeLength(\strlen($exp)), $exp); + + $rsaPublicKey = \pack( + 'Ca*a*a*', + 48, + self::encodeLength(\strlen($modulus) + \strlen($publicExponent)), + $modulus, + $publicExponent + ); + + // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption. + $rsaOID = \pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA + $rsaPublicKey = \chr(0) . $rsaPublicKey; + $rsaPublicKey = \chr(3) . self::encodeLength(\strlen($rsaPublicKey)) . $rsaPublicKey; + + $rsaPublicKey = \pack( + 'Ca*a*', + 48, + self::encodeLength(\strlen($rsaOID . $rsaPublicKey)), + $rsaOID . $rsaPublicKey + ); + + return "-----BEGIN PUBLIC KEY-----\r\n" . + \chunk_split(\base64_encode($rsaPublicKey), 64) . + '-----END PUBLIC KEY-----'; + } + + /** + * DER-encode the length + * + * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See + * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. + * + * @param int $length + * @return string + */ + private static function encodeLength(int $length): string + { + if ($length <= 0x7F) { + return \chr($length); + } + + $temp = \ltrim(\pack('N', $length), \chr(0)); + + return \pack('Ca*', 0x80 | \strlen($temp), $temp); + } + + /** + * Encodes a value into a DER object. + * Also defined in Firebase\JWT\JWT + * + * @param int $type DER tag + * @param string $value the value to encode + * @return string the encoded object + */ + private static function encodeDER(int $type, string $value): string + { + $tag_header = 0; + if ($type === self::ASN1_SEQUENCE) { + $tag_header |= 0x20; + } + + // Type + $der = \chr($tag_header | $type); + + // Length + $der .= \chr(\strlen($value)); + + return $der . $value; + } + + /** + * Encodes a string into a DER-encoded OID. + * + * @param string $oid the OID string + * @return string the binary DER-encoded OID + */ + private static function encodeOID(string $oid): string + { + $octets = explode('.', $oid); + + // Get the first octet + $first = (int) array_shift($octets); + $second = (int) array_shift($octets); + $oid = \chr($first * 40 + $second); + + // Iterate over subsequent octets + foreach ($octets as $octet) { + if ($octet == 0) { + $oid .= \chr(0x00); + continue; + } + $bin = ''; + + while ($octet) { + $bin .= \chr(0x80 | ($octet & 0x7f)); + $octet >>= 7; + } + $bin[0] = $bin[0] & \chr(0x7f); + + // Convert to big endian if necessary + if (pack('V', 65534) == pack('L', 65534)) { + $oid .= strrev($bin); + } else { + $oid .= $bin; + } + } + + return $oid; + } +} diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php new file mode 100644 index 0000000..833a415 --- /dev/null +++ b/vendor/firebase/php-jwt/src/JWT.php @@ -0,0 +1,667 @@ + + * @author Anant Narayanan + * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD + * @link https://github.com/firebase/php-jwt + */ +class JWT +{ + private const ASN1_INTEGER = 0x02; + private const ASN1_SEQUENCE = 0x10; + private const ASN1_BIT_STRING = 0x03; + + /** + * When checking nbf, iat or expiration times, + * we want to provide some extra leeway time to + * account for clock skew. + * + * @var int + */ + public static $leeway = 0; + + /** + * Allow the current timestamp to be specified. + * Useful for fixing a value within unit testing. + * Will default to PHP time() value if null. + * + * @var ?int + */ + public static $timestamp = null; + + /** + * @var array + */ + public static $supported_algs = [ + 'ES384' => ['openssl', 'SHA384'], + 'ES256' => ['openssl', 'SHA256'], + 'ES256K' => ['openssl', 'SHA256'], + 'HS256' => ['hash_hmac', 'SHA256'], + 'HS384' => ['hash_hmac', 'SHA384'], + 'HS512' => ['hash_hmac', 'SHA512'], + 'RS256' => ['openssl', 'SHA256'], + 'RS384' => ['openssl', 'SHA384'], + 'RS512' => ['openssl', 'SHA512'], + 'EdDSA' => ['sodium_crypto', 'EdDSA'], + ]; + + /** + * Decodes a JWT string into a PHP object. + * + * @param string $jwt The JWT + * @param Key|ArrayAccess|array $keyOrKeyArray The Key or associative array of key IDs + * (kid) to Key objects. + * If the algorithm used is asymmetric, this is + * the public key. + * Each Key object contains an algorithm and + * matching key. + * Supported algorithms are 'ES384','ES256', + * 'HS256', 'HS384', 'HS512', 'RS256', 'RS384' + * and 'RS512'. + * @param stdClass $headers Optional. Populates stdClass with headers. + * + * @return stdClass The JWT's payload as a PHP object + * + * @throws InvalidArgumentException Provided key/key-array was empty or malformed + * @throws DomainException Provided JWT is malformed + * @throws UnexpectedValueException Provided JWT was invalid + * @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed + * @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf' + * @throws BeforeValidException Provided JWT is trying to be used before it's been created as defined by 'iat' + * @throws ExpiredException Provided JWT has since expired, as defined by the 'exp' claim + * + * @uses jsonDecode + * @uses urlsafeB64Decode + */ + public static function decode( + string $jwt, + $keyOrKeyArray, + ?stdClass &$headers = null + ): stdClass { + // Validate JWT + $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp; + + if (empty($keyOrKeyArray)) { + throw new InvalidArgumentException('Key may not be empty'); + } + $tks = \explode('.', $jwt); + if (\count($tks) !== 3) { + throw new UnexpectedValueException('Wrong number of segments'); + } + list($headb64, $bodyb64, $cryptob64) = $tks; + $headerRaw = static::urlsafeB64Decode($headb64); + if (null === ($header = static::jsonDecode($headerRaw))) { + throw new UnexpectedValueException('Invalid header encoding'); + } + if ($headers !== null) { + $headers = $header; + } + $payloadRaw = static::urlsafeB64Decode($bodyb64); + if (null === ($payload = static::jsonDecode($payloadRaw))) { + throw new UnexpectedValueException('Invalid claims encoding'); + } + if (\is_array($payload)) { + // prevent PHP Fatal Error in edge-cases when payload is empty array + $payload = (object) $payload; + } + if (!$payload instanceof stdClass) { + throw new UnexpectedValueException('Payload must be a JSON object'); + } + $sig = static::urlsafeB64Decode($cryptob64); + if (empty($header->alg)) { + throw new UnexpectedValueException('Empty algorithm'); + } + if (empty(static::$supported_algs[$header->alg])) { + throw new UnexpectedValueException('Algorithm not supported'); + } + + $key = self::getKey($keyOrKeyArray, property_exists($header, 'kid') ? $header->kid : null); + + // Check the algorithm + if (!self::constantTimeEquals($key->getAlgorithm(), $header->alg)) { + // See issue #351 + throw new UnexpectedValueException('Incorrect key for this algorithm'); + } + if (\in_array($header->alg, ['ES256', 'ES256K', 'ES384'], true)) { + // OpenSSL expects an ASN.1 DER sequence for ES256/ES256K/ES384 signatures + $sig = self::signatureToDER($sig); + } + if (!self::verify("{$headb64}.{$bodyb64}", $sig, $key->getKeyMaterial(), $header->alg)) { + throw new SignatureInvalidException('Signature verification failed'); + } + + // Check the nbf if it is defined. This is the time that the + // token can actually be used. If it's not yet that time, abort. + if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) floor($payload->nbf)) + ); + $ex->setPayload($payload); + throw $ex; + } + + // Check that this token has been created before 'now'. This prevents + // using tokens that have been created for later use (and haven't + // correctly used the nbf claim). + if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) floor($payload->iat)) + ); + $ex->setPayload($payload); + throw $ex; + } + + // Check if this token has expired. + if (isset($payload->exp) && ($timestamp - static::$leeway) >= $payload->exp) { + $ex = new ExpiredException('Expired token'); + $ex->setPayload($payload); + throw $ex; + } + + return $payload; + } + + /** + * Converts and signs a PHP array into a JWT string. + * + * @param array $payload PHP array + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key. + * @param string $alg Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', + * 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' + * @param string $keyId + * @param array $head An array with header elements to attach + * + * @return string A signed JWT + * + * @uses jsonEncode + * @uses urlsafeB64Encode + */ + public static function encode( + array $payload, + $key, + string $alg, + ?string $keyId = null, + ?array $head = null + ): string { + $header = ['typ' => 'JWT']; + if (isset($head)) { + $header = \array_merge($header, $head); + } + $header['alg'] = $alg; + if ($keyId !== null) { + $header['kid'] = $keyId; + } + $segments = []; + $segments[] = static::urlsafeB64Encode((string) static::jsonEncode($header)); + $segments[] = static::urlsafeB64Encode((string) static::jsonEncode($payload)); + $signing_input = \implode('.', $segments); + + $signature = static::sign($signing_input, $key, $alg); + $segments[] = static::urlsafeB64Encode($signature); + + return \implode('.', $segments); + } + + /** + * Sign a string with a given key and algorithm. + * + * @param string $msg The message to sign + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key. + * @param string $alg Supported algorithms are 'EdDSA', 'ES384', 'ES256', 'ES256K', 'HS256', + * 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' + * + * @return string An encrypted message + * + * @throws DomainException Unsupported algorithm or bad key was specified + */ + public static function sign( + string $msg, + $key, + string $alg + ): string { + if (empty(static::$supported_algs[$alg])) { + throw new DomainException('Algorithm not supported'); + } + list($function, $algorithm) = static::$supported_algs[$alg]; + switch ($function) { + case 'hash_hmac': + if (!\is_string($key)) { + throw new InvalidArgumentException('key must be a string when using hmac'); + } + return \hash_hmac($algorithm, $msg, $key, true); + case 'openssl': + $signature = ''; + if (!\is_resource($key) && !openssl_pkey_get_private($key)) { + throw new DomainException('OpenSSL unable to validate key'); + } + $success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line + if (!$success) { + throw new DomainException('OpenSSL unable to sign data'); + } + if ($alg === 'ES256' || $alg === 'ES256K') { + $signature = self::signatureFromDER($signature, 256); + } elseif ($alg === 'ES384') { + $signature = self::signatureFromDER($signature, 384); + } + return $signature; + case 'sodium_crypto': + if (!\function_exists('sodium_crypto_sign_detached')) { + throw new DomainException('libsodium is not available'); + } + if (!\is_string($key)) { + throw new InvalidArgumentException('key must be a string when using EdDSA'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $key)); + $key = base64_decode((string) end($lines)); + if (\strlen($key) === 0) { + throw new DomainException('Key cannot be empty string'); + } + return sodium_crypto_sign_detached($msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); + } + } + + throw new DomainException('Algorithm not supported'); + } + + /** + * Verify a signature with the message, key and method. Not all methods + * are symmetric, so we must have a separate verify and sign method. + * + * @param string $msg The original message (header and body) + * @param string $signature The original signature + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For Ed*, ES*, HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey + * @param string $alg The algorithm + * + * @return bool + * + * @throws DomainException Invalid Algorithm, bad key, or OpenSSL failure + */ + private static function verify( + string $msg, + string $signature, + $keyMaterial, + string $alg + ): bool { + if (empty(static::$supported_algs[$alg])) { + throw new DomainException('Algorithm not supported'); + } + + list($function, $algorithm) = static::$supported_algs[$alg]; + switch ($function) { + case 'openssl': + $success = \openssl_verify($msg, $signature, $keyMaterial, $algorithm); // @phpstan-ignore-line + if ($success === 1) { + return true; + } + if ($success === 0) { + return false; + } + // returns 1 on success, 0 on failure, -1 on error. + throw new DomainException( + 'OpenSSL error: ' . \openssl_error_string() + ); + case 'sodium_crypto': + if (!\function_exists('sodium_crypto_sign_verify_detached')) { + throw new DomainException('libsodium is not available'); + } + if (!\is_string($keyMaterial)) { + throw new InvalidArgumentException('key must be a string when using EdDSA'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $keyMaterial)); + $key = base64_decode((string) end($lines)); + if (\strlen($key) === 0) { + throw new DomainException('Key cannot be empty string'); + } + if (\strlen($signature) === 0) { + throw new DomainException('Signature cannot be empty string'); + } + return sodium_crypto_sign_verify_detached($signature, $msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); + } + case 'hash_hmac': + default: + if (!\is_string($keyMaterial)) { + throw new InvalidArgumentException('key must be a string when using hmac'); + } + $hash = \hash_hmac($algorithm, $msg, $keyMaterial, true); + return self::constantTimeEquals($hash, $signature); + } + } + + /** + * Decode a JSON string into a PHP object. + * + * @param string $input JSON string + * + * @return mixed The decoded JSON string + * + * @throws DomainException Provided string was invalid JSON + */ + public static function jsonDecode(string $input) + { + $obj = \json_decode($input, false, 512, JSON_BIGINT_AS_STRING); + + if ($errno = \json_last_error()) { + self::handleJsonError($errno); + } elseif ($obj === null && $input !== 'null') { + throw new DomainException('Null result with non-null input'); + } + return $obj; + } + + /** + * Encode a PHP array into a JSON string. + * + * @param array $input A PHP array + * + * @return string JSON representation of the PHP array + * + * @throws DomainException Provided object could not be encoded to valid JSON + */ + public static function jsonEncode(array $input): string + { + $json = \json_encode($input, \JSON_UNESCAPED_SLASHES); + if ($errno = \json_last_error()) { + self::handleJsonError($errno); + } elseif ($json === 'null') { + throw new DomainException('Null result with non-null input'); + } + if ($json === false) { + throw new DomainException('Provided object could not be encoded to valid JSON'); + } + return $json; + } + + /** + * Decode a string with URL-safe Base64. + * + * @param string $input A Base64 encoded string + * + * @return string A decoded string + * + * @throws InvalidArgumentException invalid base64 characters + */ + public static function urlsafeB64Decode(string $input): string + { + return \base64_decode(self::convertBase64UrlToBase64($input)); + } + + /** + * Convert a string in the base64url (URL-safe Base64) encoding to standard base64. + * + * @param string $input A Base64 encoded string with URL-safe characters (-_ and no padding) + * + * @return string A Base64 encoded string with standard characters (+/) and padding (=), when + * needed. + * + * @see https://www.rfc-editor.org/rfc/rfc4648 + */ + public static function convertBase64UrlToBase64(string $input): string + { + $remainder = \strlen($input) % 4; + if ($remainder) { + $padlen = 4 - $remainder; + $input .= \str_repeat('=', $padlen); + } + return \strtr($input, '-_', '+/'); + } + + /** + * Encode a string with URL-safe Base64. + * + * @param string $input The string you want encoded + * + * @return string The base64 encode of what you passed in + */ + public static function urlsafeB64Encode(string $input): string + { + return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); + } + + + /** + * Determine if an algorithm has been provided for each Key + * + * @param Key|ArrayAccess|array $keyOrKeyArray + * @param string|null $kid + * + * @throws UnexpectedValueException + * + * @return Key + */ + private static function getKey( + $keyOrKeyArray, + ?string $kid + ): Key { + if ($keyOrKeyArray instanceof Key) { + return $keyOrKeyArray; + } + + if (empty($kid) && $kid !== '0') { + throw new UnexpectedValueException('"kid" empty, unable to lookup correct key'); + } + + if ($keyOrKeyArray instanceof CachedKeySet) { + // Skip "isset" check, as this will automatically refresh if not set + return $keyOrKeyArray[$kid]; + } + + if (!isset($keyOrKeyArray[$kid])) { + throw new UnexpectedValueException('"kid" invalid, unable to lookup correct key'); + } + + return $keyOrKeyArray[$kid]; + } + + /** + * @param string $left The string of known length to compare against + * @param string $right The user-supplied string + * @return bool + */ + public static function constantTimeEquals(string $left, string $right): bool + { + if (\function_exists('hash_equals')) { + return \hash_equals($left, $right); + } + $len = \min(self::safeStrlen($left), self::safeStrlen($right)); + + $status = 0; + for ($i = 0; $i < $len; $i++) { + $status |= (\ord($left[$i]) ^ \ord($right[$i])); + } + $status |= (self::safeStrlen($left) ^ self::safeStrlen($right)); + + return ($status === 0); + } + + /** + * Helper method to create a JSON error. + * + * @param int $errno An error number from json_last_error() + * + * @throws DomainException + * + * @return void + */ + private static function handleJsonError(int $errno): void + { + $messages = [ + JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', + JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3 + ]; + throw new DomainException( + isset($messages[$errno]) + ? $messages[$errno] + : 'Unknown JSON error: ' . $errno + ); + } + + /** + * Get the number of bytes in cryptographic strings. + * + * @param string $str + * + * @return int + */ + private static function safeStrlen(string $str): int + { + if (\function_exists('mb_strlen')) { + return \mb_strlen($str, '8bit'); + } + return \strlen($str); + } + + /** + * Convert an ECDSA signature to an ASN.1 DER sequence + * + * @param string $sig The ECDSA signature to convert + * @return string The encoded DER object + */ + private static function signatureToDER(string $sig): string + { + // Separate the signature into r-value and s-value + $length = max(1, (int) (\strlen($sig) / 2)); + list($r, $s) = \str_split($sig, $length); + + // Trim leading zeros + $r = \ltrim($r, "\x00"); + $s = \ltrim($s, "\x00"); + + // Convert r-value and s-value from unsigned big-endian integers to + // signed two's complement + if (\ord($r[0]) > 0x7f) { + $r = "\x00" . $r; + } + if (\ord($s[0]) > 0x7f) { + $s = "\x00" . $s; + } + + return self::encodeDER( + self::ASN1_SEQUENCE, + self::encodeDER(self::ASN1_INTEGER, $r) . + self::encodeDER(self::ASN1_INTEGER, $s) + ); + } + + /** + * Encodes a value into a DER object. + * + * @param int $type DER tag + * @param string $value the value to encode + * + * @return string the encoded object + */ + private static function encodeDER(int $type, string $value): string + { + $tag_header = 0; + if ($type === self::ASN1_SEQUENCE) { + $tag_header |= 0x20; + } + + // Type + $der = \chr($tag_header | $type); + + // Length + $der .= \chr(\strlen($value)); + + return $der . $value; + } + + /** + * Encodes signature from a DER object. + * + * @param string $der binary signature in DER format + * @param int $keySize the number of bits in the key + * + * @return string the signature + */ + private static function signatureFromDER(string $der, int $keySize): string + { + // OpenSSL returns the ECDSA signatures as a binary ASN.1 DER SEQUENCE + list($offset, $_) = self::readDER($der); + list($offset, $r) = self::readDER($der, $offset); + list($offset, $s) = self::readDER($der, $offset); + + // Convert r-value and s-value from signed two's compliment to unsigned + // big-endian integers + $r = \ltrim($r, "\x00"); + $s = \ltrim($s, "\x00"); + + // Pad out r and s so that they are $keySize bits long + $r = \str_pad($r, $keySize / 8, "\x00", STR_PAD_LEFT); + $s = \str_pad($s, $keySize / 8, "\x00", STR_PAD_LEFT); + + return $r . $s; + } + + /** + * Reads binary DER-encoded data and decodes into a single object + * + * @param string $der the binary data in DER format + * @param int $offset the offset of the data stream containing the object + * to decode + * + * @return array{int, string|null} the new offset and the decoded object + */ + private static function readDER(string $der, int $offset = 0): array + { + $pos = $offset; + $size = \strlen($der); + $constructed = (\ord($der[$pos]) >> 5) & 0x01; + $type = \ord($der[$pos++]) & 0x1f; + + // Length + $len = \ord($der[$pos++]); + if ($len & 0x80) { + $n = $len & 0x1f; + $len = 0; + while ($n-- && $pos < $size) { + $len = ($len << 8) | \ord($der[$pos++]); + } + } + + // Value + if ($type === self::ASN1_BIT_STRING) { + $pos++; // Skip the first contents octet (padding indicator) + $data = \substr($der, $pos, $len - 1); + $pos += $len - 1; + } elseif (!$constructed) { + $data = \substr($der, $pos, $len); + $pos += $len; + } else { + $data = null; + } + + return [$pos, $data]; + } +} diff --git a/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php b/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php new file mode 100644 index 0000000..7933ed6 --- /dev/null +++ b/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php @@ -0,0 +1,20 @@ +algorithm; + } + + /** + * @return string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate + */ + public function getKeyMaterial() + { + return $this->keyMaterial; + } +} diff --git a/vendor/firebase/php-jwt/src/SignatureInvalidException.php b/vendor/firebase/php-jwt/src/SignatureInvalidException.php new file mode 100644 index 0000000..d35dee9 --- /dev/null +++ b/vendor/firebase/php-jwt/src/SignatureInvalidException.php @@ -0,0 +1,7 @@ +Reference Docs + +## Description + +This is Google's officially supported PHP client library for using OAuth 2.0 +authorization and authentication with Google APIs. + +### Installing via Composer + +The recommended way to install the google auth library is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version: + +```bash +composer.phar require google/auth +``` + +## Application Default Credentials + +This library provides an implementation of +[Application Default Credentials (ADC)][application default credentials] for PHP. + +Application Default Credentials provides a simple way to get authorization +credentials for use in calling Google APIs, and is +the recommended approach to authorize calls to Cloud APIs. + +**Important**: If you accept a credential configuration (credential JSON/File/Stream) from an +external source for authentication to Google Cloud Platform, you must validate it before providing +it to any Google API or library. Providing an unvalidated credential configuration to Google APIs +can compromise the security of your systems and data. For more information, refer to +[Validate credential configurations from external sources][externally-sourced-credentials]. + +[externally-sourced-credentials]: https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + +### Set up ADC + +To use ADC, you must set it up by providing credentials. +How you set up ADC depends on the environment where your code is running, +and whether you are running code in a test or production environment. + +For more information, see [Set up Application Default Credentials][set-up-adc]. + +### Enable the API you want to use + +Before making your API call, you must be sure the API you're calling has been +enabled. Go to **APIs & Auth** > **APIs** in the +[Google Developers Console][developer console] and enable the APIs you'd like to +call. For the example below, you must enable the `Drive API`. + +### Call the APIs + +As long as you update the environment variable below to point to *your* JSON +credentials file, the following code should output a list of your Drive files. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// define the scopes for your API call +$scopes = ['https://www.googleapis.com/auth/drive.readonly']; + +// create middleware +$middleware = ApplicationDefaultCredentials::getMiddleware($scopes); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'base_uri' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// make the request +$response = $client->get('drive/v2/files'); + +// show the result! +print_r((string) $response->getBody()); +``` + +##### Guzzle 5 Compatibility + +If you are using [Guzzle 5][Guzzle 5], replace the `create middleware` and +`create the HTTP Client` steps with the following: + +```php +// create the HTTP client +$client = new Client([ + 'base_url' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// create subscriber +$subscriber = ApplicationDefaultCredentials::getSubscriber($scopes); +$client->getEmitter()->attach($subscriber); +``` + +#### Call using an ID Token +If your application is running behind Cloud Run, or using Cloud Identity-Aware +Proxy (IAP), you will need to fetch an ID token to access your application. For +this, use the static method `getIdTokenMiddleware` on +`ApplicationDefaultCredentials`. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// Provide the ID token audience. This can be a Client ID associated with an IAP application, +// Or the URL associated with a CloudRun App +// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; +// $targetAudience = 'https://service-1234-uc.a.run.app'; +$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; + +// create middleware +$middleware = ApplicationDefaultCredentials::getIdTokenMiddleware($targetAudience); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'auth' => 'google_auth', + // Cloud Run, IAP, or custom resource URL + 'base_uri' => 'https://YOUR_PROTECTED_RESOURCE', +]); + +// make the request +$response = $client->get('/'); + +// show the result! +print_r((string) $response->getBody()); +``` + +For invoking Cloud Run services, your service account will need the +[`Cloud Run Invoker`](https://cloud.google.com/run/docs/authenticating/service-to-service) +IAM permission. + +For invoking Cloud Identity-Aware Proxy, you will need to pass the Client ID +used when you set up your protected resource as the target audience. See how to +[secure your IAP app with signed headers](https://cloud.google.com/iap/docs/signed-headers-howto). + +#### Call using a specific JSON key +If you want to use a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can + do this: + +```php +use Google\Auth\CredentialsLoader; +use Google\Auth\Middleware\AuthTokenMiddleware; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// Define the Google Application Credentials array +$jsonKey = ['key' => 'value']; + +// define the scopes for your API call +$scopes = ['https://www.googleapis.com/auth/drive.readonly']; + +// Load credentials from JSON containing service account credentials. +$creds = new ServiceAccountCredentials($scopes, $jsonKey), + +// For other credentials types, create those classes explicitly using the +// "type" field in the JSON key, for example: +$creds = match ($jsonKey['type']) { + 'service_account' => new ServiceAccountCredentials($scope, $jsonKey), + 'authorized_user' => new UserRefreshCredentials($scope, $jsonKey), + default => throw new InvalidArgumentException('This application only supports service account and user account credentials'), +}; + +// optional caching +$creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + +// create middleware +$middleware = new AuthTokenMiddleware($creds); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'base_uri' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// make the request +$response = $client->get('drive/v2/files'); + +// show the result! +print_r((string) $response->getBody()); + +``` + +#### Call using Proxy-Authorization Header +If your application is behind a proxy such as [Google Cloud IAP][iap-proxy-header], +and your application occupies the `Authorization` request header, +you can include the ID token in a `Proxy-Authorization: Bearer` +header instead. If a valid ID token is found in a `Proxy-Authorization` header, +IAP authorizes the request with it. After authorizing the request, IAP passes +the Authorization header to your application without processing the content. +For this, use the static method `getProxyIdTokenMiddleware` on +`ApplicationDefaultCredentials`. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// Provide the ID token audience. This can be a Client ID associated with an IAP application +// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; +$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; + +// create middleware +$middleware = ApplicationDefaultCredentials::getProxyIdTokenMiddleware($targetAudience); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'auth' => ['username', 'pass'], // auth option handled by your application + 'proxy_auth' => 'google_auth', +]); + +// make the request +$response = $client->get('/'); + +// show the result! +print_r((string) $response->getBody()); +``` + +[iap-proxy-header]: https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_proxy-authorization_header + +#### External credentials (Workload identity federation) + +Using workload identity federation, your application can access Google Cloud resources from Amazon Web Services (AWS), +Microsoft Azure or any identity provider that supports OpenID Connect (OIDC). + +Traditionally, applications running outside Google Cloud have used service account keys to access Google Cloud +resources. Using identity federation, you can allow your workload to impersonate a service account. This lets you access +Google Cloud resources directly, eliminating the maintenance and security burden associated with service account keys. + +Follow the detailed instructions on how to +[Configure Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds). + +#### Verifying JWTs + +If you are [using Google ID tokens to authenticate users][google-id-tokens], use +the `Google\Auth\AccessToken` class to verify the ID token: + +```php +use Google\Auth\AccessToken; + +$auth = new AccessToken(); +$auth->verify($idToken); +``` + +If your app is running behind [Google Identity-Aware Proxy][iap-id-tokens] +(IAP), you can verify the ID token coming from the IAP server by pointing to the +appropriate certificate URL for IAP. This is because IAP signs the ID +tokens with a different key than the Google Identity service: + +```php +use Google\Auth\AccessToken; + +$auth = new AccessToken(); +$auth->verify($idToken, [ + 'certsLocation' => AccessToken::IAP_CERT_URL +]); +``` + +[google-id-tokens]: https://developers.google.com/identity/sign-in/web/backend-auth +[iap-id-tokens]: https://cloud.google.com/iap/docs/signed-headers-howto + +## Caching +Caching is enabled by passing a PSR-6 `CacheItemPoolInterface` +instance to the constructor when instantiating the credentials. + +We offer some caching classes out of the box under the `Google\Auth\Cache` namespace. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use Google\Auth\Cache\MemoryCacheItemPool; + +// Cache Instance +$memoryCache = new MemoryCacheItemPool; + +// Get the credentials +// From here, the credentials will cache the access token +$middleware = ApplicationDefaultCredentials::getCredentials($scope, cache: $memoryCache); +``` + +### FileSystemCacheItemPool Cache +The `FileSystemCacheItemPool` class is a `PSR-6` compliant cache that stores its +serialized objects on disk, caching data between processes and making it possible +to use data between different requests. + +```php +use Google\Auth\Cache\FileSystemCacheItemPool; +use Google\Auth\ApplicationDefaultCredentials; + +// Create a Cache pool instance +$cache = new FileSystemCacheItemPool(__DIR__ . '/cache'); + +// Pass your Cache to the Auth Library +$credentials = ApplicationDefaultCredentials::getCredentials($scope, cache: $cache); + +// This token will be cached and be able to be used for the next request +$token = $credentials->fetchAuthToken(); +``` + +### Integrating with a third party cache +You can use a third party that follows the `PSR-6` interface of your choice. + +```php +// run "composer require symfony/cache" +use Google\Auth\ApplicationDefaultCredentials; +use Symfony\Component\Cache\Adapter\FilesystemAdapter; + +// Create the cache instance +$filesystemCache = new FilesystemAdapter(); + +// Create Get the credentials +$credentials = ApplicationDefaultCredentials::getCredentials($targetAudience, cache: $filesystemCache); +``` + +## License + +This library is licensed under Apache 2.0. Full license text is +available in [COPYING][copying]. + +## Contributing + +See [CONTRIBUTING][contributing]. + +## Support + +Please +[report bugs at the project on Github](https://github.com/google/google-auth-library-php/issues). Don't +hesitate to +[ask questions](http://stackoverflow.com/questions/tagged/google-auth-library-php) +about the client or APIs on [StackOverflow](http://stackoverflow.com). + +[google-apis-php-client]: https://github.com/google/google-api-php-client +[application default credentials]: https://cloud.google.com/docs/authentication/application-default-credentials +[contributing]: https://github.com/google/google-auth-library-php/tree/main/.github/CONTRIBUTING.md +[copying]: https://github.com/google/google-auth-library-php/tree/main/COPYING +[Guzzle]: https://github.com/guzzle/guzzle +[Guzzle 5]: http://docs.guzzlephp.org/en/5.3 +[developer console]: https://console.developers.google.com +[set-up-adc]: https://cloud.google.com/docs/authentication/provide-credentials-adc diff --git a/vendor/google/auth/SECURITY.md b/vendor/google/auth/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/vendor/google/auth/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/auth/VERSION b/vendor/google/auth/VERSION new file mode 100644 index 0000000..5525f03 --- /dev/null +++ b/vendor/google/auth/VERSION @@ -0,0 +1 @@ +1.48.1 diff --git a/vendor/google/auth/composer.json b/vendor/google/auth/composer.json new file mode 100644 index 0000000..127fdce --- /dev/null +++ b/vendor/google/auth/composer.json @@ -0,0 +1,44 @@ +{ + "name": "google/auth", + "type": "library", + "description": "Google Auth Library for PHP", + "keywords": ["google", "oauth2", "authentication"], + "homepage": "https://github.com/google/google-auth-library-php", + "license": "Apache-2.0", + "support": { + "docs": "https://cloud.google.com/php/docs/reference/auth/latest" + }, + "require": { + "php": "^8.1", + "firebase/php-jwt": "^6.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.4.5", + "psr/http-message": "^1.1||^2.0", + "psr/cache": "^2.0||^3.0", + "psr/log": "^3.0" + }, + "require-dev": { + "guzzlehttp/promises": "^2.0", + "squizlabs/php_codesniffer": "^4.0", + "phpunit/phpunit": "^9.6", + "phpspec/prophecy-phpunit": "^2.1", + "sebastian/comparator": ">=1.2.3", + "phpseclib/phpseclib": "^3.0.35", + "kelvinmo/simplejwt": "0.7.1", + "webmozart/assert": "^1.11", + "symfony/process": "^6.0||^7.0" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Google\\Auth\\Tests\\": "tests" + } + } +} diff --git a/vendor/google/auth/src/AccessToken.php b/vendor/google/auth/src/AccessToken.php new file mode 100644 index 0000000..9e27b69 --- /dev/null +++ b/vendor/google/auth/src/AccessToken.php @@ -0,0 +1,473 @@ +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + $this->cache = $cache ?: new MemoryCacheItemPool(); + } + + /** + * 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 $issuer The intended issuer of the token. + * @type string $cacheKey The cache key of the cached certs. Defaults to + * the sha1 of $certsLocation if provided, otherwise is set to + * "federated_signon_certs_v3". + * @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. + * @type bool $throwException Whether the function should throw an + * exception if the verification fails. This is useful for + * determining the reason verification failed. + * } + * @return array|false 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 InvalidArgumentException If the cert alg is not supported. + * @throws RuntimeException If certs could not be retrieved from a remote location. + * @throws UnexpectedValueException If the token issuer does not match. + * @throws UnexpectedValueException If the token audience does not match. + */ + public function verify($token, array $options = []) + { + $audience = $options['audience'] ?? null; + $issuer = $options['issuer'] ?? null; + $certsLocation = $options['certsLocation'] ?? self::FEDERATED_SIGNON_CERT_URL; + $cacheKey = $options['cacheKey'] ?? $this->getCacheKeyFromCertLocation($certsLocation); + $throwException = $options['throwException'] ?? false; // for backwards compatibility + + // Check signature against each available cert. + $certs = $this->getCerts($certsLocation, $cacheKey, $options); + $alg = $this->determineAlg($certs); + if (!in_array($alg, ['RS256', 'ES256'])) { + throw new InvalidArgumentException( + 'unrecognized "alg" in certs, expected ES256 or RS256' + ); + } + try { + if ($alg == 'RS256') { + return $this->verifyRs256($token, $certs, $audience, $issuer); + } + return $this->verifyEs256($token, $certs, $audience, $issuer); + } catch (ExpiredException $e) { // firebase/php-jwt 5+ + } catch (SignatureInvalidException $e) { // firebase/php-jwt 5+ + } catch (InvalidTokenException $e) { // simplejwt + } catch (InvalidArgumentException $e) { + } catch (UnexpectedValueException $e) { + } + + if ($throwException) { + throw $e; + } + + return false; + } + + /** + * Identifies the expected algorithm to verify by looking at the "alg" key + * of the provided certs. + * + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @return string The expected algorithm, such as "ES256" or "RS256". + */ + private function determineAlg(array $certs) + { + $alg = null; + foreach ($certs as $cert) { + if (empty($cert['alg'])) { + throw new InvalidArgumentException( + 'certs expects "alg" to be set' + ); + } + $alg = $alg ?: $cert['alg']; + + if ($alg != $cert['alg']) { + throw new InvalidArgumentException( + 'More than one alg detected in certs' + ); + } + } + return $alg; + } + + /** + * Verifies an ES256-signed JWT. + * + * @param string $token The JSON Web Token to be verified. + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @param string|null $audience If set, returns false if the provided + * audience does not match the "aud" claim on the JWT. + * @param string|null $issuer If set, returns false if the provided + * issuer does not match the "iss" claim on the JWT. + * @return array the token payload, if successful, or false if not. + */ + private function verifyEs256($token, array $certs, $audience = null, $issuer = null) + { + $this->checkSimpleJwt(); + + $jwkset = new KeySet(); + foreach ($certs as $cert) { + $jwkset->add(KeyFactory::create($cert, 'php')); + } + + // Validate the signature using the key set and ES256 algorithm. + $jwt = $this->callSimpleJwtDecode([$token, $jwkset, 'ES256']); + $payload = $jwt->getClaims(); + + if ($audience) { + if (!isset($payload['aud']) || $payload['aud'] != $audience) { + throw new UnexpectedValueException('Audience does not match'); + } + } + + // @see https://cloud.google.com/iap/docs/signed-headers-howto#verifying_the_jwt_payload + $issuer = $issuer ?: self::IAP_ISSUER; + if (!isset($payload['iss']) || $payload['iss'] !== $issuer) { + throw new UnexpectedValueException('Issuer does not match'); + } + + return $payload; + } + + /** + * Verifies an RS256-signed JWT. + * + * @param string $token The JSON Web Token to be verified. + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @param string|null $audience If set, returns false if the provided + * audience does not match the "aud" claim on the JWT. + * @param string|null $issuer If set, returns false if the provided + * issuer does not match the "iss" claim on the JWT. + * @return array the token payload, if successful, or false if not. + */ + private function verifyRs256($token, array $certs, $audience = null, $issuer = null) + { + $this->checkAndInitializePhpsec(); + $keys = []; + foreach ($certs as $cert) { + if (empty($cert['kid'])) { + throw new InvalidArgumentException( + 'certs expects "kid" to be set' + ); + } + if (empty($cert['n']) || empty($cert['e'])) { + throw new InvalidArgumentException( + 'RSA certs expects "n" and "e" to be set' + ); + } + $publicKey = $this->loadPhpsecPublicKey($cert['n'], $cert['e']); + + // create an array of key IDs to certs for the JWT library + $keys[$cert['kid']] = new Key($publicKey, 'RS256'); + } + + $payload = $this->callJwtStatic('decode', [ + $token, + $keys, + ]); + + if ($audience) { + if (!property_exists($payload, 'aud') || $payload->aud != $audience) { + throw new UnexpectedValueException('Audience does not match'); + } + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $issuers = $issuer ? [$issuer] : [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS]; + if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { + throw new UnexpectedValueException('Issuer does not match'); + } + + return (array) $payload; + } + + /** + * 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 bool 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 = Utils::streamFor(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 string $cacheKey The key under which to cache the retrieved certs. + * @param array $options [optional] Configuration options. + * @return array + * @throws InvalidArgumentException If received certs are in an invalid format. + */ + private function getCerts($location, $cacheKey, array $options = []) + { + $cacheItem = $this->cache->getItem($cacheKey); + $certs = $cacheItem ? $cacheItem->get() : null; + + $expireTime = null; + if (!$certs) { + list($certs, $expireTime) = $this->retrieveCertsFromLocation($location, $options); + } + + if (!isset($certs['keys'])) { + if ($location !== self::IAP_CERT_URL) { + throw new InvalidArgumentException( + 'federated sign-on certs expects "keys" to be set' + ); + } + throw new InvalidArgumentException( + '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 ($expireTime) { + $cacheItem->expiresAt(new DateTime($expireTime)); + $cacheItem->set($certs); + $this->cache->save($cacheItem); + } + + return $certs['keys']; + } + + /** + * Retrieve and cache a certificates file. + * + * @param string $url location + * @param array $options [optional] Configuration options. + * @return array{array, string} + * @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. + $expireTime = '+1 hour'; + 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((string) file_get_contents($url), true), + $expireTime + ]; + } + + $httpHandler = $this->httpHandler; + $response = $httpHandler(new Request('GET', $url), $options); + + if ($response->getStatusCode() == 200) { + if ($cacheControl = $response->getHeaderLine('Cache-Control')) { + array_map(function ($value) use (&$expireTime) { + list($key, $value) = explode('=', $value) + [null, null]; + if (trim($key) == 'max-age') { + $expireTime = '+' . $value . ' seconds'; + } + }, explode(',', $cacheControl)); + } + return [ + json_decode((string) $response->getBody(), true), + $expireTime + ]; + } + + throw new RuntimeException(sprintf( + 'Failed to retrieve verification certificates: "%s".', + $response->getBody()->getContents() + ), $response->getStatusCode()); + } + + /** + * @return void + */ + private function checkAndInitializePhpsec() + { + if (!class_exists(RSA::class)) { + throw new RuntimeException('Please require phpseclib/phpseclib v3 to use this utility.'); + } + } + + /** + * @return string + * @throws TypeError If the key cannot be initialized to a string. + */ + private function loadPhpsecPublicKey(string $modulus, string $exponent): string + { + $key = PublicKeyLoader::load([ + 'n' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $modulus, + ]), 256), + 'e' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $exponent + ]), 256), + ]); + $formattedPublicKey = $key->toString('PKCS8'); + if (!is_string($formattedPublicKey)) { + throw new TypeError('Failed to initialize the key'); + } + return $formattedPublicKey; + } + + /** + * @return void + */ + private function checkSimpleJwt() + { + // @codeCoverageIgnoreStart + if (!class_exists(SimpleJwt::class)) { + throw new RuntimeException('Please require kelvinmo/simplejwt ^0.2 to use this utility.'); + } + // @codeCoverageIgnoreEnd + } + + /** + * 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 = []) + { + return call_user_func_array([JWT::class, $method], $args); // @phpstan-ignore-line + } + + /** + * Provide a hook to mock calls to the JWT static methods. + * + * @param array $args + * @return mixed + */ + protected function callSimpleJwtDecode(array $args = []) + { + return call_user_func_array([SimpleJwt::class, 'decode'], $args); + } + + /** + * Generate a cache key based on the cert location using sha1 with the + * exception of using "federated_signon_certs_v3" to preserve BC. + * + * @param string $certsLocation + * @return string + */ + private function getCacheKeyFromCertLocation($certsLocation) + { + $key = $certsLocation === self::FEDERATED_SIGNON_CERT_URL + ? 'federated_signon_certs_v3' + : sha1($certsLocation); + + return 'google_auth_certs_cache|' . $key; + } +} diff --git a/vendor/google/auth/src/ApplicationDefaultCredentials.php b/vendor/google/auth/src/ApplicationDefaultCredentials.php new file mode 100644 index 0000000..a64af46 --- /dev/null +++ b/vendor/google/auth/src/ApplicationDefaultCredentials.php @@ -0,0 +1,391 @@ +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 +{ + private const SDK_DEBUG_ENV_VAR = 'GOOGLE_SDK_PHP_LOGGING'; + + /** + * @deprecated + * + * 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|string[] $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @return AuthTokenSubscriber + * @throws DomainException if no implementation can be obtained. + */ + public static function getSubscriber(// @phpstan-ignore-line + $scope = null, + ?callable $httpHandler = null, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); + + /** @phpstan-ignore-next-line */ + 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|string[] $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @param string $quotaProject specifies a project to bill for access + * charges associated with the request. + * @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, + $quotaProject = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache, $quotaProject); + + return new AuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains the default FetchAuthTokenInterface implementation to use + * in this environment. + * + * @param string|string[] $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @param string|null $quotaProject specifies a project to bill for access + * charges associated with the request. + * @param string|string[]|null $defaultScope The default scope to use if no + * user-defined scopes exist, expressed either as an Array or as a + * space-delimited string. + * @param string|null $universeDomain Specifies a universe domain to use for the + * calling client library. + * @param null|false|LoggerInterface $logger A PSR3 compliant LoggerInterface. + * + * @return FetchAuthTokenInterface + * @throws DomainException if no implementation can be obtained. + */ + public static function getCredentials( + $scope = null, + ?callable $httpHandler = null, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null, + $quotaProject = null, + $defaultScope = null, + ?string $universeDomain = null, + null|false|LoggerInterface $logger = null, + ) { + $creds = null; + $jsonKey = CredentialsLoader::fromEnv() + ?: CredentialsLoader::fromWellKnownFile(); + $anyScope = $scope ?: $defaultScope; + + if (!$httpHandler) { + if (!($client = HttpClientCache::getHttpClient())) { + $client = new Client(); + HttpClientCache::setHttpClient($client); + } + + $httpHandler = HttpHandlerFactory::build($client, $logger); + } + + if (is_null($quotaProject)) { + // if a quota project isn't specified, try to get one from the env var + $quotaProject = CredentialsLoader::quotaProjectFromEnv(); + } + + if (!is_null($jsonKey)) { + if ($quotaProject) { + $jsonKey['quota_project_id'] = $quotaProject; + } + if ($universeDomain) { + $jsonKey['universe_domain'] = $universeDomain; + } + $creds = CredentialsLoader::makeCredentials( + $scope, + $jsonKey, + $defaultScope + ); + } elseif (AppIdentityCredentials::onAppEngine() && !GCECredentials::onAppEngineFlexible()) { + $creds = new AppIdentityCredentials($anyScope); + } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { + $creds = new GCECredentials(null, $anyScope, null, $quotaProject, null, $universeDomain); + $creds->setIsOnGce(true); // save the credentials a trip to the metadata server + } + + if (is_null($creds)) { + throw new DomainException(self::notFound()); + } + if (!is_null($cache)) { + $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + } + return $creds; + } + + /** + * Obtains an AuthTokenMiddleware which will fetch an ID token to use in the + * Authorization header. The middleware is configured with the default + * FetchAuthTokenInterface implementation to use in this environment. + * + * If supplied, $targetAudience is used to set the "aud" on the resulting + * ID token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @return AuthTokenMiddleware + * @throws DomainException if no implementation can be obtained. + */ + public static function getIdTokenMiddleware( + $targetAudience, + ?callable $httpHandler = null, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); + + return new AuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains an ProxyAuthTokenMiddleware which will fetch an ID token to use in the + * Authorization header. The middleware is configured with the default + * FetchAuthTokenInterface implementation to use in this environment. + * + * If supplied, $targetAudience is used to set the "aud" on the resulting + * ID token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @return ProxyAuthTokenMiddleware + * @throws DomainException if no implementation can be obtained. + */ + public static function getProxyIdTokenMiddleware( + $targetAudience, + ?callable $httpHandler = null, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); + + return new ProxyAuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains the default FetchAuthTokenInterface implementation to use + * in this environment, configured with a $targetAudience for fetching an ID + * token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * provided if you have one already available for use. + * @return FetchAuthTokenInterface + * @throws DomainException if no implementation can be obtained. + * @throws InvalidArgumentException if JSON "type" key is invalid + */ + public static function getIdTokenCredentials( + $targetAudience, + ?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)) { + if (!array_key_exists('type', $jsonKey)) { + throw new \InvalidArgumentException('json key is missing the type field'); + } + + $creds = match ($jsonKey['type']) { + 'authorized_user' => new UserRefreshCredentials(null, $jsonKey, $targetAudience), + 'impersonated_service_account' => new ImpersonatedServiceAccountCredentials(null, $jsonKey, $targetAudience), + 'service_account' => new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience), + default => throw new InvalidArgumentException('invalid value in the type field') + }; + } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { + $creds = new GCECredentials(null, null, $targetAudience); + $creds->setIsOnGce(true); // save the credentials a trip to the metadata server + } + + if (is_null($creds)) { + throw new DomainException(self::notFound()); + } + if (!is_null($cache)) { + $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + } + return $creds; + } + + /** + * Returns a StdOutLogger instance + * + * @internal + * + * @return null|LoggerInterface + */ + public static function getDefaultLogger(): null|LoggerInterface + { + $loggingFlag = getenv(self::SDK_DEBUG_ENV_VAR); + + // Env var is not set + if (empty($loggingFlag)) { + return null; + } + + $loggingFlag = strtolower($loggingFlag); + + // Env Var is not true + if ($loggingFlag !== 'true') { + if ($loggingFlag !== 'false') { + trigger_error('The ' . self::SDK_DEBUG_ENV_VAR . ' is set, but it is set to another value than false or true. Logging is disabled'); + } + + return null; + } + + return new StdOutLogger(); + } + + /** + * @return string + */ + private static function notFound() + { + $msg = 'Your default credentials were not found. To set up '; + $msg .= 'Application Default Credentials, see '; + $msg .= 'https://cloud.google.com/docs/authentication/external/set-up-adc'; + + return $msg; + } + + /** + * @param callable|null $httpHandler + * @param array|null $cacheConfig + * @param CacheItemPoolInterface|null $cache + * @return bool + */ + private static function onGce( + ?callable $httpHandler = null, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $gceCacheConfig = []; + foreach (['lifetime', 'prefix'] as $key) { + if (isset($cacheConfig['gce_' . $key])) { + $gceCacheConfig[$key] = $cacheConfig['gce_' . $key]; + } + } + + return (new GCECache($gceCacheConfig, $cache))->onGce($httpHandler); + } +} diff --git a/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php b/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php new file mode 100644 index 0000000..ee0651a --- /dev/null +++ b/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php @@ -0,0 +1,230 @@ + + */ + private array $buffer = []; + + /** + * Creates a FileSystemCacheItemPool cache that stores values in local storage + * + * @param string $path The string representation of the path where the cache will store the serialized objects. + */ + public function __construct(string $path) + { + $this->cachePath = $path; + + if (is_dir($this->cachePath)) { + return; + } + + if (!mkdir($this->cachePath)) { + throw new ErrorException("Cache folder couldn't be created."); + } + } + + /** + * {@inheritdoc} + */ + public function getItem(string $key): CacheItemInterface + { + if (!$this->validKey($key)) { + throw new InvalidArgumentException("The key '$key' is not valid. The key should follow the pattern |^[a-zA-Z0-9_\.! ]+$|"); + } + + $item = new TypedItem($key); + + $itemPath = $this->cacheFilePath($key); + + if (!file_exists($itemPath)) { + return $item; + } + + $serializedItem = file_get_contents($itemPath); + + if ($serializedItem === false) { + return $item; + } + + $item->set(unserialize($serializedItem)); + + return $item; + } + + /** + * {@inheritdoc} + * + * @return iterable An iterable object containing all the + * A traversable collection of Cache Items keyed by the cache keys of + * each item. A Cache item will be returned for each key, even if that + * key is not found. However, if no keys are specified then an empty + * traversable MUST be returned instead. + */ + public function getItems(array $keys = []): iterable + { + $result = []; + + foreach ($keys as $key) { + $result[$key] = $this->getItem($key); + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item): bool + { + if (!$this->validKey($item->getKey())) { + return false; + } + + $itemPath = $this->cacheFilePath($item->getKey()); + $serializedItem = serialize($item->get()); + + $result = file_put_contents($itemPath, $serializedItem); + + // 0 bytes write is considered a successful operation + if ($result === false) { + return false; + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function hasItem(string $key): bool + { + return $this->getItem($key)->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear(): bool + { + $this->buffer = []; + + if (!is_dir($this->cachePath)) { + return false; + } + + $files = scandir($this->cachePath); + if (!$files) { + return false; + } + + foreach ($files as $fileName) { + if ($fileName === '.' || $fileName === '..') { + continue; + } + + if (!unlink($this->cachePath . '/' . $fileName)) { + return false; + } + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function deleteItem(string $key): bool + { + if (!$this->validKey($key)) { + throw new InvalidArgumentException("The key '$key' is not valid. The key should follow the pattern |^[a-zA-Z0-9_\.! ]+$|"); + } + + $itemPath = $this->cacheFilePath($key); + + if (!file_exists($itemPath)) { + return true; + } + + return unlink($itemPath); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys): bool + { + $result = true; + + foreach ($keys as $key) { + if (!$this->deleteItem($key)) { + $result = false; + } + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item): bool + { + array_push($this->buffer, $item); + + return true; + } + + /** + * {@inheritdoc} + */ + public function commit(): bool + { + $result = true; + + foreach ($this->buffer as $item) { + if (!$this->save($item)) { + $result = false; + } + } + + return $result; + } + + private function cacheFilePath(string $key): string + { + return $this->cachePath . '/' . $key; + } + + private function validKey(string $key): bool + { + return (bool) preg_match('|^[a-zA-Z0-9_\.]+$|', $key); + } +} diff --git a/vendor/google/auth/src/Cache/InvalidArgumentException.php b/vendor/google/auth/src/Cache/InvalidArgumentException.php new file mode 100644 index 0000000..331e561 --- /dev/null +++ b/vendor/google/auth/src/Cache/InvalidArgumentException.php @@ -0,0 +1,24 @@ +getItems([$key])); // @phpstan-ignore-line + } + + /** + * {@inheritdoc} + * + * @return iterable + * A traversable collection of Cache Items keyed by the cache keys of + * each item. A Cache item will be returned for each key, even if that + * key is not found. However, if no keys are specified then an empty + * traversable MUST be returned instead. + */ + public function getItems(array $keys = []): iterable + { + $items = []; + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? clone $this->items[$key] : new TypedItem($key); + } + + return $items; + } + + /** + * {@inheritdoc} + * + * @return bool + * True if item exists in the cache, false otherwise. + */ + public function hasItem($key): bool + { + $this->isValidKey($key); + + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + * + * @return bool + * True if the pool was successfully cleared. False if there was an error. + */ + public function clear(): bool + { + $this->items = []; + $this->deferredItems = []; + + return true; + } + + /** + * {@inheritdoc} + * + * @return bool + * True if the item was successfully removed. False if there was an error. + */ + public function deleteItem($key): bool + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + * + * @return bool + * True if the items were successfully removed. False if there was an error. + */ + public function deleteItems(array $keys): bool + { + array_walk($keys, [$this, 'isValidKey']); + + foreach ($keys as $key) { + unset($this->items[$key]); + } + + return true; + } + + /** + * {@inheritdoc} + * + * @return bool + * True if the item was successfully persisted. False if there was an error. + */ + public function save(CacheItemInterface $item): bool + { + $this->items[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + * + * @return bool + * False if the item could not be queued or if a commit was attempted and failed. True otherwise. + */ + public function saveDeferred(CacheItemInterface $item): bool + { + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + * + * @return bool + * True if all not-yet-saved items were successfully saved or there were none. False otherwise. + */ + public function commit(): bool + { + 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; + } +} diff --git a/vendor/google/auth/src/Cache/SysVCacheItemPool.php b/vendor/google/auth/src/Cache/SysVCacheItemPool.php new file mode 100644 index 0000000..7821d6b --- /dev/null +++ b/vendor/google/auth/src/Cache/SysVCacheItemPool.php @@ -0,0 +1,248 @@ + + */ + 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 new \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']); + } + + /** + * @param mixed $key + * @return CacheItemInterface + */ + public function getItem($key): CacheItemInterface + { + $this->loadItems(); + return current($this->getItems([$key])); // @phpstan-ignore-line + } + + /** + * @param array $keys + * @return iterable + */ + public function getItems(array $keys = []): iterable + { + $this->loadItems(); + $items = []; + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? + clone $this->items[$key] : + new TypedItem($key); + } + return $items; + } + + /** + * {@inheritdoc} + */ + public function hasItem($key): bool + { + $this->loadItems(); + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear(): bool + { + $this->items = []; + $this->deferredItems = []; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function deleteItem($key): bool + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys): bool + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + foreach ($keys as $key) { + unset($this->items[$key]); + } + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item): bool + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + $this->items[$item->getKey()] = $item; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item): bool + { + $this->deferredItems[$item->getKey()] = $item; + return true; + } + + /** + * {@inheritdoc} + */ + public function commit(): bool + { + 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; + } +} diff --git a/vendor/google/auth/src/Cache/TypedItem.php b/vendor/google/auth/src/Cache/TypedItem.php new file mode 100644 index 0000000..cce6740 --- /dev/null +++ b/vendor/google/auth/src/Cache/TypedItem.php @@ -0,0 +1,170 @@ +key = $key; + $this->expiration = null; + } + + /** + * {@inheritdoc} + */ + public function getKey(): string + { + return $this->key; + } + + /** + * {@inheritdoc} + */ + public function get(): mixed + { + return $this->isHit() ? $this->value : null; + } + + /** + * {@inheritdoc} + */ + public function isHit(): bool + { + if (!$this->isHit) { + return false; + } + + if ($this->expiration === null) { + return true; + } + + return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp(); + } + + /** + * {@inheritdoc} + */ + public function set(mixed $value): static + { + $this->isHit = true; + $this->value = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function expiresAt($expiration): static + { + if ($this->isValidExpiration($expiration)) { + $this->expiration = $expiration; + + return $this; + } + + $error = sprintf( + 'Argument 1 passed to %s::expiresAt() must implement interface DateTimeInterface, %s given', + get_class($this), + gettype($expiration) + ); + + throw new \TypeError($error); + } + + /** + * {@inheritdoc} + */ + public function expiresAfter($time): static + { + 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)); + + throw new \TypeError($error); + } + + return $this; + } + + /** + * 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; + } + + return false; + } + + /** + * @return \DateTime + */ + protected function currentTime() + { + return new \DateTime('now', new \DateTimeZone('UTC')); + } +} diff --git a/vendor/google/auth/src/CacheTrait.php b/vendor/google/auth/src/CacheTrait.php new file mode 100644 index 0000000..49aa346 --- /dev/null +++ b/vendor/google/auth/src/CacheTrait.php @@ -0,0 +1,110 @@ + + */ + private $cacheConfig; + + /** + * @var ?CacheItemPoolInterface + */ + private $cache; + + /** + * Gets the cached value if it is present in the cache when that is + * available. + * + * @param mixed $k + * + * @return mixed + */ + private function getCachedValue($k) + { + if (is_null($this->cache)) { + return null; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return null; + } + + $cacheItem = $this->cache->getItem($key); + if ($cacheItem->isHit()) { + return $cacheItem->get(); + } + } + + /** + * Saves the value in the cache when that is available. + * + * @param mixed $k + * @param mixed $v + * @return mixed + */ + private function setCachedValue($k, $v) + { + if (is_null($this->cache)) { + return null; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return null; + } + + $cacheItem = $this->cache->getItem($key); + $cacheItem->set($v); + $cacheItem->expiresAfter($this->cacheConfig['lifetime']); + return $this->cache->save($cacheItem); + } + + /** + * @param null|string $key + * @return null|string + */ + private function getFullCacheKey($key) + { + if (is_null($key)) { + return null; + } + + $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; + } +} diff --git a/vendor/google/auth/src/CredentialSource/AwsNativeSource.php b/vendor/google/auth/src/CredentialSource/AwsNativeSource.php new file mode 100644 index 0000000..c4113f7 --- /dev/null +++ b/vendor/google/auth/src/CredentialSource/AwsNativeSource.php @@ -0,0 +1,375 @@ +audience = $audience; + $this->regionalCredVerificationUrl = $regionalCredVerificationUrl; + $this->regionUrl = $regionUrl; + $this->securityCredentialsUrl = $securityCredentialsUrl; + $this->imdsv2SessionTokenUrl = $imdsv2SessionTokenUrl; + } + + public function fetchSubjectToken(?callable $httpHandler = null): string + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $headers = []; + if ($this->imdsv2SessionTokenUrl) { + $headers = [ + 'X-aws-ec2-metadata-token' => self::getImdsV2SessionToken($this->imdsv2SessionTokenUrl, $httpHandler) + ]; + } + + if (!$signingVars = self::getSigningVarsFromEnv()) { + if (!$this->securityCredentialsUrl) { + throw new \LogicException('Unable to get credentials from ENV, and no security credentials URL provided'); + } + $signingVars = self::getSigningVarsFromUrl( + $httpHandler, + $this->securityCredentialsUrl, + self::getRoleName($httpHandler, $this->securityCredentialsUrl, $headers), + $headers + ); + } + + if (!$region = self::getRegionFromEnv()) { + if (!$this->regionUrl) { + throw new \LogicException('Unable to get region from ENV, and no region URL provided'); + } + $region = self::getRegionFromUrl($httpHandler, $this->regionUrl, $headers); + } + $url = str_replace('{region}', $region, $this->regionalCredVerificationUrl); + $host = parse_url($url)['host'] ?? ''; + + // From here we use the signing vars to create the signed request to receive a token + [$accessKeyId, $secretAccessKey, $securityToken] = $signingVars; + $headers = self::getSignedRequestHeaders($region, $host, $accessKeyId, $secretAccessKey, $securityToken); + + // Inject x-goog-cloud-target-resource into header + $headers['x-goog-cloud-target-resource'] = $this->audience; + + // Format headers as they're expected in the subject token + $formattedHeaders = array_map( + fn ($k, $v) => ['key' => $k, 'value' => $v], + array_keys($headers), + $headers, + ); + + $request = [ + 'headers' => $formattedHeaders, + 'method' => 'POST', + 'url' => $url, + ]; + + return urlencode(json_encode($request) ?: ''); + } + + /** + * @internal + */ + public static function getImdsV2SessionToken(string $imdsV2Url, callable $httpHandler): string + { + $headers = [ + 'X-aws-ec2-metadata-token-ttl-seconds' => '21600' + ]; + $request = new Request( + 'PUT', + $imdsV2Url, + $headers + ); + + $response = $httpHandler($request); + return (string) $response->getBody(); + } + + /** + * @see http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html + * + * @internal + * + * @return array + */ + public static function getSignedRequestHeaders( + string $region, + string $host, + string $accessKeyId, + string $secretAccessKey, + ?string $securityToken + ): array { + $service = 'sts'; + + # Create a date for headers and the credential string in ISO-8601 format + $amzdate = gmdate('Ymd\THis\Z'); + $datestamp = gmdate('Ymd'); # Date w/o time, used in credential scope + + # Create the canonical headers and signed headers. Header names + # must be trimmed and lowercase, and sorted in code point order from + # low to high. Note that there is a trailing \n. + $canonicalHeaders = sprintf("host:%s\nx-amz-date:%s\n", $host, $amzdate); + if ($securityToken) { + $canonicalHeaders .= sprintf("x-amz-security-token:%s\n", $securityToken); + } + + # Step 5: Create the list of signed headers. This lists the headers + # in the canonicalHeaders list, delimited with ";" and in alpha order. + # Note: The request can include any headers; $canonicalHeaders and + # $signedHeaders lists those that you want to be included in the + # hash of the request. "Host" and "x-amz-date" are always required. + $signedHeaders = 'host;x-amz-date'; + if ($securityToken) { + $signedHeaders .= ';x-amz-security-token'; + } + + # Step 6: Create payload hash (hash of the request body content). For GET + # requests, the payload is an empty string (""). + $payloadHash = hash('sha256', ''); + + # Step 7: Combine elements to create canonical request + $canonicalRequest = implode("\n", [ + 'POST', // method + '/', // canonical URL + self::CRED_VERIFICATION_QUERY, // query string + $canonicalHeaders, + $signedHeaders, + $payloadHash + ]); + + # ************* TASK 2: CREATE THE STRING TO SIGN************* + # Match the algorithm to the hashing algorithm you use, either SHA-1 or + # SHA-256 (recommended) + $algorithm = 'AWS4-HMAC-SHA256'; + $scope = implode('/', [$datestamp, $region, $service, 'aws4_request']); + $stringToSign = implode("\n", [$algorithm, $amzdate, $scope, hash('sha256', $canonicalRequest)]); + + # ************* TASK 3: CALCULATE THE SIGNATURE ************* + # Create the signing key using the function defined above. + // (done above) + $signingKey = self::getSignatureKey($secretAccessKey, $datestamp, $region, $service); + + # Sign the string_to_sign using the signing_key + $signature = bin2hex(self::hmacSign($signingKey, $stringToSign)); + + # ************* TASK 4: ADD SIGNING INFORMATION TO THE REQUEST ************* + # The signing information can be either in a query string value or in + # a header named Authorization. This code shows how to use a header. + # Create authorization header and add to request headers + $authorizationHeader = sprintf( + '%s Credential=%s/%s, SignedHeaders=%s, Signature=%s', + $algorithm, + $accessKeyId, + $scope, + $signedHeaders, + $signature + ); + + # The request can include any headers, but MUST include "host", "x-amz-date", + # and (for this scenario) "Authorization". "host" and "x-amz-date" must + # be included in the canonical_headers and signed_headers, as noted + # earlier. Order here is not significant. + $headers = [ + 'host' => $host, + 'x-amz-date' => $amzdate, + 'Authorization' => $authorizationHeader, + ]; + if ($securityToken) { + $headers['x-amz-security-token'] = $securityToken; + } + + return $headers; + } + + /** + * @internal + */ + public static function getRegionFromEnv(): ?string + { + $region = getenv('AWS_REGION'); + if (empty($region)) { + $region = getenv('AWS_DEFAULT_REGION'); + } + return $region ?: null; + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $regionUrl + * @param array $headers Request headers to send in with the request. + */ + public static function getRegionFromUrl(callable $httpHandler, string $regionUrl, array $headers): string + { + // get the region/zone from the region URL + $regionRequest = new Request('GET', $regionUrl, $headers); + $regionResponse = $httpHandler($regionRequest); + + // Remove last character. For example, if us-east-2b is returned, + // the region would be us-east-2. + return substr((string) $regionResponse->getBody(), 0, -1); + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $securityCredentialsUrl + * @param array $headers Request headers to send in with the request. + */ + public static function getRoleName(callable $httpHandler, string $securityCredentialsUrl, array $headers): string + { + // Get the AWS role name + $roleRequest = new Request('GET', $securityCredentialsUrl, $headers); + $roleResponse = $httpHandler($roleRequest); + $roleName = (string) $roleResponse->getBody(); + + return $roleName; + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $securityCredentialsUrl + * @param array $headers Request headers to send in with the request. + * @return array{string, string, ?string} + */ + public static function getSigningVarsFromUrl( + callable $httpHandler, + string $securityCredentialsUrl, + string $roleName, + array $headers + ): array { + // Get the AWS credentials + $credsRequest = new Request( + 'GET', + $securityCredentialsUrl . '/' . $roleName, + $headers + ); + $credsResponse = $httpHandler($credsRequest); + $awsCreds = json_decode((string) $credsResponse->getBody(), true); + return [ + $awsCreds['AccessKeyId'], // accessKeyId + $awsCreds['SecretAccessKey'], // secretAccessKey + $awsCreds['Token'], // token + ]; + } + + /** + * @internal + * + * @return array{string, string, ?string} + */ + public static function getSigningVarsFromEnv(): ?array + { + $accessKeyId = getenv('AWS_ACCESS_KEY_ID'); + $secretAccessKey = getenv('AWS_SECRET_ACCESS_KEY'); + if ($accessKeyId && $secretAccessKey) { + return [ + $accessKeyId, + $secretAccessKey, + getenv('AWS_SESSION_TOKEN') ?: null, // session token (can be null) + ]; + } + + return null; + } + + /** + * Gets the unique key for caching + * For AwsNativeSource the values are: + * Imdsv2SessionTokenUrl.SecurityCredentialsUrl.RegionUrl.RegionalCredVerificationUrl + * + * @return string + */ + public function getCacheKey(): string + { + return ($this->imdsv2SessionTokenUrl ?? '') . + '.' . ($this->securityCredentialsUrl ?? '') . + '.' . $this->regionUrl . + '.' . $this->regionalCredVerificationUrl; + } + + /** + * Return HMAC hash in binary string + */ + private static function hmacSign(string $key, string $msg): string + { + return hash_hmac('sha256', self::utf8Encode($msg), $key, true); + } + + /** + * @TODO add a fallback when mbstring is not available + */ + private static function utf8Encode(string $string): string + { + return (string) mb_convert_encoding($string, 'UTF-8', 'ISO-8859-1'); + } + + private static function getSignatureKey( + string $key, + string $dateStamp, + string $regionName, + string $serviceName + ): string { + $kDate = self::hmacSign(self::utf8Encode('AWS4' . $key), $dateStamp); + $kRegion = self::hmacSign($kDate, $regionName); + $kService = self::hmacSign($kRegion, $serviceName); + $kSigning = self::hmacSign($kService, 'aws4_request'); + + return $kSigning; + } +} diff --git a/vendor/google/auth/src/CredentialSource/ExecutableSource.php b/vendor/google/auth/src/CredentialSource/ExecutableSource.php new file mode 100644 index 0000000..f6255be --- /dev/null +++ b/vendor/google/auth/src/CredentialSource/ExecutableSource.php @@ -0,0 +1,272 @@ + + * OIDC response sample: + * { + * "version": 1, + * "success": true, + * "token_type": "urn:ietf:params:oauth:token-type:id_token", + * "id_token": "HEADER.PAYLOAD.SIGNATURE", + * "expiration_time": 1620433341 + * } + * + * SAML2 response sample: + * { + * "version": 1, + * "success": true, + * "token_type": "urn:ietf:params:oauth:token-type:saml2", + * "saml_response": "...", + * "expiration_time": 1620433341 + * } + * + * Error response sample: + * { + * "version": 1, + * "success": false, + * "code": "401", + * "message": "Error message." + * } + * + * + * The "expiration_time" field in the JSON response is only required for successful + * responses when an output file was specified in the credential configuration + * + * The auth libraries will populate certain environment variables that will be accessible by the + * executable, such as: GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE, GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE, + * GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE, GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL, and + * GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE. + */ +class ExecutableSource implements ExternalAccountCredentialSourceInterface +{ + private const GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES = 'GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES'; + private const SAML_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:saml2'; + private const OIDC_SUBJECT_TOKEN_TYPE1 = 'urn:ietf:params:oauth:token-type:id_token'; + private const OIDC_SUBJECT_TOKEN_TYPE2 = 'urn:ietf:params:oauth:token-type:jwt'; + + private string $command; + private ExecutableHandler $executableHandler; + private ?string $outputFile; + + /** + * @param string $command The string command to run to get the subject token. + * @param string|null $outputFile + */ + public function __construct( + string $command, + ?string $outputFile, + ?ExecutableHandler $executableHandler = null, + ) { + $this->command = $command; + $this->outputFile = $outputFile; + $this->executableHandler = $executableHandler ?: new ExecutableHandler(); + } + + /** + * Gets the unique key for caching + * The format for the cache key is: + * Command.OutputFile + * + * @return ?string + */ + public function getCacheKey(): ?string + { + return $this->command . '.' . $this->outputFile; + } + + /** + * @param callable|null $httpHandler unused. + * @return string + * @throws RuntimeException if the executable is not allowed to run. + * @throws ExecutableResponseError if the executable response is invalid. + */ + public function fetchSubjectToken(?callable $httpHandler = null): string + { + // Check if the executable is allowed to run. + if (getenv(self::GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES) !== '1') { + throw new RuntimeException( + 'Pluggable Auth executables need to be explicitly allowed to run by ' + . 'setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment ' + . 'Variable to 1.' + ); + } + + if (!$executableResponse = $this->getCachedExecutableResponse()) { + // Run the executable. + $exitCode = ($this->executableHandler)($this->command); + $output = $this->executableHandler->getOutput(); + + // If the exit code is not 0, throw an exception with the output as the error details + if ($exitCode !== 0) { + throw new ExecutableResponseError( + 'The executable failed to run' + . ($output ? ' with the following error: ' . $output : '.'), + (string) $exitCode + ); + } + + $executableResponse = $this->parseExecutableResponse($output); + + // Validate expiration. + if (isset($executableResponse['expiration_time']) && time() >= $executableResponse['expiration_time']) { + throw new ExecutableResponseError('Executable response is expired.'); + } + } + + // Throw error when the request was unsuccessful + if ($executableResponse['success'] === false) { + throw new ExecutableResponseError($executableResponse['message'], (string) $executableResponse['code']); + } + + // Return subject token field based on the token type + return $executableResponse['token_type'] === self::SAML_SUBJECT_TOKEN_TYPE + ? $executableResponse['saml_response'] + : $executableResponse['id_token']; + } + + /** + * @return array|null + */ + private function getCachedExecutableResponse(): ?array + { + if ( + $this->outputFile + && file_exists($this->outputFile) + && !empty(trim($outputFileContents = (string) file_get_contents($this->outputFile))) + ) { + try { + $executableResponse = $this->parseExecutableResponse($outputFileContents); + } catch (ExecutableResponseError $e) { + throw new ExecutableResponseError( + 'Error in output file: ' . $e->getMessage(), + 'INVALID_OUTPUT_FILE' + ); + } + + if ($executableResponse['success'] === false) { + // If the cached token was unsuccessful, run the executable to get a new one. + return null; + } + + if (isset($executableResponse['expiration_time']) && time() >= $executableResponse['expiration_time']) { + // If the cached token is expired, run the executable to get a new one. + return null; + } + + return $executableResponse; + } + + return null; + } + + /** + * @return array + */ + private function parseExecutableResponse(string $response): array + { + $executableResponse = json_decode($response, true); + if (json_last_error() !== JSON_ERROR_NONE) { + throw new ExecutableResponseError( + 'The executable returned an invalid response: ' . $response, + 'INVALID_RESPONSE' + ); + } + if (!array_key_exists('version', $executableResponse)) { + throw new ExecutableResponseError('Executable response must contain a "version" field.'); + } + if (!array_key_exists('success', $executableResponse)) { + throw new ExecutableResponseError('Executable response must contain a "success" field.'); + } + + // Validate required fields for a successful response. + if ($executableResponse['success']) { + // Validate token type field. + $tokenTypes = [self::SAML_SUBJECT_TOKEN_TYPE, self::OIDC_SUBJECT_TOKEN_TYPE1, self::OIDC_SUBJECT_TOKEN_TYPE2]; + if (!isset($executableResponse['token_type'])) { + throw new ExecutableResponseError( + 'Executable response must contain a "token_type" field when successful' + ); + } + if (!in_array($executableResponse['token_type'], $tokenTypes)) { + throw new ExecutableResponseError(sprintf( + 'Executable response "token_type" field must be one of %s.', + implode(', ', $tokenTypes) + )); + } + + // Validate subject token for SAML and OIDC. + if ($executableResponse['token_type'] === self::SAML_SUBJECT_TOKEN_TYPE) { + if (empty($executableResponse['saml_response'])) { + throw new ExecutableResponseError(sprintf( + 'Executable response must contain a "saml_response" field when token_type=%s.', + self::SAML_SUBJECT_TOKEN_TYPE + )); + } + } elseif (empty($executableResponse['id_token'])) { + throw new ExecutableResponseError(sprintf( + 'Executable response must contain a "id_token" field when ' + . 'token_type=%s.', + $executableResponse['token_type'] + )); + } + + // Validate expiration exists when an output file is specified. + if ($this->outputFile) { + if (!isset($executableResponse['expiration_time'])) { + throw new ExecutableResponseError( + 'The executable response must contain a "expiration_time" field for successful responses ' . + 'when an output_file has been specified in the configuration.' + ); + } + } + } else { + // Both code and message must be provided for unsuccessful responses. + if (!array_key_exists('code', $executableResponse)) { + throw new ExecutableResponseError('Executable response must contain a "code" field when unsuccessful.'); + } + if (empty($executableResponse['message'])) { + throw new ExecutableResponseError('Executable response must contain a "message" field when unsuccessful.'); + } + } + + return $executableResponse; + } +} diff --git a/vendor/google/auth/src/CredentialSource/FileSource.php b/vendor/google/auth/src/CredentialSource/FileSource.php new file mode 100644 index 0000000..2e79119 --- /dev/null +++ b/vendor/google/auth/src/CredentialSource/FileSource.php @@ -0,0 +1,87 @@ +file = $file; + + if ($format === 'json' && is_null($subjectTokenFieldName)) { + throw new InvalidArgumentException( + 'subject_token_field_name must be set when format is JSON' + ); + } + + $this->format = $format; + $this->subjectTokenFieldName = $subjectTokenFieldName; + } + + public function fetchSubjectToken(?callable $httpHandler = null): string + { + $contents = file_get_contents($this->file); + if ($this->format === 'json') { + if (!$json = json_decode((string) $contents, true)) { + throw new UnexpectedValueException( + 'Unable to decode JSON file' + ); + } + if (!isset($json[$this->subjectTokenFieldName])) { + throw new UnexpectedValueException( + 'subject_token_field_name not found in JSON file' + ); + } + $contents = $json[$this->subjectTokenFieldName]; + } + + return $contents; + } + + /** + * Gets the unique key for caching. + * The format for the cache key one of the following: + * Filename + * + * @return string + */ + public function getCacheKey(): ?string + { + return $this->file; + } +} diff --git a/vendor/google/auth/src/CredentialSource/UrlSource.php b/vendor/google/auth/src/CredentialSource/UrlSource.php new file mode 100644 index 0000000..d2f875e --- /dev/null +++ b/vendor/google/auth/src/CredentialSource/UrlSource.php @@ -0,0 +1,109 @@ + + */ + private ?array $headers; + + /** + * @param string $url The URL to fetch the subject token from. + * @param string|null $format The format of the token in the response. Can be null or "json". + * @param string|null $subjectTokenFieldName The name of the field containing the token in the response. This is required + * when format is "json". + * @param array|null $headers Request headers to send in with the request to the URL. + */ + public function __construct( + string $url, + ?string $format = null, + ?string $subjectTokenFieldName = null, + ?array $headers = null + ) { + $this->url = $url; + + if ($format === 'json' && is_null($subjectTokenFieldName)) { + throw new InvalidArgumentException( + 'subject_token_field_name must be set when format is JSON' + ); + } + + $this->format = $format; + $this->subjectTokenFieldName = $subjectTokenFieldName; + $this->headers = $headers; + } + + public function fetchSubjectToken(?callable $httpHandler = null): string + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $request = new Request( + 'GET', + $this->url, + $this->headers ?: [] + ); + + $response = $httpHandler($request); + $body = (string) $response->getBody(); + if ($this->format === 'json') { + if (!$json = json_decode((string) $body, true)) { + throw new UnexpectedValueException( + 'Unable to decode JSON response' + ); + } + if (!isset($json[$this->subjectTokenFieldName])) { + throw new UnexpectedValueException( + 'subject_token_field_name not found in JSON file' + ); + } + $body = $json[$this->subjectTokenFieldName]; + } + + return $body; + } + + /** + * Get the cache key for the credentials. + * The format for the cache key is: + * URL + * + * @return ?string + */ + public function getCacheKey(): ?string + { + return $this->url; + } +} diff --git a/vendor/google/auth/src/Credentials/AppIdentityCredentials.php b/vendor/google/auth/src/Credentials/AppIdentityCredentials.php new file mode 100644 index 0000000..5e4cfa5 --- /dev/null +++ b/vendor/google/auth/src/Credentials/AppIdentityCredentials.php @@ -0,0 +1,238 @@ +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, + ProjectIdProviderInterface +{ + /** + * Result of fetchAuthToken. + * + * @var array + */ + protected $lastReceivedToken; + + /** + * Array of OAuth2 scopes to be requested. + * + * @var string[] + */ + private $scope; + + /** + * @var string + */ + private $clientName; + + /** + * @param string|string[] $scope One or more scopes. + */ + public function __construct($scope = []) + { + $this->scope = is_array($scope) ? $scope : explode(' ', (string) $scope); + } + + /** + * Determines if this an App Engine instance, by accessing the + * SERVER_SOFTWARE environment variable (prod) or the APPENGINE_RUNTIME + * environment variable (dev). + * + * @return bool 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|null $httpHandler callback which delivers psr7 request + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type string $expiration_time + * } + */ + public function fetchAuthToken(?callable $httpHandler = null) + { + try { + $this->checkAppEngineContext(); + } catch (\Exception $e) { + return []; + } + + /** @phpstan-ignore-next-line */ + $token = AppIdentityService::getAccessToken($this->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(); + + /** @phpstan-ignore-next-line */ + return base64_encode(AppIdentityService::signForApp($stringToSign)['signature']); + } + + /** + * Get the project ID from AppIdentityService. + * + * Returns null if AppIdentityService is unavailable. + * + * @param callable|null $httpHandler Not used by this type. + * @return string|null + */ + public function getProjectId(?callable $httpHandler = null) + { + try { + $this->checkAppEngineContext(); + } catch (\Exception $e) { + return null; + } + + /** @phpstan-ignore-next-line */ + return AppIdentityService::getApplicationId(); + } + + /** + * Get the client name from AppIdentityService. + * + * Subsequent calls to this method will return a cached value. + * + * @param callable|null $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) { + /** @phpstan-ignore-next-line */ + $this->clientName = AppIdentityService::getServiceAccountName(); + } + + return $this->clientName; + } + + /** + * @return array{access_token:string,expires_at:int}|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 ''; + } + + /** + * @return void + */ + 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' + ); + } + } +} diff --git a/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php b/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php new file mode 100644 index 0000000..afaf1ee --- /dev/null +++ b/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php @@ -0,0 +1,394 @@ + */ + private ?array $lastImpersonatedAccessToken; + private string $universeDomain; + + /** + * @param string|string[] $scope The scope of the access request, expressed either as an array + * or as a space-delimited string. + * @param array $jsonKey JSON credentials as an associative array. + */ + public function __construct( + $scope, + array $jsonKey + ) { + if (!array_key_exists('type', $jsonKey)) { + throw new InvalidArgumentException('json key is missing the type field'); + } + if ($jsonKey['type'] !== self::EXTERNAL_ACCOUNT_TYPE) { + throw new InvalidArgumentException(sprintf( + 'expected "%s" type but received "%s"', + self::EXTERNAL_ACCOUNT_TYPE, + $jsonKey['type'] + )); + } + + if (!array_key_exists('token_url', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the token_url field' + ); + } + + if (!array_key_exists('audience', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the audience field' + ); + } + + if (!array_key_exists('subject_token_type', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the subject_token_type field' + ); + } + + if (!array_key_exists('credential_source', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the credential_source field' + ); + } + + $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url'] ?? null; + + $this->quotaProject = $jsonKey['quota_project_id'] ?? null; + $this->workforcePoolUserProject = $jsonKey['workforce_pool_user_project'] ?? null; + $this->universeDomain = $jsonKey['universe_domain'] ?? GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN; + + $this->auth = new OAuth2([ + 'tokenCredentialUri' => $jsonKey['token_url'], + 'audience' => $jsonKey['audience'], + 'scope' => $scope, + 'subjectTokenType' => $jsonKey['subject_token_type'], + 'subjectTokenFetcher' => self::buildCredentialSource($jsonKey), + 'additionalOptions' => $this->workforcePoolUserProject + ? ['userProject' => $this->workforcePoolUserProject] + : [], + ]); + + if (!$this->isWorkforcePool() && $this->workforcePoolUserProject) { + throw new InvalidArgumentException( + 'workforce_pool_user_project should not be set for non-workforce pool credentials.' + ); + } + } + + /** + * @param array $jsonKey + */ + private static function buildCredentialSource(array $jsonKey): ExternalAccountCredentialSourceInterface + { + $credentialSource = $jsonKey['credential_source']; + if (isset($credentialSource['file'])) { + return new FileSource( + $credentialSource['file'], + $credentialSource['format']['type'] ?? null, + $credentialSource['format']['subject_token_field_name'] ?? null + ); + } + + if ( + isset($credentialSource['environment_id']) + && 1 === preg_match('/^aws(\d+)$/', $credentialSource['environment_id'], $matches) + ) { + if ($matches[1] !== '1') { + throw new InvalidArgumentException( + "aws version \"$matches[1]\" is not supported in the current build." + ); + } + if (!array_key_exists('regional_cred_verification_url', $credentialSource)) { + throw new InvalidArgumentException( + 'The regional_cred_verification_url field is required for aws1 credential source.' + ); + } + + return new AwsNativeSource( + $jsonKey['audience'], + $credentialSource['regional_cred_verification_url'], // $regionalCredVerificationUrl + $credentialSource['region_url'] ?? null, // $regionUrl + $credentialSource['url'] ?? null, // $securityCredentialsUrl + $credentialSource['imdsv2_session_token_url'] ?? null, // $imdsV2TokenUrl + ); + } + + if (isset($credentialSource['url'])) { + return new UrlSource( + $credentialSource['url'], + $credentialSource['format']['type'] ?? null, + $credentialSource['format']['subject_token_field_name'] ?? null, + $credentialSource['headers'] ?? null, + ); + } + + if (isset($credentialSource['executable'])) { + if (!array_key_exists('command', $credentialSource['executable'])) { + throw new InvalidArgumentException( + 'executable source requires a command to be set in the JSON file.' + ); + } + + // Build command environment variables + $env = [ + 'GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE' => $jsonKey['audience'], + 'GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE' => $jsonKey['subject_token_type'], + // Always set to 0 because interactive mode is not supported. + 'GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE' => '0', + ]; + + if ($outputFile = $credentialSource['executable']['output_file'] ?? null) { + $env['GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE'] = $outputFile; + } + + if ($serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url'] ?? null) { + // Parse email from URL. The formal looks as follows: + // https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/name@project-id.iam.gserviceaccount.com:generateAccessToken + $regex = '/serviceAccounts\/(?[^:]+):generateAccessToken$/'; + if (preg_match($regex, $serviceAccountImpersonationUrl, $matches)) { + $env['GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL'] = $matches['email']; + } + } + + $timeoutMs = $credentialSource['executable']['timeout_millis'] ?? null; + + return new ExecutableSource( + $credentialSource['executable']['command'], + $outputFile, + $timeoutMs ? new ExecutableHandler($env, $timeoutMs) : new ExecutableHandler($env) + ); + } + + throw new InvalidArgumentException('Unable to determine credential source from json key.'); + } + + /** + * @param string $stsToken + * @param callable|null $httpHandler + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_at + * } + */ + private function getImpersonatedAccessToken(string $stsToken, ?callable $httpHandler = null): array + { + if (!isset($this->serviceAccountImpersonationUrl)) { + throw new InvalidArgumentException( + 'service_account_impersonation_url must be set in JSON credentials.' + ); + } + $request = new Request( + 'POST', + $this->serviceAccountImpersonationUrl, + [ + 'Content-Type' => 'application/json', + 'Authorization' => 'Bearer ' . $stsToken, + ], + (string) json_encode([ + 'lifetime' => sprintf('%ss', OAuth2::DEFAULT_EXPIRY_SECONDS), + 'scope' => explode(' ', $this->auth->getScope()), + ]), + ); + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + $response = $httpHandler($request); + $body = json_decode((string) $response->getBody(), true); + return [ + 'access_token' => $body['accessToken'], + 'expires_at' => strtotime($body['expireTime']), + ]; + } + + /** + * @param callable|null $httpHandler + * @param array $headers [optional] Metrics headers to be inserted + * into the token endpoint request present. + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_at (impersonated service accounts only) + * @type int $expires_in (identity pool only) + * @type string $issued_token_type (identity pool only) + * @type string $token_type (identity pool only) + * } + */ + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + { + $stsToken = $this->auth->fetchAuthToken($httpHandler, $headers); + + if (isset($this->serviceAccountImpersonationUrl)) { + return $this->lastImpersonatedAccessToken = $this->getImpersonatedAccessToken( + $stsToken['access_token'], + $httpHandler + ); + } + + return $stsToken; + } + + /** + * Get the cache token key for the credentials. + * The cache token key format depends on the type of source + * The format for the cache key one of the following: + * FetcherCacheKey.Scope.[ServiceAccount].[TokenType].[WorkforcePoolUserProject] + * FetcherCacheKey.Audience.[ServiceAccount].[TokenType].[WorkforcePoolUserProject] + * + * @return ?string; + */ + public function getCacheKey(): ?string + { + $scopeOrAudience = $this->auth->getAudience(); + if (!$scopeOrAudience) { + $scopeOrAudience = $this->auth->getScope(); + } + + return $this->auth->getSubjectTokenFetcher()->getCacheKey() . + '.' . $scopeOrAudience . + '.' . ($this->serviceAccountImpersonationUrl ?? '') . + '.' . ($this->auth->getSubjectTokenType() ?? '') . + '.' . ($this->workforcePoolUserProject ?? ''); + } + + public function getLastReceivedToken() + { + return $this->lastImpersonatedAccessToken ?? $this->auth->getLastReceivedToken(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + /** + * Get the universe domain used for this API request + * + * @return string + */ + public function getUniverseDomain(): string + { + return $this->universeDomain; + } + + /** + * Get the project ID. + * + * @param callable|null $httpHandler Callback which delivers psr7 request + * @param string|null $accessToken The access token to use to sign the blob. If + * provided, saves a call to the metadata server for a new access + * token. **Defaults to** `null`. + * @return string|null + */ + public function getProjectId(?callable $httpHandler = null, ?string $accessToken = null) + { + if (isset($this->projectId)) { + return $this->projectId; + } + + $projectNumber = $this->getProjectNumber() ?: $this->workforcePoolUserProject; + if (!$projectNumber) { + return null; + } + + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $url = str_replace( + 'UNIVERSE_DOMAIN', + $this->getUniverseDomain(), + sprintf(self::CLOUD_RESOURCE_MANAGER_URL, $projectNumber) + ); + + if (is_null($accessToken)) { + $accessToken = $this->fetchAuthToken($httpHandler)['access_token']; + } + + $request = new Request('GET', $url, ['authorization' => 'Bearer ' . $accessToken]); + $response = $httpHandler($request); + + $body = json_decode((string) $response->getBody(), true); + return $this->projectId = $body['projectId']; + } + + private function getProjectNumber(): ?string + { + $parts = explode('/', $this->auth->getAudience()); + $i = array_search('projects', $parts); + return $parts[$i + 1] ?? null; + } + + private function isWorkforcePool(): bool + { + $regex = '#//iam\.googleapis\.com/locations/[^/]+/workforcePools/#'; + return preg_match($regex, $this->auth->getAudience()) === 1; + } +} diff --git a/vendor/google/auth/src/Credentials/GCECredentials.php b/vendor/google/auth/src/Credentials/GCECredentials.php new file mode 100644 index 0000000..ab6753b --- /dev/null +++ b/vendor/google/auth/src/Credentials/GCECredentials.php @@ -0,0 +1,685 @@ +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, + ProjectIdProviderInterface, + GetQuotaProjectInterface +{ + use IamSignerTrait; + + // phpcs:disable + const cacheKey = 'GOOGLE_AUTH_PHP_GCE'; + // phpcs:enable + + /** + * 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 default id token. + */ + const ID_TOKEN_URI_PATH = 'v1/instance/service-accounts/default/identity'; + + /** + * The metadata path of the client ID. + */ + const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email'; + + /** + * The metadata path of the project ID. + */ + const PROJECT_ID_URI_PATH = 'v1/project/project-id'; + + /** + * The metadata path of the project ID. + */ + const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe-domain'; + + /** + * The header whose presence indicates GCE presence. + */ + const FLAVOR_HEADER = 'Metadata-Flavor'; + + /** + * The Linux file which contains the product name. + */ + private const GKE_PRODUCT_NAME_FILE = '/sys/class/dmi/id/product_name'; + + /** + * The Windows Registry key path to the product name + */ + private const WINDOWS_REGISTRY_KEY_PATH = 'HKEY_LOCAL_MACHINE\\SYSTEM\\HardwareConfig\\Current\\'; + + /** + * The Windows registry key name for the product name + */ + private const WINDOWS_REGISTRY_KEY_NAME = 'SystemProductName'; + + /** + * The Name of the product expected from the windows registry + */ + private const PRODUCT_NAME = 'Google'; + + private const CRED_TYPE = 'mds'; + + /** + * 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. + * + * @var array + */ + protected $lastReceivedToken; + + /** + * @var string|null + */ + private $clientName; + + /** + * @var string|null + */ + private $projectId; + + /** + * @var string + */ + private $tokenUri; + + /** + * @var string + */ + private $targetAudience; + + /** + * @var string|null + */ + private $quotaProject; + + /** + * @var string|null + */ + private $serviceAccountIdentity; + + /** + * @var string + */ + private ?string $universeDomain; + + /** + * @param Iam|null $iam [optional] An IAM instance. + * @param string|string[] $scope [optional] the scope of the access request, + * expressed either as an array or as a space-delimited string. + * @param string $targetAudience [optional] The audience for the ID token. + * @param string $quotaProject [optional] Specifies a project to bill for access + * charges associated with the request. + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @param string|null $universeDomain [optional] Specify a universe domain to use + * instead of fetching one from the metadata server. + */ + public function __construct( + ?Iam $iam = null, + $scope = null, + $targetAudience = null, + $quotaProject = null, + $serviceAccountIdentity = null, + ?string $universeDomain = null + ) { + $this->iam = $iam; + + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + + $tokenUri = self::getTokenUri($serviceAccountIdentity); + if ($scope) { + if (is_string($scope)) { + $scope = explode(' ', $scope); + } + + $scope = implode(',', $scope); + + $tokenUri = $tokenUri . '?scopes=' . $scope; + } elseif ($targetAudience) { + $tokenUri = self::getIdTokenUri($serviceAccountIdentity); + $tokenUri = $tokenUri . '?audience=' . $targetAudience; + $this->targetAudience = $targetAudience; + } + + $this->tokenUri = $tokenUri; + $this->quotaProject = $quotaProject; + $this->serviceAccountIdentity = $serviceAccountIdentity; + $this->universeDomain = $universeDomain; + } + + /** + * The full uri for accessing the default token. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + public static function getTokenUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::TOKEN_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + return $base; + } + + /** + * The full uri for accessing the default service account. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + public static function getClientNameUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::CLIENT_ID_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + + return $base; + } + + /** + * The full uri for accesesing the default identity token. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + private static function getIdTokenUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::ID_TOKEN_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + + return $base; + } + + /** + * The full uri for accessing the default project ID. + * + * @return string + */ + private static function getProjectIdUri() + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + + return $base . self::PROJECT_ID_URI_PATH; + } + + /** + * The full uri for accessing the default universe domain. + * + * @return string + */ + private static function getUniverseDomainUri() + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + + return $base . self::UNIVERSE_DOMAIN_URI_PATH; + } + + /** + * Determines if this an App Engine Flexible instance, by accessing the + * GAE_INSTANCE environment variable. + * + * @return bool true if this an App Engine Flexible Instance, false otherwise + */ + public static function onAppEngineFlexible() + { + return substr((string) 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|null $httpHandler callback which delivers psr7 request + * @return bool 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', + self::$metricMetadataKey => self::getMetricsHeader('', 'mds') + ] + ), + ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S] + ); + + return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google'; + } catch (ClientException $e) { + } catch (ServerException $e) { + } catch (RequestException $e) { + } catch (ConnectException $e) { + } + } + + if (PHP_OS === 'Windows' || PHP_OS === 'WINNT') { + return self::detectResidencyWindows( + self::WINDOWS_REGISTRY_KEY_PATH . self::WINDOWS_REGISTRY_KEY_NAME + ); + } + + // Detect GCE residency on Linux + return self::detectResidencyLinux(self::GKE_PRODUCT_NAME_FILE); + } + + private static function detectResidencyLinux(string $productNameFile): bool + { + if (file_exists($productNameFile)) { + $productName = trim((string) file_get_contents($productNameFile)); + return 0 === strpos($productName, self::PRODUCT_NAME); + } + return false; + } + + private static function detectResidencyWindows(string $registryProductKey): bool + { + if (!class_exists(COM::class)) { + // the COM extension must be installed and enabled to detect Windows residency + // see https://www.php.net/manual/en/book.com.php + return false; + } + + $shell = new COM('WScript.Shell'); + $productName = null; + + try { + $productName = $shell->regRead($registryProductKey); + } catch (com_exception) { + // This means that we tried to read a key that doesn't exist on the registry + // which might mean that it is a windows instance that is not on GCE + return false; + } + + return 0 === strpos($productName, self::PRODUCT_NAME); + } + + /** + * 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|null $httpHandler callback which delivers psr7 request + * @param array $headers [optional] Headers to be inserted + * into the token endpoint request present. + * + * @return array { + * A set of auth related metadata, based on the token type. + * + * @type string $access_token for access tokens + * @type int $expires_in for access tokens + * @type string $token_type for access tokens + * @type string $id_token for ID tokens + * } + * @throws \Exception + */ + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + { + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + if (!$this->isOnGce) { + return []; // return an empty array with no access token + } + + $response = $this->getFromMetadata( + $httpHandler, + $this->tokenUri, + $this->applyTokenEndpointMetrics($headers, $this->targetAudience ? 'it' : 'at') + ); + + if ($this->targetAudience) { + return $this->lastReceivedToken = ['id_token' => $response]; + } + + if (null === $json = json_decode($response, true)) { + throw new \Exception('Invalid JSON response'); + } + + $json['expires_at'] = time() + $json['expires_in']; + + // store this so we can retrieve it later + $this->lastReceivedToken = $json; + + return $json; + } + + /** + * Returns the Cache Key for the credential token. + * The format for the cache key is: + * TokenURI + * + * @return string + */ + public function getCacheKey() + { + return $this->tokenUri; + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + if ($this->lastReceivedToken) { + if (array_key_exists('id_token', $this->lastReceivedToken)) { + return $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|null $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($this->serviceAccountIdentity) + ); + + return $this->clientName; + } + + /** + * Fetch the default Project ID from compute engine. + * + * Returns null if called outside GCE. + * + * @param callable|null $httpHandler Callback which delivers psr7 request + * @return string|null + */ + public function getProjectId(?callable $httpHandler = null) + { + if ($this->projectId) { + return $this->projectId; + } + + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + + if (!$this->isOnGce) { + return null; + } + + $this->projectId = $this->getFromMetadata($httpHandler, self::getProjectIdUri()); + return $this->projectId; + } + + /** + * Fetch the default universe domain from the metadata server. + * + * @param callable|null $httpHandler Callback which delivers psr7 request + * @return string + */ + public function getUniverseDomain(?callable $httpHandler = null): string + { + if (null !== $this->universeDomain) { + return $this->universeDomain; + } + + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + + try { + $this->universeDomain = $this->getFromMetadata( + $httpHandler, + self::getUniverseDomainUri() + ); + } catch (ClientException $e) { + // If the metadata server exists, but returns a 404 for the universe domain, the auth + // libraries should safely assume this is an older metadata server running in GCU, and + // should return the default universe domain. + if (!$e->hasResponse() || 404 != $e->getResponse()->getStatusCode()) { + throw $e; + } + $this->universeDomain = self::DEFAULT_UNIVERSE_DOMAIN; + } + + // We expect in some cases the metadata server will return an empty string for the universe + // domain. In this case, the auth library MUST return the default universe domain. + if ('' === $this->universeDomain) { + $this->universeDomain = self::DEFAULT_UNIVERSE_DOMAIN; + } + + return $this->universeDomain; + } + + /** + * 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. + * @param array $headers [optional] If present, add these headers to the token + * endpoint request. + * + * @return string + */ + private function getFromMetadata(callable $httpHandler, $uri, array $headers = []) + { + $resp = $httpHandler( + new Request( + 'GET', + $uri, + [self::FLAVOR_HEADER => 'Google'] + $headers + ) + ); + + return (string) $resp->getBody(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + /** + * Set whether or not we've already checked the GCE environment. + * + * @param bool $isOnGce + * + * @return void + */ + public function setIsOnGce($isOnGce) + { + // Implicitly set hasCheckedGce to true + $this->hasCheckedOnGce = true; + + // Set isOnGce + $this->isOnGce = $isOnGce; + } + + protected function getCredType(): string + { + return self::CRED_TYPE; + } +} diff --git a/vendor/google/auth/src/Credentials/IAMCredentials.php b/vendor/google/auth/src/Credentials/IAMCredentials.php new file mode 100644 index 0000000..96d1df7 --- /dev/null +++ b/vendor/google/auth/src/Credentials/IAMCredentials.php @@ -0,0 +1,91 @@ +selector = $selector; + $this->token = $token; + } + + /** + * export a callback function which updates runtime metadata. + * + * @return callable updateMetadata function + */ + public function getUpdateMetadataFunc() + { + return [$this, 'updateMetadata']; + } + + /** + * Updates metadata with the appropriate header metadata. + * + * @param array $metadata metadata hashmap + * @param string $unusedAuthUri optional auth uri + * @param callable|null $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; + } +} diff --git a/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php b/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php new file mode 100644 index 0000000..f473f8e --- /dev/null +++ b/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php @@ -0,0 +1,295 @@ + $jsonKey JSON credential file path or JSON array credentials { + * JSON credentials as an associative array. + * + * @type string $service_account_impersonation_url The URL to the service account + * @type string|FetchAuthTokenInterface $source_credentials The source credentials to impersonate + * @type int $lifetime The lifetime of the impersonated credentials + * @type string[] $delegates The delegates to impersonate + * } + * @param string|null $targetAudience The audience to request an ID token. + */ + public function __construct( + string|array|null $scope, + string|array $jsonKey, + private ?string $targetAudience = null + ) { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new InvalidArgumentException('file does not exist'); + } + $json = file_get_contents($jsonKey); + if (!$jsonKey = json_decode((string) $json, true)) { + throw new LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('service_account_impersonation_url', $jsonKey)) { + throw new LogicException( + 'json key is missing the service_account_impersonation_url field' + ); + } + if (!array_key_exists('source_credentials', $jsonKey)) { + throw new LogicException('json key is missing the source_credentials field'); + } + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + if (is_array($jsonKey['source_credentials'])) { + if (!array_key_exists('type', $jsonKey['source_credentials'])) { + throw new InvalidArgumentException('json key source credentials are missing the type field'); + } + if ( + $targetAudience !== null + && $jsonKey['source_credentials']['type'] === 'service_account' + ) { + // Service account tokens MUST request a scope, and as this token is only used to impersonate + // an ID token, the narrowest scope we can request is `iam`. + $scope = self::IAM_SCOPE; + } + $jsonKey['source_credentials'] = match ($jsonKey['source_credentials']['type'] ?? null) { + // Do not pass $defaultScope to ServiceAccountCredentials + 'service_account' => new ServiceAccountCredentials($scope, $jsonKey['source_credentials']), + 'authorized_user' => new UserRefreshCredentials($scope, $jsonKey['source_credentials']), + 'external_account' => new ExternalAccountCredentials($scope, $jsonKey['source_credentials']), + default => throw new \InvalidArgumentException('invalid value in the type field'), + }; + } + + $this->targetScope = $scope ?? []; + $this->lifetime = $jsonKey['lifetime'] ?? 3600; + $this->delegates = $jsonKey['delegates'] ?? []; + + $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url']; + $this->impersonatedServiceAccountName = $this->getImpersonatedServiceAccountNameFromUrl( + $this->serviceAccountImpersonationUrl + ); + + $this->sourceCredentials = $jsonKey['source_credentials']; + } + + /** + * Helper function for extracting the Server Account Name from the URL saved in the account + * credentials file. + * + * @param $serviceAccountImpersonationUrl string URL from "service_account_impersonation_url" + * @return string Service account email or ID. + */ + private function getImpersonatedServiceAccountNameFromUrl( + string $serviceAccountImpersonationUrl + ): string { + $fields = explode('/', $serviceAccountImpersonationUrl); + $lastField = end($fields); + $splitter = explode(':', $lastField); + return $splitter[0]; + } + + /** + * Get the client name from the keyfile + * + * In this implementation, it will return the issuers email from the oauth token. + * + * @param callable|null $unusedHttpHandler not used by this credentials type. + * @return string Token issuer email + */ + public function getClientName(?callable $unusedHttpHandler = null) + { + return $this->impersonatedServiceAccountName; + } + + /** + * @param callable|null $httpHandler + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_in + * @type string $scope + * @type string $token_type + * @type string $id_token + * } + */ + public function fetchAuthToken(?callable $httpHandler = null) + { + $httpHandler = $httpHandler ?? HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + // The FetchAuthTokenInterface technically does not have a "headers" argument, but all of + // the implementations do. Additionally, passing in more parameters than the function has + // defined is allowed in PHP. So we'll just ignore the phpstan error here. + // @phpstan-ignore-next-line + $authToken = $this->sourceCredentials->fetchAuthToken( + $httpHandler, + $this->applyTokenEndpointMetrics([], 'at') + ); + + $headers = $this->applyTokenEndpointMetrics([ + 'Content-Type' => 'application/json', + 'Cache-Control' => 'no-store', + 'Authorization' => sprintf('Bearer %s', $authToken['access_token'] ?? $authToken['id_token']), + ], $this->isIdTokenRequest() ? 'it' : 'at'); + + $body = match ($this->isIdTokenRequest()) { + true => [ + 'audience' => $this->targetAudience, + 'includeEmail' => true, + ], + false => [ + 'scope' => $this->targetScope, + 'delegates' => $this->delegates, + 'lifetime' => sprintf('%ss', $this->lifetime), + ] + }; + + $url = $this->serviceAccountImpersonationUrl; + if ($this->isIdTokenRequest()) { + $regex = '/serviceAccounts\/(?[^:]+):generateAccessToken$/'; + if (!preg_match($regex, $url, $matches)) { + throw new InvalidArgumentException( + 'Invalid service account impersonation URL - unable to parse service account email' + ); + } + $url = str_replace( + 'UNIVERSE_DOMAIN', + $this->getUniverseDomain(), + sprintf(self::ID_TOKEN_IMPERSONATION_URL, $matches['email']) + ); + } + + $request = new Request( + 'POST', + $url, + $headers, + (string) json_encode($body) + ); + + $response = $httpHandler($request); + $body = json_decode((string) $response->getBody(), true); + + return match ($this->isIdTokenRequest()) { + true => ['id_token' => $body['token']], + false => [ + 'access_token' => $body['accessToken'], + 'expires_at' => strtotime($body['expireTime']), + ] + }; + } + + /** + * Returns the Cache Key for the credentials + * The cache key is the same as the UserRefreshCredentials class + * + * @return string + */ + public function getCacheKey() + { + return $this->getFullCacheKey( + $this->serviceAccountImpersonationUrl . $this->sourceCredentials->getCacheKey() + ); + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->sourceCredentials->getLastReceivedToken(); + } + + protected function getCredType(): string + { + return self::CRED_TYPE; + } + + private function isIdTokenRequest(): bool + { + return !is_null($this->targetAudience); + } + + public function getUniverseDomain(): string + { + return $this->sourceCredentials instanceof GetUniverseDomainInterface + ? $this->sourceCredentials->getUniverseDomain() + : self::DEFAULT_UNIVERSE_DOMAIN; + } +} diff --git a/vendor/google/auth/src/Credentials/InsecureCredentials.php b/vendor/google/auth/src/Credentials/InsecureCredentials.php new file mode 100644 index 0000000..5a2bef1 --- /dev/null +++ b/vendor/google/auth/src/Credentials/InsecureCredentials.php @@ -0,0 +1,68 @@ + '' + ]; + + /** + * Fetches the auth token. In this case it returns an empty string. + * + * @param callable|null $httpHandler + * @return array{access_token:string} A set of auth related metadata + */ + public function fetchAuthToken(?callable $httpHandler = null) + { + return $this->token; + } + + /** + * Returns the cache key. In this case it returns a null value, disabling + * caching. + * + * @return string|null + */ + public function getCacheKey() + { + return null; + } + + /** + * Fetches the last received token. In this case, it returns the same empty string + * auth token. + * + * @return array{access_token:string} + */ + public function getLastReceivedToken() + { + return $this->token; + } +} diff --git a/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php b/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php new file mode 100644 index 0000000..3d23f71 --- /dev/null +++ b/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php @@ -0,0 +1,457 @@ +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 ServiceAccountCredentials extends CredentialsLoader implements + GetQuotaProjectInterface, + SignBlobInterface, + ProjectIdProviderInterface +{ + use ServiceAccountSignerTrait; + + /** + * Used in observability metric headers + * + * @var string + */ + private const CRED_TYPE = 'sa'; + private const IAM_SCOPE = 'https://www.googleapis.com/auth/iam'; + + /** + * The OAuth2 instance used to conduct authorization. + * + * @var OAuth2 + */ + protected $auth; + + /** + * The quota project associated with the JSON credentials + * + * @var string + */ + protected $quotaProject; + + /** + * @var string|null + */ + protected $projectId; + + /** + * @var array|null + */ + private $lastReceivedJwtAccessToken; + + /** + * @var bool + */ + private $useJwtAccessWithScope = false; + + /** + * @var ServiceAccountJwtAccessCredentials|null + */ + private $jwtAccessCredentials; + + /** + * @var string + */ + private string $universeDomain; + + /** + * Whether this is an ID token request or an access token request. Used when + * building the metric header. + */ + private bool $isIdTokenRequest = false; + + /** + * Create a new ServiceAccountCredentials. + * + * @param string|string[]|null $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param string|array $jsonKey JSON credential file path or JSON credentials + * as an associative array + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + * @param string $targetAudience The audience for the ID token. + */ + public function __construct( + $scope, + $jsonKey, + $sub = null, + $targetAudience = null + ) { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new \InvalidArgumentException('file does not exist'); + } + $jsonKeyStream = file_get_contents($jsonKey); + if (!$jsonKey = json_decode((string) $jsonKeyStream, true)) { + throw new \LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('client_email', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the client_email field' + ); + } + if (!array_key_exists('private_key', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the private_key field' + ); + } + if (array_key_exists('quota_project_id', $jsonKey)) { + $this->quotaProject = (string) $jsonKey['quota_project_id']; + } + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + $additionalClaims = []; + if ($targetAudience) { + $additionalClaims = ['target_audience' => $targetAudience]; + $this->isIdTokenRequest = true; + } + $this->auth = new OAuth2([ + 'audience' => self::TOKEN_CREDENTIAL_URI, + 'issuer' => $jsonKey['client_email'], + 'scope' => $scope, + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + 'signingKeyId' => $jsonKey['private_key_id'] ?? null, + 'sub' => $sub, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + 'additionalClaims' => $additionalClaims, + ]); + + $this->projectId = $jsonKey['project_id'] ?? null; + $this->universeDomain = $jsonKey['universe_domain'] ?? self::DEFAULT_UNIVERSE_DOMAIN; + } + + /** + * When called, the ServiceAccountCredentials will use an instance of + * ServiceAccountJwtAccessCredentials to fetch (self-sign) an access token + * even when only scopes are supplied. Otherwise, + * ServiceAccountJwtAccessCredentials is only called when no scopes and an + * authUrl (audience) is suppled. + * + * @return void + */ + public function useJwtAccessWithScope() + { + $this->useJwtAccessWithScope = true; + } + + /** + * @param callable|null $httpHandler + * @param array $headers [optional] Headers to be inserted + * into the token endpoint request present. + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_in + * @type string $token_type + * } + */ + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + { + if ($this->useSelfSignedJwt()) { + $jwtCreds = $this->createJwtAccessCredentials(); + + $accessToken = $jwtCreds->fetchAuthToken($httpHandler); + + if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { + // Keep self-signed JWTs in memory as the last received token + $this->lastReceivedJwtAccessToken = $lastReceivedToken; + } + + return $accessToken; + } + + if ($this->isIdTokenRequest && $this->getUniverseDomain() !== self::DEFAULT_UNIVERSE_DOMAIN) { + $now = time(); + $jwt = Jwt::encode( + [ + 'iss' => $this->auth->getIssuer(), + 'sub' => $this->auth->getIssuer(), + 'scope' => self::IAM_SCOPE, + 'exp' => ($now + $this->auth->getExpiry()), + 'iat' => ($now - OAuth2::DEFAULT_SKEW_SECONDS), + ], + $this->auth->getSigningKey(), + $this->auth->getSigningAlgorithm(), + $this->auth->getSigningKeyId() + ); + // We create a new instance of Iam each time because the `$httpHandler` might change. + $idToken = (new Iam($httpHandler, $this->getUniverseDomain()))->generateIdToken( + $this->auth->getIssuer(), + $this->auth->getAdditionalClaims()['target_audience'], + $jwt, + $this->applyTokenEndpointMetrics($headers, 'it') + ); + return ['id_token' => $idToken]; + } + return $this->auth->fetchAuthToken( + $httpHandler, + $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at') + ); + } + + /** + * Return the Cache Key for the credentials. + * For the cache key format is one of the following: + * ClientEmail.Scope[.Sub] + * ClientEmail.Audience[.Sub] + * + * @return string + */ + public function getCacheKey() + { + $scopeOrAudience = $this->auth->getScope(); + if (!$scopeOrAudience) { + $scopeOrAudience = $this->auth->getAudience(); + } + + $key = $this->auth->getIssuer() . '.' . $scopeOrAudience; + if ($sub = $this->auth->getSub()) { + $key .= '.' . $sub; + } + + return $key; + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + // If self-signed JWTs are being used, fetch the last received token + // from memory. Else, fetch it from OAuth2 + return $this->useSelfSignedJwt() + ? $this->lastReceivedJwtAccessToken + : $this->auth->getLastReceivedToken(); + } + + /** + * Get the project ID from the service account keyfile. + * + * Returns null if the project ID does not exist in the keyfile. + * + * @param callable|null $httpHandler Not used by this credentials type. + * @return string|null + */ + public function getProjectId(?callable $httpHandler = null) + { + return $this->projectId; + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + ?callable $httpHandler = null + ) { + // scope exists. use oauth implementation + if (!$this->useSelfSignedJwt()) { + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + $jwtCreds = $this->createJwtAccessCredentials(); + if ($this->auth->getScope()) { + // Prefer user-provided "scope" to "audience" + $updatedMetadata = $jwtCreds->updateMetadata($metadata, null, $httpHandler); + } else { + $updatedMetadata = $jwtCreds->updateMetadata($metadata, $authUri, $httpHandler); + } + + if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { + // Keep self-signed JWTs in memory as the last received token + $this->lastReceivedJwtAccessToken = $lastReceivedToken; + } + + return $updatedMetadata; + } + + /** + * @return ServiceAccountJwtAccessCredentials + */ + private function createJwtAccessCredentials() + { + if (!$this->jwtAccessCredentials) { + // Create credentials for self-signing a JWT (JwtAccess) + $credJson = [ + 'private_key' => $this->auth->getSigningKey(), + 'client_email' => $this->auth->getIssuer(), + ]; + $this->jwtAccessCredentials = new ServiceAccountJwtAccessCredentials( + $credJson, + $this->auth->getScope() + ); + } + + return $this->jwtAccessCredentials; + } + + /** + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + * @return void + */ + public function setSub($sub) + { + $this->auth->setSub($sub); + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable|null $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(?callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } + + /** + * Get the private key from the keyfile. + * + * In this case, it returns the keyfile's private_key key, needed for JWT signing. + * + * @return string + */ + public function getPrivateKey() + { + return $this->auth->getSigningKey(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + /** + * Get the universe domain configured in the JSON credential. + * + * @return string + */ + public function getUniverseDomain(): string + { + return $this->universeDomain; + } + + protected function getCredType(): string + { + return self::CRED_TYPE; + } + + /** + * @return bool + */ + private function useSelfSignedJwt() + { + // When a sub is supplied, the user is using domain-wide delegation, which not available + // with self-signed JWTs + if (null !== $this->auth->getSub()) { + // If we are outside the GDU, we can't use domain-wide delegation + if ($this->getUniverseDomain() !== self::DEFAULT_UNIVERSE_DOMAIN) { + throw new \LogicException(sprintf( + 'Service Account subject is configured for the credential. Domain-wide ' . + 'delegation is not supported in universes other than %s.', + self::DEFAULT_UNIVERSE_DOMAIN + )); + } + return false; + } + + // Do not use self-signed JWT for ID tokens + if ($this->isIdTokenRequest) { + return false; + } + + // When true, ServiceAccountCredentials will always use JwtAccess for access tokens + if ($this->useJwtAccessWithScope) { + return true; + } + + // If the universe domain is outside the GDU, use JwtAccess for access tokens + if ($this->getUniverseDomain() !== self::DEFAULT_UNIVERSE_DOMAIN) { + return true; + } + + return is_null($this->auth->getScope()); + } +} diff --git a/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php b/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php new file mode 100644 index 0000000..5037376 --- /dev/null +++ b/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php @@ -0,0 +1,246 @@ + $jsonKey JSON credential file path or JSON credentials + * as an associative array + * @param string|string[] $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + */ + public function __construct($jsonKey, $scope = null) + { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new \InvalidArgumentException('file does not exist'); + } + $jsonKeyStream = file_get_contents($jsonKey); + if (!$jsonKey = json_decode((string) $jsonKeyStream, true)) { + throw new \LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('client_email', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the client_email field' + ); + } + if (!array_key_exists('private_key', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the private_key field' + ); + } + if (array_key_exists('quota_project_id', $jsonKey)) { + $this->quotaProject = (string) $jsonKey['quota_project_id']; + } + $this->auth = new OAuth2([ + 'issuer' => $jsonKey['client_email'], + 'sub' => $jsonKey['client_email'], + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + 'scope' => $scope, + ]); + + $this->projectId = $jsonKey['project_id'] ?? null; + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + ?callable $httpHandler = null + ) { + $scope = $this->auth->getScope(); + if (empty($authUri) && empty($scope)) { + return $metadata; + } + + $this->auth->setAudience($authUri); + + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * @param callable|null $httpHandler + * + * @return null|array{access_token:string} A set of auth related metadata + */ + public function fetchAuthToken(?callable $httpHandler = null) + { + $audience = $this->auth->getAudience(); + $scope = $this->auth->getScope(); + if (empty($audience) && empty($scope)) { + return null; + } + + if (!empty($audience) && !empty($scope)) { + throw new \UnexpectedValueException( + 'Cannot sign both audience and scope in JwtAccess' + ); + } + + $access_token = $this->auth->toJwt(); + + // Set the self-signed access token in OAuth2 for getLastReceivedToken + $this->auth->setAccessToken($access_token); + + return [ + 'access_token' => $access_token, + 'expires_in' => $this->auth->getExpiry(), + 'token_type' => 'Bearer' + ]; + } + + /** + * Return the cache key for the credentials. + * The format for the Cache Key one of the following: + * ClientEmail.Scope + * ClientEmail.Audience + * + * @return string + */ + public function getCacheKey() + { + $scopeOrAudience = $this->auth->getScope(); + if (!$scopeOrAudience) { + $scopeOrAudience = $this->auth->getAudience(); + } + + return $this->auth->getIssuer() . '.' . $scopeOrAudience; + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the project ID from the service account keyfile. + * + * Returns null if the project ID does not exist in the keyfile. + * + * @param callable|null $httpHandler Not used by this credentials type. + * @return string|null + */ + public function getProjectId(?callable $httpHandler = null) + { + return $this->projectId; + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable|null $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(?callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } + + /** + * Get the private key from the keyfile. + * + * In this case, it returns the keyfile's private_key key, needed for JWT signing. + * + * @return string + */ + public function getPrivateKey() + { + return $this->auth->getSigningKey(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + protected function getCredType(): string + { + return self::CRED_TYPE; + } +} diff --git a/vendor/google/auth/src/Credentials/UserRefreshCredentials.php b/vendor/google/auth/src/Credentials/UserRefreshCredentials.php new file mode 100644 index 0000000..326f6cd --- /dev/null +++ b/vendor/google/auth/src/Credentials/UserRefreshCredentials.php @@ -0,0 +1,202 @@ + $jsonKey JSON credential file path or JSON credentials + * as an associative array + * @param string|null $targetAudience The audience for the ID token. + */ + public function __construct( + $scope, + $jsonKey, + ?string $targetAudience = null + ) { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new InvalidArgumentException('file does not exist or is unreadable'); + } + $json = file_get_contents($jsonKey); + if (!$jsonKey = json_decode((string) $json, true)) { + throw new LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('client_id', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the client_id field' + ); + } + if (!array_key_exists('client_secret', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the client_secret field' + ); + } + if (!array_key_exists('refresh_token', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the refresh_token field' + ); + } + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + $additionalClaims = []; + if ($targetAudience) { + $additionalClaims = ['target_audience' => $targetAudience]; + $this->isIdTokenRequest = true; + } + $this->auth = new OAuth2([ + 'clientId' => $jsonKey['client_id'], + 'clientSecret' => $jsonKey['client_secret'], + 'refresh_token' => $jsonKey['refresh_token'], + 'scope' => $scope, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + 'additionalClaims' => $additionalClaims, + ]); + if (array_key_exists('quota_project_id', $jsonKey)) { + $this->quotaProject = (string) $jsonKey['quota_project_id']; + } + } + + /** + * @param callable|null $httpHandler + * @param array $headers [optional] Metrics headers to be inserted + * into the token endpoint request present. + * This could be passed from ImersonatedServiceAccountCredentials as it uses + * UserRefreshCredentials as source credentials. + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_in + * @type string $scope + * @type string $token_type + * @type string $id_token + * } + */ + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + { + return $this->auth->fetchAuthToken( + $httpHandler, + $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at') + ); + } + + /** + * Return the Cache Key for the credentials. + * The format for the Cache key is one of the following: + * ClientId.Scope + * ClientId.Audience + * + * @return string + */ + public function getCacheKey() + { + $scopeOrAudience = $this->auth->getScope(); + if (!$scopeOrAudience) { + $scopeOrAudience = $this->auth->getAudience(); + } + + return $this->auth->getClientId() . '.' . $scopeOrAudience; + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + /** + * Get the granted scopes (if they exist) for the last fetched token. + * + * @return string|null + */ + public function getGrantedScope() + { + return $this->auth->getGrantedScope(); + } + + protected function getCredType(): string + { + return self::CRED_TYPE; + } +} diff --git a/vendor/google/auth/src/CredentialsLoader.php b/vendor/google/auth/src/CredentialsLoader.php new file mode 100644 index 0000000..d5d59b6 --- /dev/null +++ b/vendor/google/auth/src/CredentialsLoader.php @@ -0,0 +1,319 @@ +|null JSON key | null + */ + public static function fromEnv() + { + $path = self::getEnv(self::ENV_VAR); + if (empty($path)) { + return null; + } + if (!file_exists($path)) { + $cause = 'file ' . $path . ' does not exist'; + throw new \DomainException(self::unableToReadEnv($cause)); + } + $jsonKey = file_get_contents($path); + + return json_decode((string) $jsonKey, true); + } + + /** + * Load a JSON key from a well known path. + * + * The well known path is OS dependent: + * + * * windows: %APPDATA%/gcloud/application_default_credentials.json + * * others: $HOME/.config/gcloud/application_default_credentials.json + * + * If the file does not exist, this returns null. + * + * @return array|null JSON key | null + */ + public static function fromWellKnownFile() + { + $rootEnv = self::isOnWindows() ? 'APPDATA' : 'HOME'; + $path = [self::getEnv($rootEnv)]; + if (!self::isOnWindows()) { + $path[] = self::NON_WINDOWS_WELL_KNOWN_PATH_BASE; + } + $path[] = self::WELL_KNOWN_PATH; + $path = implode(DIRECTORY_SEPARATOR, $path); + if (!file_exists($path)) { + return null; + } + $jsonKey = file_get_contents($path); + return json_decode((string) $jsonKey, true); + } + + /** + * Create a new Credentials instance. + * + * @deprecated This method is being deprecated because of a potential security risk. + * + * This method does not validate the credential configuration. The security + * risk occurs when a credential configuration is accepted from a source + * that is not under your control and used without validation on your side. + * + * If you know that you will be loading credential configurations of a + * specific type, it is recommended to use a credential-type-specific + * method. + * This will ensure that an unexpected credential type with potential for + * malicious intent is not loaded unintentionally. You might still have to do + * validation for certain credential types. Please follow the recommendation + * for that method. For example, if you want to load only service accounts, + * you can create the {@see ServiceAccountCredentials} explicitly: + * + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * $creds = new ServiceAccountCredentials($scopes, $json); + * ``` + * + * If you are loading your credential configuration from an untrusted source and have + * not mitigated the risks (e.g. by validating the configuration yourself), make + * these changes as soon as possible to prevent security risks to your environment. + * + * Regardless of the method used, it is always your responsibility to validate + * configurations received from external sources. + * + * @see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + * + * @param string|string[] $scope + * @param array $jsonKey + * @param string|string[] $defaultScope + * @return ServiceAccountCredentials|UserRefreshCredentials|ImpersonatedServiceAccountCredentials|ExternalAccountCredentials + */ + public static function makeCredentials( + $scope, + array $jsonKey, + $defaultScope = null + ) { + if (!array_key_exists('type', $jsonKey)) { + throw new \InvalidArgumentException('json key is missing the type field'); + } + + if ($jsonKey['type'] == 'service_account') { + // Do not pass $defaultScope to ServiceAccountCredentials + return new ServiceAccountCredentials($scope, $jsonKey); + } + + if ($jsonKey['type'] == 'authorized_user') { + $anyScope = $scope ?: $defaultScope; + return new UserRefreshCredentials($anyScope, $jsonKey); + } + + if ($jsonKey['type'] == 'impersonated_service_account') { + $anyScope = $scope ?: $defaultScope; + return new ImpersonatedServiceAccountCredentials($anyScope, $jsonKey); + } + + if ($jsonKey['type'] == 'external_account') { + $anyScope = $scope ?: $defaultScope; + return new ExternalAccountCredentials($anyScope, $jsonKey); + } + + throw new \InvalidArgumentException('invalid value in the type field'); + } + + /** + * Create an authorized HTTP Client from an instance of FetchAuthTokenInterface. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param array $httpClientOptions (optional) Array of request options to apply. + * @param callable|null $httpHandler (optional) http client to fetch the token. + * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + * @return \GuzzleHttp\Client + */ + public static function makeHttpClient( + FetchAuthTokenInterface $fetcher, + array $httpClientOptions = [], + ?callable $httpHandler = null, + ?callable $tokenCallback = null + ) { + $middleware = new Middleware\AuthTokenMiddleware( + $fetcher, + $httpHandler, + $tokenCallback + ); + $stack = \GuzzleHttp\HandlerStack::create(); + $stack->push($middleware); + + return new \GuzzleHttp\Client([ + 'handler' => $stack, + 'auth' => 'google_auth', + ] + $httpClientOptions); + } + + /** + * Create a new instance of InsecureCredentials. + * + * @return InsecureCredentials + */ + public static function makeInsecureCredentials() + { + return new InsecureCredentials(); + } + + /** + * Fetch a quota project from the environment variable + * GOOGLE_CLOUD_QUOTA_PROJECT. Return null if + * GOOGLE_CLOUD_QUOTA_PROJECT is not specified. + * + * @return string|null + */ + public static function quotaProjectFromEnv() + { + return self::getEnv(self::QUOTA_PROJECT_ENV_VAR) ?: null; + } + + /** + * Gets a callable which returns the default device certification. + * + * @throws UnexpectedValueException + * @return callable|null + */ + public static function getDefaultClientCertSource() + { + if (!$clientCertSourceJson = self::loadDefaultClientCertSourceFile()) { + return null; + } + $clientCertSourceCmd = $clientCertSourceJson['cert_provider_command']; + + return function () use ($clientCertSourceCmd) { + $cmd = array_map('escapeshellarg', $clientCertSourceCmd); + exec(implode(' ', $cmd), $output, $returnVar); + + if (0 === $returnVar) { + return implode(PHP_EOL, $output); + } + throw new RuntimeException( + '"cert_provider_command" failed with a nonzero exit code' + ); + }; + } + + /** + * Determines whether or not the default device certificate should be loaded. + * + * @return bool + */ + public static function shouldLoadClientCertSource() + { + return filter_var(self::getEnv(self::MTLS_CERT_ENV_VAR), FILTER_VALIDATE_BOOLEAN); + } + + /** + * @return array{cert_provider_command:string[]}|null + */ + private static function loadDefaultClientCertSourceFile() + { + $rootEnv = self::isOnWindows() ? 'APPDATA' : 'HOME'; + $path = sprintf('%s/%s', self::getEnv($rootEnv), self::MTLS_WELL_KNOWN_PATH); + if (!file_exists($path)) { + return null; + } + $jsonKey = file_get_contents($path); + $clientCertSourceJson = json_decode((string) $jsonKey, true); + if (!$clientCertSourceJson) { + throw new UnexpectedValueException('Invalid client cert source JSON'); + } + if (!isset($clientCertSourceJson['cert_provider_command'])) { + throw new UnexpectedValueException( + 'cert source requires "cert_provider_command"' + ); + } + if (!is_array($clientCertSourceJson['cert_provider_command'])) { + throw new UnexpectedValueException( + 'cert source expects "cert_provider_command" to be an array' + ); + } + return $clientCertSourceJson; + } + + /** + * Get the universe domain from the credential. Defaults to "googleapis.com" + * for all credential types which do not support universe domain. + * + * @return string + */ + public function getUniverseDomain(): string + { + return self::DEFAULT_UNIVERSE_DOMAIN; + } + + private static function getEnv(string $env): mixed + { + return getenv($env) ?: $_ENV[$env] ?? null; + } +} diff --git a/vendor/google/auth/src/ExecutableHandler/ExecutableHandler.php b/vendor/google/auth/src/ExecutableHandler/ExecutableHandler.php new file mode 100644 index 0000000..8f5e13f --- /dev/null +++ b/vendor/google/auth/src/ExecutableHandler/ExecutableHandler.php @@ -0,0 +1,83 @@ + */ + private array $env = []; + + private ?string $output = null; + + /** + * @param array $env + */ + public function __construct( + array $env = [], + int $timeoutMs = self::DEFAULT_EXECUTABLE_TIMEOUT_MILLIS, + ) { + if (!class_exists(Process::class)) { + throw new RuntimeException(sprintf( + 'The "symfony/process" package is required to use %s.', + self::class + )); + } + $this->env = $env; + $this->timeoutMs = $timeoutMs; + } + + /** + * @param string $command + * @return int + */ + public function __invoke(string $command): int + { + $process = Process::fromShellCommandline( + $command, + null, + $this->env, + null, + ($this->timeoutMs / 1000) + ); + + try { + $process->run(); + } catch (ProcessTimedOutException $e) { + throw new ExecutableResponseError( + 'The executable failed to finish within the timeout specified.', + 'TIMEOUT_EXCEEDED' + ); + } + + $this->output = $process->getOutput() . $process->getErrorOutput(); + + return $process->getExitCode(); + } + + public function getOutput(): ?string + { + return $this->output; + } +} diff --git a/vendor/google/auth/src/ExecutableHandler/ExecutableResponseError.php b/vendor/google/auth/src/ExecutableHandler/ExecutableResponseError.php new file mode 100644 index 0000000..4410902 --- /dev/null +++ b/vendor/google/auth/src/ExecutableHandler/ExecutableResponseError.php @@ -0,0 +1,27 @@ +|null $cacheConfig Configuration for the cache + * @param CacheItemPoolInterface $cache + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $this->fetcher = $fetcher; + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => 1500, + 'prefix' => '', + 'cacheUniverseDomain' => $fetcher instanceof Credentials\GCECredentials, + ], (array) $cacheConfig); + } + + /** + * @return FetchAuthTokenInterface + */ + public function getFetcher() + { + return $this->fetcher; + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Checks the cache for a valid auth token and fetches the auth tokens + * from the supplied fetcher. + * + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array the response + * @throws \Exception + */ + public function fetchAuthToken(?callable $httpHandler = null) + { + if ($cached = $this->fetchAuthTokenFromCache()) { + return $cached; + } + + $auth_token = $this->fetcher->fetchAuthToken($httpHandler); + + $this->saveAuthTokenInCache($auth_token); + + return $auth_token; + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->getFullCacheKey($this->fetcher->getCacheKey()); + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + return $this->fetcher->getLastReceivedToken(); + } + + /** + * Get the client name from the fetcher. + * + * @param callable|null $httpHandler An HTTP handler to deliver PSR7 requests. + * @return string + */ + public function getClientName(?callable $httpHandler = null) + { + if (!$this->fetcher instanceof SignBlobInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\SignBlobInterface' + ); + } + + return $this->fetcher->getClientName($httpHandler); + } + + /** + * Sign a blob using the fetcher. + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl Require use of OpenSSL for local signing. Does + * not apply to signing done using external services. **Defaults to** + * `false`. + * @return string The resulting signature. + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\SignBlobInterface`. + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + if (!$this->fetcher instanceof SignBlobInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\SignBlobInterface' + ); + } + + // Pass the access token from cache for credentials that sign blobs + // using the IAM API. This saves a call to fetch an access token when a + // cached token exists. + if ($this->fetcher instanceof Credentials\GCECredentials + || $this->fetcher instanceof Credentials\ImpersonatedServiceAccountCredentials + ) { + $cached = $this->fetchAuthTokenFromCache(); + $accessToken = $cached['access_token'] ?? null; + return $this->fetcher->signBlob($stringToSign, $forceOpenSsl, $accessToken); + } + + return $this->fetcher->signBlob($stringToSign, $forceOpenSsl); + } + + /** + * Get the quota project used for this API request from the credentials + * fetcher. + * + * @return string|null + */ + public function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + + return null; + } + + /** + * Get the Project ID from the fetcher. + * + * @param callable|null $httpHandler Callback which delivers psr7 request + * @return string|null + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\ProvidesProjectIdInterface`. + */ + public function getProjectId(?callable $httpHandler = null) + { + if (!$this->fetcher instanceof ProjectIdProviderInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\ProvidesProjectIdInterface' + ); + } + + // Pass the access token from cache for credentials that require an + // access token to fetch the project ID. This saves a call to fetch an + // access token when a cached token exists. + if ($this->fetcher instanceof Credentials\ExternalAccountCredentials) { + $cached = $this->fetchAuthTokenFromCache(); + $accessToken = $cached['access_token'] ?? null; + return $this->fetcher->getProjectId($httpHandler, $accessToken); + } + + return $this->fetcher->getProjectId($httpHandler); + } + + /* + * Get the Universe Domain from the fetcher. + * + * @return string + */ + public function getUniverseDomain(): string + { + if ($this->fetcher instanceof GetUniverseDomainInterface) { + if ($this->cacheConfig['cacheUniverseDomain']) { + return $this->getCachedUniverseDomain($this->fetcher); + } + return $this->fetcher->getUniverseDomain(); + } + + return GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN; + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\UpdateMetadataInterface`. + */ + public function updateMetadata( + $metadata, + $authUri = null, + ?callable $httpHandler = null + ) { + if (!$this->fetcher instanceof UpdateMetadataInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\UpdateMetadataInterface' + ); + } + + $cached = $this->fetchAuthTokenFromCache($authUri); + if ($cached) { + // Set the access token in the `Authorization` metadata header so + // the downstream call to updateMetadata know they don't need to + // fetch another token. + if (isset($cached['access_token'])) { + $metadata[self::AUTH_METADATA_KEY] = [ + 'Bearer ' . $cached['access_token'] + ]; + } elseif (isset($cached['id_token'])) { + $metadata[self::AUTH_METADATA_KEY] = [ + 'Bearer ' . $cached['id_token'] + ]; + } + } + + $newMetadata = $this->fetcher->updateMetadata( + $metadata, + $authUri, + $httpHandler + ); + + if (!$cached && $token = $this->fetcher->getLastReceivedToken()) { + $this->saveAuthTokenInCache($token, $authUri); + } + + return $newMetadata; + } + + /** + * @param string|null $authUri + * @return array|null + */ + private function fetchAuthTokenFromCache($authUri = null) + { + // Use the cached value if its available. + // + // TODO: correct caching; update the call to setCachedValue to set the expiry + // to the value returned with the auth token. + // + // TODO: correct caching; enable the cache to be cleared. + + // if $authUri is set, use it as the cache key + $cacheKey = $authUri + ? $this->getFullCacheKey($authUri) + : $this->fetcher->getCacheKey(); + + $cached = $this->getCachedValue($cacheKey); + if (is_array($cached)) { + if (empty($cached['expires_at'])) { + // If there is no expiration data, assume token is not expired. + // (for JwtAccess and ID tokens) + return $cached; + } + if ((time() + $this->eagerRefreshThresholdSeconds) < $cached['expires_at']) { + // access token is not expired + return $cached; + } + } + + return null; + } + + /** + * @param array $authToken + * @param string|null $authUri + * @return void + */ + private function saveAuthTokenInCache($authToken, $authUri = null) + { + if (isset($authToken['access_token']) || + isset($authToken['id_token'])) { + // if $authUri is set, use it as the cache key + $cacheKey = $authUri + ? $this->getFullCacheKey($authUri) + : $this->fetcher->getCacheKey(); + + $this->setCachedValue($cacheKey, $authToken); + } + } + + private function getCachedUniverseDomain(GetUniverseDomainInterface $fetcher): string + { + $cacheKey = $this->getFullCacheKey($fetcher->getCacheKey() . 'universe_domain'); // @phpstan-ignore-line + if ($universeDomain = $this->getCachedValue($cacheKey)) { + return $universeDomain; + } + + $universeDomain = $fetcher->getUniverseDomain(); + $this->setCachedValue($cacheKey, $universeDomain); + return $universeDomain; + } +} diff --git a/vendor/google/auth/src/FetchAuthTokenInterface.php b/vendor/google/auth/src/FetchAuthTokenInterface.php new file mode 100644 index 0000000..fbbd8b0 --- /dev/null +++ b/vendor/google/auth/src/FetchAuthTokenInterface.php @@ -0,0 +1,54 @@ + a hash of auth tokens + */ + public function fetchAuthToken(?callable $httpHandler = null); + + /** + * Obtains a key that can used to cache the results of #fetchAuthToken. + * + * If the value is empty, the auth token is not cached. + * + * @return string a key that may be used to cache the auth token. + */ + public function getCacheKey(); + + /** + * Returns an associative array with the token and + * expiration time. + * + * @return null|array { + * The last received access token. + * + * @type string $access_token The access token string. + * @type int $expires_at The time the token expires as a UNIX timestamp. + * } + */ + public function getLastReceivedToken(); +} diff --git a/vendor/google/auth/src/GCECache.php b/vendor/google/auth/src/GCECache.php new file mode 100644 index 0000000..d3dcd8c --- /dev/null +++ b/vendor/google/auth/src/GCECache.php @@ -0,0 +1,82 @@ + $cacheConfig Configuration for the cache + * @param CacheItemPoolInterface $cache + */ + public function __construct( + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => 1500, + 'prefix' => '', + ], (array) $cacheConfig); + } + + /** + * Caches the result of onGce so the metadata server is not called multiple + * times. + * + * @param callable|null $httpHandler callback which delivers psr7 request + * @return bool True if this a GCEInstance, false otherwise + */ + public function onGce(?callable $httpHandler = null) + { + if (is_null($this->cache)) { + return GCECredentials::onGce($httpHandler); + } + + $cacheKey = self::GCE_CACHE_KEY; + $onGce = $this->getCachedValue($cacheKey); + + if (is_null($onGce)) { + $onGce = GCECredentials::onGce($httpHandler); + $this->setCachedValue($cacheKey, $onGce); + } + + return $onGce; + } +} diff --git a/vendor/google/auth/src/GetQuotaProjectInterface.php b/vendor/google/auth/src/GetQuotaProjectInterface.php new file mode 100644 index 0000000..517f062 --- /dev/null +++ b/vendor/google/auth/src/GetQuotaProjectInterface.php @@ -0,0 +1,33 @@ +client = $client; + $this->logger = $logger; + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PSR-7 response. + * + * @param RequestInterface $request + * @param array $options + * @return ResponseInterface + */ + public function __invoke(RequestInterface $request, array $options = []) + { + $requestEvent = null; + + if ($this->logger) { + $requestEvent = $this->requestLog($request, $options); + } + + $response = $this->client->send($request, $options); + + if ($this->logger) { + $this->responseLog($response, $requestEvent); + } + + return $response; + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PromiseInterface + * + * @param RequestInterface $request + * @param array $options + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function async(RequestInterface $request, array $options = []) + { + $requestEvent = null; + + if ($this->logger) { + $requestEvent = $this->requestLog($request, $options); + } + + $promise = $this->client->sendAsync($request, $options); + + if ($this->logger) { + $promise->then(function (ResponseInterface $response) use ($requestEvent) { + $this->responseLog($response, $requestEvent); + return $response; + }); + } + + return $promise; + } + + /** + * @internal + * @param RequestInterface $request + * @param array $options + */ + public function requestLog(RequestInterface $request, array $options): RpcLogEvent + { + $requestEvent = new RpcLogEvent(); + + $requestEvent->method = $request->getMethod(); + $requestEvent->url = (string) $request->getUri(); + $requestEvent->headers = $request->getHeaders(); + $requestEvent->payload = $request->getBody()->getContents(); + $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; + $requestEvent->serviceName = $options['serviceName'] ?? null; + $requestEvent->processId = (int) getmypid(); + $requestEvent->requestId = $options['requestId'] ?? crc32((string) spl_object_id($request) . getmypid()); + + $this->logRequest($requestEvent); + + return $requestEvent; + } + + /** + * @internal + */ + public function responseLog(ResponseInterface $response, RpcLogEvent $requestEvent): void + { + $responseEvent = new RpcLogEvent($requestEvent->milliseconds); + + $responseEvent->headers = $response->getHeaders(); + $responseEvent->payload = $response->getBody()->getContents(); + $responseEvent->status = $response->getStatusCode(); + $responseEvent->processId = $requestEvent->processId; + $responseEvent->requestId = $requestEvent->requestId; + + $this->logResponse($responseEvent); + } +} diff --git a/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php b/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php new file mode 100644 index 0000000..e84f660 --- /dev/null +++ b/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php @@ -0,0 +1,21 @@ +remove('http_errors'); + $stack->unshift(Middleware::httpErrors($bodySummarizer), 'http_errors'); + } + $client = new Client(['handler' => $stack]); + } + + $logger = ($logger === false) + ? null + : $logger ?? ApplicationDefaultCredentials::getDefaultLogger(); + + $version = null; + if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) { + $version = ClientInterface::MAJOR_VERSION; + } elseif (defined('GuzzleHttp\ClientInterface::VERSION')) { + $version = (int) substr(ClientInterface::VERSION, 0, 1); + } + + switch ($version) { + case 6: + return new Guzzle6HttpHandler($client, $logger); + case 7: + return new Guzzle7HttpHandler($client, $logger); + default: + throw new \Exception('Version not supported'); + } + } +} diff --git a/vendor/google/auth/src/Iam.php b/vendor/google/auth/src/Iam.php new file mode 100644 index 0000000..b32ac60 --- /dev/null +++ b/vendor/google/auth/src/Iam.php @@ -0,0 +1,155 @@ +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + $this->universeDomain = $universeDomain; + } + + /** + * Sign a string using the IAM signBlob API. + * + * Note that signing using IAM requires your service account to have the + * `iam.serviceAccounts.signBlob` permission, part of the "Service Account + * Token Creator" IAM role. + * + * @param string $email The service account email. + * @param string $accessToken An access token from the service account. + * @param string $stringToSign The string to be signed. + * @param array $delegates [optional] A list of service account emails to + * add to the delegate chain. If omitted, the value of `$email` will + * be used. + * @return string The signed string, base64-encoded. + */ + public function signBlob($email, $accessToken, $stringToSign, array $delegates = []) + { + $name = sprintf(self::SERVICE_ACCOUNT_NAME, $email); + $apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE); + $uri = $apiRoot . '/' . sprintf(self::SIGN_BLOB_PATH, $name); + + if ($delegates) { + foreach ($delegates as &$delegate) { + $delegate = sprintf(self::SERVICE_ACCOUNT_NAME, $delegate); + } + } else { + $delegates = [$name]; + } + + $body = [ + 'delegates' => $delegates, + 'payload' => base64_encode($stringToSign), + ]; + + $headers = [ + 'Authorization' => 'Bearer ' . $accessToken + ]; + + $request = new Psr7\Request( + 'POST', + $uri, + $headers, + Utils::streamFor(json_encode($body)) + ); + + $res = ($this->httpHandler)($request); + $body = json_decode((string) $res->getBody(), true); + + return $body['signedBlob']; + } + + /** + * Sign a string using the IAM signBlob API. + * + * Note that signing using IAM requires your service account to have the + * `iam.serviceAccounts.signBlob` permission, part of the "Service Account + * Token Creator" IAM role. + * + * @param string $clientEmail The service account email. + * @param string $targetAudience The audience for the ID token. + * @param string $bearerToken The token to authenticate the IAM request. + * @param array $headers [optional] Additional headers to send with the request. + * + * @return string The signed string, base64-encoded. + */ + public function generateIdToken( + string $clientEmail, + string $targetAudience, + string $bearerToken, + array $headers = [] + ): string { + $name = sprintf(self::SERVICE_ACCOUNT_NAME, $clientEmail); + $apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE); + $uri = $apiRoot . '/' . sprintf(self::GENERATE_ID_TOKEN_PATH, $name); + + $headers['Authorization'] = 'Bearer ' . $bearerToken; + + $body = [ + 'audience' => $targetAudience, + 'includeEmail' => true, + 'useEmailAzp' => true, + ]; + + $request = new Psr7\Request( + 'POST', + $uri, + $headers, + Utils::streamFor(json_encode($body)) + ); + + $res = ($this->httpHandler)($request); + $body = json_decode((string) $res->getBody(), true); + + return $body['token']; + } +} diff --git a/vendor/google/auth/src/IamSignerTrait.php b/vendor/google/auth/src/IamSignerTrait.php new file mode 100644 index 0000000..da3c909 --- /dev/null +++ b/vendor/google/auth/src/IamSignerTrait.php @@ -0,0 +1,72 @@ +iam; + if (!$signer) { + $signer = $this instanceof GetUniverseDomainInterface + ? new Iam($httpHandler, $this->getUniverseDomain()) + : new Iam($httpHandler); + } + + $email = $this->getClientName($httpHandler); + + if (is_null($accessToken)) { + $previousToken = $this->getLastReceivedToken(); + $accessToken = $previousToken + ? $previousToken['access_token'] + : $this->fetchAuthToken($httpHandler)['access_token']; + } + + return $signer->signBlob($email, $accessToken, $stringToSign); + } +} diff --git a/vendor/google/auth/src/Logging/LoggingTrait.php b/vendor/google/auth/src/Logging/LoggingTrait.php new file mode 100644 index 0000000..0b8330d --- /dev/null +++ b/vendor/google/auth/src/Logging/LoggingTrait.php @@ -0,0 +1,138 @@ + $event->timestamp, + 'severity' => strtoupper(LogLevel::DEBUG), + 'processId' => $event->processId ?? null, + 'requestId' => $event->requestId ?? null, + 'rpcName' => $event->rpcName ?? null, + ]; + + $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value)); + + $jsonPayload = [ + 'request.method' => $event->method, + 'request.url' => $event->url, + 'request.headers' => $event->headers, + 'request.payload' => $this->truncatePayload($event->payload), + 'request.jwt' => $this->getJwtToken($event->headers ?? []), + 'retryAttempt' => $event->retryAttempt + ]; + + // Remove null values + $debugEvent['jsonPayload'] = array_filter($jsonPayload, fn ($value) => !is_null($value)); + + $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + + // There was an error stringifying the event, return to not break execution + if ($stringifiedEvent === false) { + return; + } + + $this->logger->debug($stringifiedEvent); + } + + /** + * @param RpcLogEvent $event + */ + private function logResponse(RpcLogEvent $event): void + { + $debugEvent = [ + 'timestamp' => $event->timestamp, + 'severity' => strtoupper(LogLevel::DEBUG), + 'processId' => $event->processId ?? null, + 'requestId' => $event->requestId ?? null, + 'jsonPayload' => [ + 'response.status' => $event->status, + 'response.headers' => $event->headers, + 'response.payload' => $this->truncatePayload($event->payload), + 'latencyMillis' => $event->latency, + ] + ]; + + // Remove null values + $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value)); + $debugEvent['jsonPayload'] = array_filter( + $debugEvent['jsonPayload'], + fn ($value) => !is_null($value) + ); + + $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + + // There was an error stringifying the event, return to not break execution + if ($stringifiedEvent !== false) { + $this->logger->debug($stringifiedEvent); + } + } + + /** + * @param array $headers + * @return null|array + */ + private function getJwtToken(array $headers): null|array + { + if (empty($headers)) { + return null; + } + + $tokenHeader = $headers['Authorization'] ?? ''; + $token = str_replace('Bearer ', '', $tokenHeader); + + if (substr_count($token, '.') !== 2) { + return null; + } + + [$header, $token, $_] = explode('.', $token); + + return [ + 'header' => base64_decode($header), + 'token' => base64_decode($token) + ]; + } + + /** + * @param null|string $payload + * @return string + */ + private function truncatePayload(null|string $payload): null|string + { + $maxLength = 500; + + if (is_null($payload) || strlen($payload) <= $maxLength) { + return $payload; + } + + return substr($payload, 0, $maxLength) . '...'; + } +} diff --git a/vendor/google/auth/src/Logging/RpcLogEvent.php b/vendor/google/auth/src/Logging/RpcLogEvent.php new file mode 100644 index 0000000..50e89fe --- /dev/null +++ b/vendor/google/auth/src/Logging/RpcLogEvent.php @@ -0,0 +1,136 @@ + + */ + public null|array $headers = null; + + /** + * An array representation of JSON for the response or request + * + * @var null|string + */ + public null|string $payload = null; + + /** + * Status code for REST or gRPC methods + * + * @var null|int|string + */ + public null|int|string $status = null; + + /** + * The latency in milliseconds + * + * @var null|int + */ + public null|int $latency = null; + + /** + * The retry attempt number + * + * @var null|int + */ + public null|int $retryAttempt = null; + + /** + * The name of the gRPC method being called + * + * @var null|string + */ + public null|string $rpcName = null; + + /** + * The Service Name of the gRPC + * + * @var null|string $serviceName + */ + public null|string $serviceName = null; + + /** + * The Process ID for tracing logs + * + * @var null|int $processId + */ + public null|int $processId = null; + + /** + * The Request id for tracing logs + * + * @var null|int $requestId; + */ + public null|int $requestId = null; + + /** + * Creates an object with all the fields required for logging + * Passing a string representation of a timestamp calculates the difference between + * these two times and sets the latency field with the result. + * + * @param null|float $startTime (Optional) Parameter to calculate the latency + */ + public function __construct(null|float $startTime = null) + { + $this->timestamp = date(DATE_RFC3339); + + // Takes the micro time and convets it to millis + $this->milliseconds = round(microtime(true) * 1000); + + if ($startTime) { + $this->latency = (int) round($this->milliseconds - $startTime); + } + } +} diff --git a/vendor/google/auth/src/Logging/StdOutLogger.php b/vendor/google/auth/src/Logging/StdOutLogger.php new file mode 100644 index 0000000..27b1f0e --- /dev/null +++ b/vendor/google/auth/src/Logging/StdOutLogger.php @@ -0,0 +1,85 @@ + + */ + private array $levelMapping = [ + LogLevel::EMERGENCY => 7, + LogLevel::ALERT => 6, + LogLevel::CRITICAL => 5, + LogLevel::ERROR => 4, + LogLevel::WARNING => 3, + LogLevel::NOTICE => 2, + LogLevel::INFO => 1, + LogLevel::DEBUG => 0, + ]; + private int $level; + + /** + * Constructs a basic PSR-3 logger class that logs into StdOut for GCP Logging + * + * @param string $level The level of the logger instance. + */ + public function __construct(string $level = LogLevel::DEBUG) + { + $this->level = $this->getLevelFromName($level); + } + + /** + * {@inheritdoc} + */ + public function log($level, string|Stringable $message, array $context = []): void + { + if ($this->getLevelFromName($level) < $this->level) { + return; + } + + print($message . "\n"); + } + + /** + * @param string $levelName + * @return int + * @throws InvalidArgumentException + */ + private function getLevelFromName(string $levelName): int + { + if (!array_key_exists($levelName, $this->levelMapping)) { + throw new InvalidArgumentException('The level supplied to the Logger is not valid'); + } + + return $this->levelMapping[$levelName]; + } +} diff --git a/vendor/google/auth/src/MetricsTrait.php b/vendor/google/auth/src/MetricsTrait.php new file mode 100644 index 0000000..8d5c03c --- /dev/null +++ b/vendor/google/auth/src/MetricsTrait.php @@ -0,0 +1,120 @@ + $metadata The metadata to update and return. + * @return array The updated metadata. + */ + protected function applyServiceApiUsageMetrics($metadata) + { + if ($credType = $this->getCredType()) { + // Add service api usage observability metrics info into metadata + // We expect upstream libries to have the metadata key populated already + $value = 'cred-type/' . $credType; + if (!isset($metadata[self::$metricMetadataKey])) { + // This case will happen only when someone invokes the updateMetadata + // method on the credentials fetcher themselves. + $metadata[self::$metricMetadataKey] = [$value]; + } elseif (is_array($metadata[self::$metricMetadataKey])) { + $metadata[self::$metricMetadataKey][0] .= ' ' . $value; + } else { + $metadata[self::$metricMetadataKey] .= ' ' . $value; + } + } + + return $metadata; + } + + /** + * @param array $metadata The metadata to update and return. + * @param string $authRequestType The auth request type. Possible values are + * `'at'`, `'it'`, `'mds'`. + * @return array The updated metadata. + */ + protected function applyTokenEndpointMetrics($metadata, $authRequestType) + { + $metricsHeader = self::getMetricsHeader($this->getCredType(), $authRequestType); + if (!isset($metadata[self::$metricMetadataKey])) { + $metadata[self::$metricMetadataKey] = $metricsHeader; + } + return $metadata; + } + + protected static function getVersion(): string + { + if (is_null(self::$version)) { + $versionFilePath = __DIR__ . '/../VERSION'; + self::$version = trim((string) file_get_contents($versionFilePath)); + } + return self::$version; + } + + protected function getCredType(): string + { + return ''; + } +} diff --git a/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php b/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php new file mode 100644 index 0000000..b8f2c51 --- /dev/null +++ b/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php @@ -0,0 +1,163 @@ +' + */ +class AuthTokenMiddleware +{ + /** + * @var callable + */ + private $httpHandler; + + /** + * It must be an implementation of FetchAuthTokenInterface. + * It may also implement UpdateMetadataInterface allowing direct + * retrieval of auth related headers + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var ?callable + */ + private $tokenCallback; + + /** + * Creates a new AuthTokenMiddleware. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable|null $httpHandler (optional) callback which delivers psr7 request + * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + ?callable $httpHandler = null, + ?callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * Updates the request with an Authorization header when auth is 'google_auth'. + * + * use Google\Auth\Middleware\AuthTokenMiddleware; + * use Google\Auth\OAuth2; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $middleware = new AuthTokenMiddleware($oauth2); + * $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'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="google_auth" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'google_auth') { + return $handler($request, $options); + } + + $request = $this->addAuthHeaders($request); + + if ($quotaProject = $this->getQuotaProject()) { + $request = $request->withHeader( + GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, + $quotaProject + ); + } + + return $handler($request, $options); + }; + } + + /** + * Adds auth related headers to the request. + * + * @param RequestInterface $request + * @return RequestInterface + */ + private function addAuthHeaders(RequestInterface $request) + { + if (!$this->fetcher instanceof UpdateMetadataInterface || + ($this->fetcher instanceof FetchAuthTokenCache && + !$this->fetcher->getFetcher() instanceof UpdateMetadataInterface) + ) { + $token = $this->fetcher->fetchAuthToken(); + $request = $request->withHeader( + 'authorization', + 'Bearer ' . ($token['access_token'] ?? $token['id_token'] ?? '') + ); + } else { + $headers = $this->fetcher->updateMetadata($request->getHeaders(), null, $this->httpHandler); + $request = Utils::modifyRequest($request, ['set_headers' => $headers]); + } + + if ($this->tokenCallback && ($token = $this->fetcher->getLastReceivedToken())) { + if (array_key_exists('access_token', $token)) { + call_user_func($this->tokenCallback, $this->fetcher->getCacheKey(), $token['access_token']); + } + } + + return $request; + } + + /** + * @return string|null + */ + private function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + + return null; + } +} diff --git a/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php b/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php new file mode 100644 index 0000000..2c44871 --- /dev/null +++ b/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php @@ -0,0 +1,155 @@ +' + */ +class ProxyAuthTokenMiddleware +{ + /** + * @var callable + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var ?callable + */ + private $tokenCallback; + + /** + * Creates a new ProxyAuthTokenMiddleware. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable|null $httpHandler (optional) callback which delivers psr7 request + * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + ?callable $httpHandler = null, + ?callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * Updates the request with an Authorization header when auth is 'google_auth'. + * + * use Google\Auth\Middleware\ProxyAuthTokenMiddleware; + * use Google\Auth\OAuth2; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $middleware = new ProxyAuthTokenMiddleware($oauth2); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'proxy_auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "proxy_auth"="google_auth" will be authorized. + if (!isset($options['proxy_auth']) || $options['proxy_auth'] !== 'google_auth') { + return $handler($request, $options); + } + + $request = $request->withHeader('proxy-authorization', 'Bearer ' . $this->fetchToken()); + + if ($quotaProject = $this->getQuotaProject()) { + $request = $request->withHeader( + GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, + $quotaProject + ); + } + + return $handler($request, $options); + }; + } + + /** + * Call fetcher to fetch the token. + * + * @return string|null + */ + private function fetchToken() + { + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + + if (array_key_exists('access_token', $auth_tokens)) { + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func( + $this->tokenCallback, + $this->fetcher->getCacheKey(), + $auth_tokens['access_token'] + ); + } + + return $auth_tokens['access_token']; + } + + if (array_key_exists('id_token', $auth_tokens)) { + return $auth_tokens['id_token']; + } + + return null; + } + + /** + * @return string|null; + */ + private function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + + return null; + } +} diff --git a/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php b/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php new file mode 100644 index 0000000..f2f85cc --- /dev/null +++ b/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php @@ -0,0 +1,165 @@ +' + */ +class ScopedAccessTokenMiddleware +{ + use CacheTrait; + + const DEFAULT_CACHE_LIFETIME = 1500; + + /** + * @var callable + */ + private $tokenFunc; + + /** + * @var array|string + */ + private $scopes; + + /** + * Creates a new ScopedAccessTokenMiddleware. + * + * @param callable $tokenFunc a token generator function + * @param array|string $scopes the token authentication scopes + * @param array|null $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface|null $cache an implementation of CacheItemPoolInterface + */ + public function __construct( + callable $tokenFunc, + $scopes, + ?array $cacheConfig = null, + ?CacheItemPoolInterface $cache = null + ) { + $this->tokenFunc = $tokenFunc; + if (!(is_string($scopes) || is_array($scopes))) { + throw new \InvalidArgumentException( + 'wants scope should be string or array' + ); + } + $this->scopes = $scopes; + + if (!is_null($cache)) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => self::DEFAULT_CACHE_LIFETIME, + 'prefix' => '', + ], $cacheConfig); + } + } + + /** + * Updates the request with an Authorization header when auth is 'scoped'. + * + * E.g this could be used to authenticate using the AppEngine + * AppIdentityService. + * + * use google\appengine\api\app_identity\AppIdentityService; + * use Google\Auth\Middleware\ScopedAccessTokenMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $scope = 'https://www.googleapis.com/auth/taskqueue' + * $middleware = new ScopedAccessTokenMiddleware( + * 'AppIdentityService::getAccessToken', + * $scope, + * [ 'prefix' => 'Google\Auth\ScopedAccessToken::' ], + * $cache = new Memcache() + * ); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'scoped' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'scoped') { + return $handler($request, $options); + } + + $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); + + return $handler($request, $options); + }; + } + + /** + * @return string + */ + private function getCacheKey() + { + $key = null; + + if (is_string($this->scopes)) { + $key .= $this->scopes; + } elseif (is_array($this->scopes)) { + $key .= implode(':', $this->scopes); + } + + return $key; + } + + /** + * Determine if token is available in the cache, if not call tokenFunc to + * fetch it. + * + * @return string + */ + private function fetchToken() + { + $cacheKey = $this->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + + if (!empty($cached)) { + return $cached; + } + + $token = call_user_func($this->tokenFunc, $this->scopes); + $this->setCachedValue($cacheKey, $token); + + return $token; + } +} diff --git a/vendor/google/auth/src/Middleware/SimpleMiddleware.php b/vendor/google/auth/src/Middleware/SimpleMiddleware.php new file mode 100644 index 0000000..6940430 --- /dev/null +++ b/vendor/google/auth/src/Middleware/SimpleMiddleware.php @@ -0,0 +1,92 @@ + + */ + private $config; + + /** + * Create a new Simple plugin. + * + * The configuration array expects one option + * - key: required, otherwise InvalidArgumentException is thrown + * + * @param array $config Configuration array + */ + public function __construct(array $config) + { + if (!isset($config['key'])) { + throw new \InvalidArgumentException('requires a key to have been set'); + } + + $this->config = array_merge(['key' => null], $config); + } + + /** + * Updates the request query with the developer key if auth is set to simple. + * + * use Google\Auth\Middleware\SimpleMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $my_key = 'is not the same as yours'; + * $middleware = new SimpleMiddleware(['key' => $my_key]); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/discovery/v1/', + * 'auth' => 'simple' + * ]); + * + * $res = $client->get('drive/v2/rest'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'simple') { + return $handler($request, $options); + } + + $query = Query::parse($request->getUri()->getQuery()); + $params = array_merge($query, $this->config); + $uri = $request->getUri()->withQuery(Query::build($params)); + $request = $request->withUri($uri); + + return $handler($request, $options); + }; + } +} diff --git a/vendor/google/auth/src/OAuth2.php b/vendor/google/auth/src/OAuth2.php new file mode 100644 index 0000000..ced3464 --- /dev/null +++ b/vendor/google/auth/src/OAuth2.php @@ -0,0 +1,1828 @@ + + */ + public static $knownSigningAlgorithms = [ + 'HS256', + 'HS512', + 'HS384', + 'RS256', + ]; + + /** + * The well known grant types. + * + * @var array + */ + public static $knownGrantTypes = [ + 'authorization_code', + 'refresh_token', + 'password', + 'client_credentials', + ]; + + /** + * - authorizationUri + * The authorization server's HTTP endpoint capable of + * authenticating the end-user and obtaining authorization. + * + * @var ?UriInterface + */ + private $authorizationUri; + + /** + * - tokenCredentialUri + * The authorization server's HTTP endpoint capable of issuing + * tokens and refreshing expired tokens. + * + * @var UriInterface + */ + private $tokenCredentialUri; + + /** + * The redirection URI used in the initial request. + * + * @var ?string + */ + private $redirectUri; + + /** + * A unique identifier issued to the client to identify itself to the + * authorization server. + * + * @var string + */ + private $clientId; + + /** + * A shared symmetric secret issued by the authorization server, which is + * used to authenticate the client. + * + * @var string + */ + private $clientSecret; + + /** + * The resource owner's username. + * + * @var ?string + */ + private $username; + + /** + * The resource owner's password. + * + * @var ?string + */ + private $password; + + /** + * The scope of the access request, expressed either as an Array or as a + * space-delimited string. + * + * @var ?array + */ + private $scope; + + /** + * An arbitrary string designed to allow the client to maintain state. + * + * @var string + */ + private $state; + + /** + * The authorization code issued to this client. + * + * Only used by the authorization code access grant type. + * + * @var ?string + */ + private $code; + + /** + * The issuer ID when using assertion profile. + * + * @var ?string + */ + private $issuer; + + /** + * The target audience for assertions. + * + * @var string + */ + private $audience; + + /** + * The target sub when issuing assertions. + * + * @var string + */ + private $sub; + + /** + * The number of seconds assertions are valid for. + * + * @var int + */ + private $expiry; + + /** + * The signing key when using assertion profile. + * + * @var ?string + */ + private $signingKey; + + /** + * The signing key id when using assertion profile. Param kid in jwt header + * + * @var string + */ + private $signingKeyId; + + /** + * The signing algorithm when using an assertion profile. + * + * @var ?string + */ + private $signingAlgorithm; + + /** + * The refresh token associated with the access token to be refreshed. + * + * @var ?string + */ + private $refreshToken; + + /** + * The current access token. + * + * @var string + */ + private $accessToken; + + /** + * The current ID token. + * + * @var string + */ + private $idToken; + + /** + * The scopes granted to the current access token + * + * @var string + */ + private $grantedScope; + + /** + * The lifetime in seconds of the current access token. + * + * @var ?int + */ + private $expiresIn; + + /** + * The expiration time of the access token as a number of seconds since the + * unix epoch. + * + * @var ?int + */ + private $expiresAt; + + /** + * The issue time of the access token as a number of seconds since the unix + * epoch. + * + * @var ?int + */ + private $issuedAt; + + /** + * The current grant type. + * + * @var ?string + */ + private $grantType; + + /** + * When using an extension grant type, this is the set of parameters used by + * that extension. + * + * @var array + */ + private $extensionParams; + + /** + * When using the toJwt function, these claims will be added to the JWT + * payload. + * + * @var array + */ + private $additionalClaims; + + /** + * The code verifier for PKCE for OAuth 2.0. When set, the authorization + * URI will contain the Code Challenge and Code Challenge Method querystring + * parameters, and the token URI will contain the Code Verifier parameter. + * + * @see https://datatracker.ietf.org/doc/html/rfc7636 + * @var ?string + */ + private $codeVerifier; + + /** + * For STS requests. + * A URI that indicates the target service or resource where the client + * intends to use the requested security token. + */ + private ?string $resource; + + /** + * For STS requests. + * A fetcher for the "subject_token", which is a security token that + * represents the identity of the party on behalf of whom the request is + * being made. + */ + private ?ExternalAccountCredentialSourceInterface $subjectTokenFetcher; + + /** + * For STS requests. + * An identifier, that indicates the type of the security token in the + * subjectToken parameter. + */ + private ?string $subjectTokenType; + + /** + * For STS requests. + * A security token that represents the identity of the acting party. + */ + private ?string $actorToken; + + /** + * For STS requests. + * An identifier that indicates the type of the security token in the + * actorToken parameter. + */ + private ?string $actorTokenType; + + /** + * From STS response. + * An identifier for the representation of the issued security token. + */ + private ?string $issuedTokenType = null; + + /** + * From STS response. + * An identifier for the representation of the issued security token. + * + * @var array + */ + private array $additionalOptions; + + /** + * Create a new OAuthCredentials. + * + * The configuration array accepts various options + * + * - authorizationUri + * The authorization server's HTTP endpoint capable of + * authenticating the end-user and obtaining authorization. + * + * - tokenCredentialUri + * The authorization server's HTTP endpoint capable of issuing + * tokens and refreshing expired tokens. + * + * - clientId + * A unique identifier issued to the client to identify itself to the + * authorization server. + * + * - clientSecret + * A shared symmetric secret issued by the authorization server, + * which is used to authenticate the client. + * + * - scope + * The scope of the access request, expressed either as an Array + * or as a space-delimited String. + * + * - state + * An arbitrary string designed to allow the client to maintain state. + * + * - redirectUri + * The redirection URI used in the initial request. + * + * - username + * The resource owner's username. + * + * - password + * The resource owner's password. + * + * - issuer + * Issuer ID when using assertion profile + * + * - audience + * Target audience for assertions + * + * - expiry + * Number of seconds assertions are valid for + * + * - signingKey + * Signing key when using assertion profile + * + * - signingKeyId + * Signing key id when using assertion profile + * + * - refreshToken + * The refresh token associated with the access token + * to be refreshed. + * + * - accessToken + * The current access token for this client. + * + * - idToken + * The current ID token for this client. + * + * - extensionParams + * When using an extension grant type, this is the set of parameters used + * by that extension. + * + * - codeVerifier + * The code verifier for PKCE for OAuth 2.0. + * + * - resource + * The target service or resource where the client ntends to use the + * requested security token. + * + * - subjectTokenFetcher + * A fetcher for the "subject_token", which is a security token that + * represents the identity of the party on behalf of whom the request is + * being made. + * + * - subjectTokenType + * An identifier that indicates the type of the security token in the + * subjectToken parameter. + * + * - actorToken + * A security token that represents the identity of the acting party. + * + * - actorTokenType + * An identifier for the representation of the issued security token. + * + * @param array $config Configuration array + */ + public function __construct(array $config) + { + $opts = array_merge([ + 'expiry' => self::DEFAULT_EXPIRY_SECONDS, + 'extensionParams' => [], + 'authorizationUri' => null, + 'redirectUri' => null, + 'tokenCredentialUri' => null, + 'state' => null, + 'username' => null, + 'password' => null, + 'clientId' => null, + 'clientSecret' => null, + 'issuer' => null, + 'sub' => null, + 'audience' => null, + 'signingKey' => null, + 'signingKeyId' => null, + 'signingAlgorithm' => null, + 'scope' => null, + 'additionalClaims' => [], + 'codeVerifier' => null, + 'resource' => null, + 'subjectTokenFetcher' => null, + 'subjectTokenType' => null, + 'actorToken' => null, + 'actorTokenType' => null, + 'additionalOptions' => [], + ], $config); + + $this->setAuthorizationUri($opts['authorizationUri']); + $this->setRedirectUri($opts['redirectUri']); + $this->setTokenCredentialUri($opts['tokenCredentialUri']); + $this->setState($opts['state']); + $this->setUsername($opts['username']); + $this->setPassword($opts['password']); + $this->setClientId($opts['clientId']); + $this->setClientSecret($opts['clientSecret']); + $this->setIssuer($opts['issuer']); + $this->setSub($opts['sub']); + $this->setExpiry($opts['expiry']); + $this->setAudience($opts['audience']); + $this->setSigningKey($opts['signingKey']); + $this->setSigningKeyId($opts['signingKeyId']); + $this->setSigningAlgorithm($opts['signingAlgorithm']); + $this->setScope($opts['scope']); + $this->setExtensionParams($opts['extensionParams']); + $this->setAdditionalClaims($opts['additionalClaims']); + $this->setCodeVerifier($opts['codeVerifier']); + + // for STS + $this->resource = $opts['resource']; + $this->subjectTokenFetcher = $opts['subjectTokenFetcher']; + $this->subjectTokenType = $opts['subjectTokenType']; + $this->actorToken = $opts['actorToken']; + $this->actorTokenType = $opts['actorTokenType']; + $this->additionalOptions = $opts['additionalOptions']; + + $this->updateToken($opts); + } + + /** + * Verifies the idToken if present. + * + * - if none is present, return null + * - if present, but invalid, raises DomainException. + * - otherwise returns the payload in the idtoken as a PHP object. + * + * The behavior of this method varies depending on the version of + * `firebase/php-jwt` you are using. In versions 6.0 and above, you cannot + * provide multiple $allowed_algs, and instead must provide an array of Key + * objects as the $publicKey. + * + * @param string|Key|Key[] $publicKey The public key to use to authenticate the token + * @param string|array $allowed_algs algorithm or array of supported verification algorithms. + * Providing more than one algorithm will throw an exception. + * @throws \DomainException if the token is missing an audience. + * @throws \DomainException if the audience does not match the one set in + * the OAuth2 class instance. + * @throws \UnexpectedValueException If the token is invalid + * @throws \InvalidArgumentException If more than one value for allowed_algs is supplied + * @throws \Firebase\JWT\SignatureInvalidException If the signature is invalid. + * @throws \Firebase\JWT\BeforeValidException If the token is not yet valid. + * @throws \Firebase\JWT\ExpiredException If the token has expired. + * @return null|object + */ + public function verifyIdToken($publicKey = null, $allowed_algs = []) + { + $idToken = $this->getIdToken(); + if (is_null($idToken)) { + return null; + } + + $resp = $this->jwtDecode($idToken, $publicKey, $allowed_algs); + if (!property_exists($resp, 'aud')) { + throw new \DomainException('No audience found the id token'); + } + if ($resp->aud != $this->getAudience()) { + throw new \DomainException('Wrong audience present in the id token'); + } + + return $resp; + } + + /** + * Obtains the encoded jwt from the instance data. + * + * @param array $config array optional configuration parameters + * @return string + */ + public function toJwt(array $config = []) + { + if (is_null($this->getSigningKey())) { + throw new \DomainException('No signing key available'); + } + if (is_null($this->getSigningAlgorithm())) { + throw new \DomainException('No signing algorithm specified'); + } + $now = time(); + + $opts = array_merge([ + 'skew' => self::DEFAULT_SKEW_SECONDS, + ], $config); + + $assertion = [ + 'iss' => $this->getIssuer(), + 'exp' => ($now + $this->getExpiry()), + 'iat' => ($now - $opts['skew']), + ]; + foreach ($assertion as $k => $v) { + if (is_null($v)) { + throw new \DomainException($k . ' should not be null'); + } + } + if (!(is_null($this->getAudience()))) { + $assertion['aud'] = $this->getAudience(); + } + + if (!(is_null($this->getScope()))) { + $assertion['scope'] = $this->getScope(); + } + + if (empty($assertion['scope']) && empty($assertion['aud'])) { + throw new \DomainException('one of scope or aud should not be null'); + } + + if (!(is_null($this->getSub()))) { + $assertion['sub'] = $this->getSub(); + } + $assertion += $this->getAdditionalClaims(); + + return JWT::encode( + $assertion, + $this->getSigningKey(), + $this->getSigningAlgorithm(), + $this->getSigningKeyId() + ); + } + + /** + * Generates a request for token credentials. + * + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array $headers [optional] Additional headers to pass to + * the token endpoint request. + * @return RequestInterface the authorization Url. + */ + public function generateCredentialsRequest(?callable $httpHandler = null, array $headers = []) + { + $uri = $this->getTokenCredentialUri(); + if (is_null($uri)) { + throw new \DomainException('No token credential URI was set.'); + } + + $grantType = $this->getGrantType(); + $params = ['grant_type' => $grantType]; + switch ($grantType) { + case 'authorization_code': + $params['code'] = $this->getCode(); + $params['redirect_uri'] = $this->getRedirectUri(); + if ($this->codeVerifier) { + $params['code_verifier'] = $this->codeVerifier; + } + $this->addClientCredentials($params); + break; + case 'password': + $params['username'] = $this->getUsername(); + $params['password'] = $this->getPassword(); + $this->addClientCredentials($params); + break; + case 'refresh_token': + $params['refresh_token'] = $this->getRefreshToken(); + if (isset($this->getAdditionalClaims()['target_audience'])) { + $params['target_audience'] = $this->getAdditionalClaims()['target_audience']; + } + $this->addClientCredentials($params); + break; + case self::JWT_URN: + $params['assertion'] = $this->toJwt(); + break; + case self::STS_URN: + $token = $this->subjectTokenFetcher->fetchSubjectToken($httpHandler); + $params['subject_token'] = $token; + $params['subject_token_type'] = $this->subjectTokenType; + $params += array_filter([ + 'resource' => $this->resource, + 'audience' => $this->audience, + 'scope' => $this->getScope(), + 'requested_token_type' => self::STS_REQUESTED_TOKEN_TYPE, + 'actor_token' => $this->actorToken, + 'actor_token_type' => $this->actorTokenType, + ]); + if ($this->additionalOptions) { + $params['options'] = json_encode($this->additionalOptions); + } + break; + default: + if (!is_null($this->getRedirectUri())) { + # Grant type was supposed to be 'authorization_code', as there + # is a redirect URI. + throw new \DomainException('Missing authorization code'); + } + unset($params['grant_type']); + if (!is_null($grantType)) { + $params['grant_type'] = $grantType; + } + $params = array_merge($params, $this->getExtensionParams()); + } + + $headers = [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ] + $headers; + + return new Request( + 'POST', + $uri, + $headers, + Query::build($params) + ); + } + + /** + * Fetches the auth tokens based on the current state. + * + * @param callable|null $httpHandler callback which delivers psr7 request + * @param array $headers [optional] If present, add these headers to the token + * endpoint request. + * @return array the response + */ + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $response = $httpHandler($this->generateCredentialsRequest($httpHandler, $headers)); + $credentials = $this->parseTokenResponse($response); + $this->updateToken($credentials); + if (isset($credentials['scope'])) { + $this->setGrantedScope($credentials['scope']); + } + + return $credentials; + } + + /** + * @deprecated + * + * Obtains a key that can used to cache the results of #fetchAuthToken. + * + * The key is derived from the scopes. + * + * @return ?string a key that may be used to cache the auth token. + */ + public function getCacheKey() + { + if (is_array($this->scope)) { + return implode(':', $this->scope); + } + + if ($this->audience) { + return $this->audience; + } + + // If scope has not set, return null to indicate no caching. + return null; + } + + /** + * Gets this instance's SubjectTokenFetcher + * + * @return null|ExternalAccountCredentialSourceInterface + */ + public function getSubjectTokenFetcher(): ?ExternalAccountCredentialSourceInterface + { + return $this->subjectTokenFetcher; + } + + /** + * Parses the fetched tokens. + * + * @param ResponseInterface $resp the response. + * @return array the tokens parsed from the response body. + * @throws \Exception + */ + public function parseTokenResponse(ResponseInterface $resp) + { + $body = (string) $resp->getBody(); + if ($resp->hasHeader('Content-Type') && + $resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded' + ) { + $res = []; + parse_str($body, $res); + + return $res; + } + + // Assume it's JSON; if it's not throw an exception + if (null === $res = json_decode($body, true)) { + throw new \Exception('Invalid JSON response'); + } + + return $res; + } + + /** + * Updates an OAuth 2.0 client. + * + * Example: + * ``` + * $oauth->updateToken([ + * 'refresh_token' => 'n4E9O119d', + * 'access_token' => 'FJQbwq9', + * 'expires_in' => 3600 + * ]); + * ``` + * + * @param array $config + * The configuration parameters related to the token. + * + * - refresh_token + * The refresh token associated with the access token + * to be refreshed. + * + * - access_token + * The current access token for this client. + * + * - id_token + * The current ID token for this client. + * + * - expires_in + * The time in seconds until access token expiration. + * + * - expires_at + * The time as an integer number of seconds since the Epoch + * + * - issued_at + * The timestamp that the token was issued at. + * @return void + */ + public function updateToken(array $config) + { + $opts = array_merge([ + 'extensionParams' => [], + 'access_token' => null, + 'id_token' => null, + 'expires_in' => null, + 'expires_at' => null, + 'issued_at' => null, + 'scope' => null, + ], $config); + + $this->setExpiresAt($opts['expires_at']); + $this->setExpiresIn($opts['expires_in']); + // By default, the token is issued at `Time.now` when `expiresIn` is set, + // but this can be used to supply a more precise time. + if (!is_null($opts['issued_at'])) { + $this->setIssuedAt($opts['issued_at']); + } + + $this->setAccessToken($opts['access_token']); + $this->setIdToken($opts['id_token']); + + // The refresh token should only be updated if a value is explicitly + // passed in, as some access token responses do not include a refresh + // token. + if (array_key_exists('refresh_token', $opts)) { + $this->setRefreshToken($opts['refresh_token']); + } + + // Required for STS response. An identifier for the representation of + // the issued security token. + if (array_key_exists('issued_token_type', $opts)) { + $this->issuedTokenType = $opts['issued_token_type']; + } + } + + /** + * Builds the authorization Uri that the user should be redirected to. + * + * @param array $config configuration options that customize the return url. + * @return UriInterface the authorization Url. + * @throws InvalidArgumentException + */ + public function buildFullAuthorizationUri(array $config = []) + { + if (is_null($this->getAuthorizationUri())) { + throw new InvalidArgumentException( + 'requires an authorizationUri to have been set' + ); + } + + $params = array_merge([ + 'response_type' => 'code', + 'access_type' => 'offline', + 'client_id' => $this->clientId, + 'redirect_uri' => $this->redirectUri, + 'state' => $this->state, + 'scope' => $this->getScope(), + ], $config); + + // Validate the auth_params + if (is_null($params['client_id'])) { + throw new InvalidArgumentException( + 'missing the required client identifier' + ); + } + if (is_null($params['redirect_uri'])) { + throw new InvalidArgumentException('missing the required redirect URI'); + } + if (!empty($params['prompt']) && !empty($params['approval_prompt'])) { + throw new InvalidArgumentException( + 'prompt and approval_prompt are mutually exclusive' + ); + } + if ($this->codeVerifier) { + $params['code_challenge'] = $this->getCodeChallenge($this->codeVerifier); + $params['code_challenge_method'] = $this->getCodeChallengeMethod(); + } + + // Construct the uri object; return it if it is valid. + $result = clone $this->authorizationUri; + $existingParams = Query::parse($result->getQuery()); + + $result = $result->withQuery( + Query::build(array_merge($existingParams, $params)) + ); + + if ($result->getScheme() != 'https') { + throw new InvalidArgumentException( + 'Authorization endpoint must be protected by TLS' + ); + } + + return $result; + } + + /** + * @return string|null + */ + public function getCodeVerifier(): ?string + { + return $this->codeVerifier; + } + + /** + * A cryptographically random string that is used to correlate the + * authorization request to the token request. + * + * The code verifier for PKCE for OAuth 2.0. When set, the authorization + * URI will contain the Code Challenge and Code Challenge Method querystring + * parameters, and the token URI will contain the Code Verifier parameter. + * + * @see https://datatracker.ietf.org/doc/html/rfc7636 + * + * @param string|null $codeVerifier + */ + public function setCodeVerifier(?string $codeVerifier): void + { + $this->codeVerifier = $codeVerifier; + } + + /** + * Generates a random 128-character string for the "code_verifier" parameter + * in PKCE for OAuth 2.0. This is a cryptographically random string that is + * determined using random_int, hashed using "hash" and sha256, and base64 + * encoded. + * + * When this method is called, the code verifier is set on the object. + * + * @return string + */ + public function generateCodeVerifier(): string + { + return $this->codeVerifier = $this->generateRandomString(128); + } + + private function getCodeChallenge(string $randomString): string + { + return rtrim(strtr(base64_encode(hash('sha256', $randomString, true)), '+/', '-_'), '='); + } + + private function getCodeChallengeMethod(): string + { + return 'S256'; + } + + private function generateRandomString(int $length): string + { + $validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~'; + $validCharsLen = strlen($validChars); + $str = ''; + $i = 0; + while ($i++ < $length) { + $str .= $validChars[random_int(0, $validCharsLen - 1)]; + } + return $str; + } + + /** + * Sets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @param string $uri + * @return void + */ + public function setAuthorizationUri($uri) + { + $this->authorizationUri = $this->coerceUri($uri); + } + + /** + * Gets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @return ?UriInterface + */ + public function getAuthorizationUri() + { + return $this->authorizationUri; + } + + /** + * Gets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @return ?UriInterface + */ + public function getTokenCredentialUri() + { + return $this->tokenCredentialUri; + } + + /** + * Sets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @param string $uri + * @return void + */ + public function setTokenCredentialUri($uri) + { + $this->tokenCredentialUri = $this->coerceUri($uri); + } + + /** + * Gets the redirection URI used in the initial request. + * + * @return ?string + */ + public function getRedirectUri() + { + return $this->redirectUri; + } + + /** + * Sets the redirection URI used in the initial request. + * + * @param ?string $uri + * @return void + */ + public function setRedirectUri($uri) + { + if (is_null($uri)) { + $this->redirectUri = null; + + return; + } + // redirect URI must be absolute + if (!$this->isAbsoluteUri($uri)) { + // "postmessage" is a reserved URI string in Google-land + // @see https://developers.google.com/identity/sign-in/web/server-side-flow + if ('postmessage' !== (string) $uri) { + throw new InvalidArgumentException( + 'Redirect URI must be absolute' + ); + } + } + $this->redirectUri = (string) $uri; + } + + /** + * Gets the scope of the access requests as a space-delimited String. + * + * @return ?string + */ + public function getScope() + { + if (is_null($this->scope)) { + return $this->scope; + } + + return implode(' ', $this->scope); + } + + /** + * Gets the subject token type + * + * @return ?string + */ + public function getSubjectTokenType(): ?string + { + return $this->subjectTokenType; + } + + /** + * Sets the scope of the access request, expressed either as an Array or as + * a space-delimited String. + * + * @param string|array|null $scope + * @return void + * @throws InvalidArgumentException + */ + public function setScope($scope) + { + if (is_null($scope)) { + $this->scope = null; + } elseif (is_string($scope)) { + $this->scope = explode(' ', $scope); + } elseif (is_array($scope)) { + foreach ($scope as $s) { + $pos = strpos($s, ' '); + if ($pos !== false) { + throw new InvalidArgumentException( + 'array scope values should not contain spaces' + ); + } + } + $this->scope = $scope; + } else { + throw new InvalidArgumentException( + 'scopes should be a string or array of strings' + ); + } + } + + /** + * Gets the current grant type. + * + * @return ?string + */ + public function getGrantType() + { + if (!is_null($this->grantType)) { + return $this->grantType; + } + + // Returns the inferred grant type, based on the current object instance + // state. + if (!is_null($this->code)) { + return 'authorization_code'; + } + + if (!is_null($this->refreshToken)) { + return 'refresh_token'; + } + + if (!is_null($this->username) && !is_null($this->password)) { + return 'password'; + } + + if (!is_null($this->issuer) && !is_null($this->signingKey)) { + return self::JWT_URN; + } + + if (!is_null($this->subjectTokenFetcher) && !is_null($this->subjectTokenType)) { + return self::STS_URN; + } + + return null; + } + + /** + * Sets the current grant type. + * + * @param string $grantType + * @return void + * @throws InvalidArgumentException + */ + public function setGrantType($grantType) + { + if (in_array($grantType, self::$knownGrantTypes)) { + $this->grantType = $grantType; + } else { + // validate URI + if (!$this->isAbsoluteUri($grantType)) { + throw new InvalidArgumentException( + 'invalid grant type' + ); + } + $this->grantType = (string) $grantType; + } + } + + /** + * Gets an arbitrary string designed to allow the client to maintain state. + * + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Sets an arbitrary string designed to allow the client to maintain state. + * + * @param string $state + * @return void + */ + public function setState($state) + { + $this->state = $state; + } + + /** + * Gets the authorization code issued to this client. + * + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * Sets the authorization code issued to this client. + * + * @param string $code + * @return void + */ + public function setCode($code) + { + $this->code = $code; + } + + /** + * Gets the resource owner's username. + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the resource owner's username. + * + * @param string $username + * @return void + */ + public function setUsername($username) + { + $this->username = $username; + } + + /** + * Gets the resource owner's password. + * + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the resource owner's password. + * + * @param string $password + * @return void + */ + public function setPassword($password) + { + $this->password = $password; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + * + * @return string + */ + public function getClientId() + { + return $this->clientId; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + * + * @param string $clientId + * @return void + */ + public function setClientId($clientId) + { + $this->clientId = $clientId; + } + + /** + * Gets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + * + * @return string + */ + public function getClientSecret() + { + return $this->clientSecret; + } + + /** + * Sets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + * + * @param string $clientSecret + * @return void + */ + public function setClientSecret($clientSecret) + { + $this->clientSecret = $clientSecret; + } + + /** + * Gets the Issuer ID when using assertion profile. + * + * @return ?string + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Sets the Issuer ID when using assertion profile. + * + * @param string $issuer + * @return void + */ + public function setIssuer($issuer) + { + $this->issuer = $issuer; + } + + /** + * Gets the target sub when issuing assertions. + * + * @return ?string + */ + public function getSub() + { + return $this->sub; + } + + /** + * Sets the target sub when issuing assertions. + * + * @param string $sub + * @return void + */ + public function setSub($sub) + { + $this->sub = $sub; + } + + /** + * Gets the target audience when issuing assertions. + * + * @return ?string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Sets the target audience when issuing assertions. + * + * @param string $audience + * @return void + */ + public function setAudience($audience) + { + $this->audience = $audience; + } + + /** + * Gets the signing key when using an assertion profile. + * + * @return ?string + */ + public function getSigningKey() + { + return $this->signingKey; + } + + /** + * Sets the signing key when using an assertion profile. + * + * @param string $signingKey + * @return void + */ + public function setSigningKey($signingKey) + { + $this->signingKey = $signingKey; + } + + /** + * Gets the signing key id when using an assertion profile. + * + * @return ?string + */ + public function getSigningKeyId() + { + return $this->signingKeyId; + } + + /** + * Sets the signing key id when using an assertion profile. + * + * @param string $signingKeyId + * @return void + */ + public function setSigningKeyId($signingKeyId) + { + $this->signingKeyId = $signingKeyId; + } + + /** + * Gets the signing algorithm when using an assertion profile. + * + * @return ?string + */ + public function getSigningAlgorithm() + { + return $this->signingAlgorithm; + } + + /** + * Sets the signing algorithm when using an assertion profile. + * + * @param ?string $signingAlgorithm + * @return void + */ + public function setSigningAlgorithm($signingAlgorithm) + { + if (is_null($signingAlgorithm)) { + $this->signingAlgorithm = null; + } elseif (!in_array($signingAlgorithm, self::$knownSigningAlgorithms)) { + throw new InvalidArgumentException('unknown signing algorithm'); + } else { + $this->signingAlgorithm = $signingAlgorithm; + } + } + + /** + * Gets the set of parameters used by extension when using an extension + * grant type. + * + * @return array + */ + public function getExtensionParams() + { + return $this->extensionParams; + } + + /** + * Sets the set of parameters used by extension when using an extension + * grant type. + * + * @param array $extensionParams + * @return void + */ + public function setExtensionParams($extensionParams) + { + $this->extensionParams = $extensionParams; + } + + /** + * Gets the number of seconds assertions are valid for. + * + * @return int + */ + public function getExpiry() + { + return $this->expiry; + } + + /** + * Sets the number of seconds assertions are valid for. + * + * @param int $expiry + * @return void + */ + public function setExpiry($expiry) + { + $this->expiry = $expiry; + } + + /** + * Gets the lifetime of the access token in seconds. + * + * @return int + */ + public function getExpiresIn() + { + return $this->expiresIn; + } + + /** + * Sets the lifetime of the access token in seconds. + * + * @param ?int $expiresIn + * @return void + */ + public function setExpiresIn($expiresIn) + { + if (is_null($expiresIn)) { + $this->expiresIn = null; + $this->issuedAt = null; + } else { + $this->issuedAt = time(); + $this->expiresIn = (int) $expiresIn; + } + } + + /** + * Gets the time the current access token expires at. + * + * @return ?int + */ + public function getExpiresAt() + { + if (!is_null($this->expiresAt)) { + return $this->expiresAt; + } + + if (!is_null($this->issuedAt) && !is_null($this->expiresIn)) { + return $this->issuedAt + $this->expiresIn; + } + + return null; + } + + /** + * Returns true if the acccess token has expired. + * + * @return bool + */ + public function isExpired() + { + $expiration = $this->getExpiresAt(); + $now = time(); + + return !is_null($expiration) && $now >= $expiration; + } + + /** + * Sets the time the current access token expires at. + * + * @param int $expiresAt + * @return void + */ + public function setExpiresAt($expiresAt) + { + $this->expiresAt = $expiresAt; + } + + /** + * Gets the time the current access token was issued at. + * + * @return ?int + */ + public function getIssuedAt() + { + return $this->issuedAt; + } + + /** + * Sets the time the current access token was issued at. + * + * @param int $issuedAt + * @return void + */ + public function setIssuedAt($issuedAt) + { + $this->issuedAt = $issuedAt; + } + + /** + * Gets the current access token. + * + * @return ?string + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the current access token. + * + * @param string $accessToken + * @return void + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + } + + /** + * Gets the current ID token. + * + * @return ?string + */ + public function getIdToken() + { + return $this->idToken; + } + + /** + * Sets the current ID token. + * + * @param string $idToken + * @return void + */ + public function setIdToken($idToken) + { + $this->idToken = $idToken; + } + + /** + * Get the granted space-separated scopes (if they exist) for the last + * fetched token. + * + * @return string|null + */ + public function getGrantedScope() + { + return $this->grantedScope; + } + + /** + * Sets the current ID token. + * + * @param string $grantedScope + * @return void + */ + public function setGrantedScope($grantedScope) + { + $this->grantedScope = $grantedScope; + } + + /** + * Gets the refresh token associated with the current access token. + * + * @return ?string + */ + public function getRefreshToken() + { + return $this->refreshToken; + } + + /** + * Sets the refresh token associated with the current access token. + * + * @param string $refreshToken + * @return void + */ + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + } + + /** + * Sets additional claims to be included in the JWT token + * + * @param array $additionalClaims + * @return void + */ + public function setAdditionalClaims(array $additionalClaims) + { + $this->additionalClaims = $additionalClaims; + } + + /** + * Gets the additional claims to be included in the JWT token. + * + * @return array + */ + public function getAdditionalClaims() + { + return $this->additionalClaims; + } + + /** + * Gets the additional claims to be included in the JWT token. + * + * @return ?string + */ + public function getIssuedTokenType() + { + return $this->issuedTokenType; + } + + /** + * The expiration of the last received token. + * + * @return array|null + */ + public function getLastReceivedToken() + { + if ($token = $this->getAccessToken()) { + // the bare necessity of an auth token + $authToken = [ + 'access_token' => $token, + 'expires_at' => $this->getExpiresAt(), + ]; + } elseif ($idToken = $this->getIdToken()) { + $authToken = [ + 'id_token' => $idToken, + 'expires_at' => $this->getExpiresAt(), + ]; + } else { + return null; + } + + if ($expiresIn = $this->getExpiresIn()) { + $authToken['expires_in'] = $expiresIn; + } + if ($issuedAt = $this->getIssuedAt()) { + $authToken['issued_at'] = $issuedAt; + } + if ($refreshToken = $this->getRefreshToken()) { + $authToken['refresh_token'] = $refreshToken; + } + + return $authToken; + } + + /** + * Get the client ID. + * + * Alias of {@see OAuth2::getClientId()}. + * + * @param callable|null $httpHandler + * @return string + * @access private + */ + public function getClientName(?callable $httpHandler = null) + { + return $this->getClientId(); + } + + /** + * @todo handle uri as array + * + * @param ?string $uri + * @return null|UriInterface + */ + private function coerceUri($uri) + { + if (is_null($uri)) { + return null; + } + + return Utils::uriFor($uri); + } + + /** + * @param string $idToken + * @param Key|Key[]|string|string[] $publicKey + * @param string|string[] $allowedAlgs + * @return object + */ + private function jwtDecode($idToken, $publicKey, $allowedAlgs) + { + $keys = $this->getFirebaseJwtKeys($publicKey, $allowedAlgs); + + // Default exception if none are caught. We are using the same exception + // class and message from firebase/php-jwt to preserve backwards + // compatibility. + $e = new \InvalidArgumentException('Key may not be empty'); + foreach ($keys as $key) { + try { + return JWT::decode($idToken, $key); + } catch (\Exception $e) { + // try next alg + } + } + throw $e; + } + + /** + * @param Key|Key[]|string|string[] $publicKey + * @param string|string[] $allowedAlgs + * @return Key[] + */ + private function getFirebaseJwtKeys($publicKey, $allowedAlgs) + { + // If $publicKey is instance of Key, return it + if ($publicKey instanceof Key) { + return [$publicKey]; + } + + // If $allowedAlgs is empty, $publicKey must be Key or Key[]. + if (empty($allowedAlgs)) { + $keys = []; + foreach ((array) $publicKey as $kid => $pubKey) { + if (!$pubKey instanceof Key) { + throw new \InvalidArgumentException(sprintf( + 'When allowed algorithms is empty, the public key must' + . 'be an instance of %s or an array of %s objects', + Key::class, + Key::class + )); + } + $keys[$kid] = $pubKey; + } + return $keys; + } + + $allowedAlg = null; + if (is_string($allowedAlgs)) { + $allowedAlg = $allowedAlgs; + } elseif (is_array($allowedAlgs)) { + if (count($allowedAlgs) > 1) { + throw new \InvalidArgumentException( + 'To have multiple allowed algorithms, You must provide an' + . ' array of Firebase\JWT\Key objects.' + . ' See https://github.com/firebase/php-jwt for more information.' + ); + } + $allowedAlg = array_pop($allowedAlgs); + } else { + throw new \InvalidArgumentException('allowed algorithms must be a string or array.'); + } + + if (is_array($publicKey)) { + // When publicKey is greater than 1, create keys with the single alg. + $keys = []; + foreach ($publicKey as $kid => $pubKey) { + if ($pubKey instanceof Key) { + $keys[$kid] = $pubKey; + } else { + $keys[$kid] = new Key($pubKey, $allowedAlg); + } + } + return $keys; + } + + return [new Key($publicKey, $allowedAlg)]; + } + + /** + * Determines if the URI is absolute based on its scheme and host or path + * (RFC 3986). + * + * @param string $uri + * @return bool + */ + private function isAbsoluteUri($uri) + { + $uri = $this->coerceUri($uri); + + return $uri->getScheme() && ($uri->getHost() || $uri->getPath()); + } + + /** + * @param array $params + * @return array + */ + private function addClientCredentials(&$params) + { + $clientId = $this->getClientId(); + $clientSecret = $this->getClientSecret(); + + if ($clientId && $clientSecret) { + $params['client_id'] = $clientId; + $params['client_secret'] = $clientSecret; + } + + return $params; + } +} diff --git a/vendor/google/auth/src/ProjectIdProviderInterface.php b/vendor/google/auth/src/ProjectIdProviderInterface.php new file mode 100644 index 0000000..8d10c29 --- /dev/null +++ b/vendor/google/auth/src/ProjectIdProviderInterface.php @@ -0,0 +1,32 @@ +auth->getSigningKey(); + + $signedString = ''; + if (class_exists(phpseclib3\Crypt\RSA::class) && !$forceOpenssl) { + $key = PublicKeyLoader::load($privateKey); + $rsa = $key->withHash('sha256')->withPadding(RSA::SIGNATURE_PKCS1); + + $signedString = $rsa->sign($stringToSign); + } elseif (extension_loaded('openssl')) { + openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption'); + } else { + // @codeCoverageIgnoreStart + throw new \RuntimeException('OpenSSL is not installed.'); + } + // @codeCoverageIgnoreEnd + + return base64_encode($signedString); + } +} diff --git a/vendor/google/auth/src/SignBlobInterface.php b/vendor/google/auth/src/SignBlobInterface.php new file mode 100644 index 0000000..b3c2b05 --- /dev/null +++ b/vendor/google/auth/src/SignBlobInterface.php @@ -0,0 +1,44 @@ + $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + ?callable $httpHandler = null + ); +} diff --git a/vendor/google/auth/src/UpdateMetadataTrait.php b/vendor/google/auth/src/UpdateMetadataTrait.php new file mode 100644 index 0000000..486ec72 --- /dev/null +++ b/vendor/google/auth/src/UpdateMetadataTrait.php @@ -0,0 +1,74 @@ + $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable|null $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + ?callable $httpHandler = null + ) { + $metadata_copy = $metadata; + + // We do need to set the service api usage metrics irrespective even if + // the auth token is set because invoking this method with auth tokens + // would mean the intention is to just explicitly set the metrics metadata. + $metadata_copy = $this->applyServiceApiUsageMetrics($metadata_copy); + + if (isset($metadata_copy[self::AUTH_METADATA_KEY])) { + // Auth metadata has already been set + return $metadata_copy; + } + $result = $this->fetchAuthToken($httpHandler); + if (isset($result['access_token'])) { + $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['access_token']]; + } elseif (isset($result['id_token'])) { + $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['id_token']]; + } + return $metadata_copy; + } +} diff --git a/vendor/google/cloud-dialogflow/.gitattributes b/vendor/google/cloud-dialogflow/.gitattributes new file mode 100644 index 0000000..3e957a6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/tests export-ignore +/.github export-ignore +/samples export-ignore +/.OwlBot.yaml export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore diff --git a/vendor/google/cloud-dialogflow/.owlbot/create_conversation_model_sample_fix.patch b/vendor/google/cloud-dialogflow/.owlbot/create_conversation_model_sample_fix.patch new file mode 100644 index 0000000..400f5af --- /dev/null +++ b/vendor/google/cloud-dialogflow/.owlbot/create_conversation_model_sample_fix.patch @@ -0,0 +1,21 @@ +diff --git a/Dialogflow/samples/V2/ConversationModelsClient/create_conversation_model.php b/Dialogflow/samples/V2/ConversationModelsClient/create_conversation_model.php +index 6f11d9f9524..a7a4ddb6fa8 100644 +--- a/Dialogflow/samples/V2/ConversationModelsClient/create_conversation_model.php ++++ b/Dialogflow/samples/V2/ConversationModelsClient/create_conversation_model.php +@@ -26,6 +26,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php'; + use Google\ApiCore\ApiException; + use Google\ApiCore\OperationResponse; + use Google\Cloud\Dialogflow\V2\ConversationModel; ++use Google\Cloud\Dialogflow\V2\ConversationDatasetsClient; + use Google\Cloud\Dialogflow\V2\ConversationModelsClient; + use Google\Cloud\Dialogflow\V2\InputDataset; + use Google\Rpc\Status; +@@ -93,7 +94,7 @@ function create_conversation_model_sample( + function callSample(): void + { + $conversationModelDisplayName = '[DISPLAY_NAME]'; +- $formattedConversationModelDatasetsDataset = ConversationModelsClient::conversationDatasetName( ++ $formattedConversationModelDatasetsDataset = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' diff --git a/vendor/google/cloud-dialogflow/CODE_OF_CONDUCT.md b/vendor/google/cloud-dialogflow/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c372780 --- /dev/null +++ b/vendor/google/cloud-dialogflow/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) \ No newline at end of file diff --git a/vendor/google/cloud-dialogflow/CONTRIBUTING.md b/vendor/google/cloud-dialogflow/CONTRIBUTING.md new file mode 100644 index 0000000..76ea811 --- /dev/null +++ b/vendor/google/cloud-dialogflow/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/vendor/google/cloud-dialogflow/LICENSE b/vendor/google/cloud-dialogflow/LICENSE new file mode 100644 index 0000000..8f71f43 --- /dev/null +++ b/vendor/google/cloud-dialogflow/LICENSE @@ -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 {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. + diff --git a/vendor/google/cloud-dialogflow/README.md b/vendor/google/cloud-dialogflow/README.md new file mode 100644 index 0000000..3be307e --- /dev/null +++ b/vendor/google/cloud-dialogflow/README.md @@ -0,0 +1,73 @@ +# Google Cloud Dialogflow for PHP + +> Idiomatic PHP client for [Google Cloud Dialogflow](https://cloud.google.com/dialogflow-enterprise/). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-dialogflow/v/stable)](https://packagist.org/packages/google/cloud-dialogflow) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-dialogflow.svg)](https://packagist.org/packages/google/cloud-dialogflow) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-dialogflow/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +Dialogflow Enterprise Edition is the enterprise tier of Dialogflow which is a natural language understanding platform +that makes it easy for you to design and integrate a conversational user interface into your mobile app, web application, +device, bot, and so on. Using Dialogflow you can provide users new and engaging ways to interact with your product using +both voice recognition and text input. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now install this component: + +```sh +$ composer require google/cloud-dialogflow +``` + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) +please see our [gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +```php +require 'vendor/autoload.php'; + +use Google\Cloud\Dialogflow\V2\EntityTypesClient; + +$entityTypesClient = new EntityTypesClient(); +$projectId = '[MY_PROJECT_ID]'; +$entityTypeId = '[ENTITY_TYPE_ID]'; +$formattedEntityTypeName = $entityTypesClient->entityTypeName($projectId, $entityTypeId); + +$entityType = $entityTypesClient->getEntityType($formattedEntityTypeName); +foreach ($entityType->getEntities() as $entity) { + print(PHP_EOL); + printf('Entity value: %s' . PHP_EOL, $entity->getValue()); + print('Synonyms: '); + foreach ($entity->getSynonyms() as $synonym) { + print($synonym . "\t"); + } + print(PHP_EOL); +} +``` + +### Debugging + +Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) +for more information about the debugging tools. + +### Version + +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/dialogflow-enterprise/docs/). +2. Take a look at [in-depth usage samples](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/dialogflow). diff --git a/vendor/google/cloud-dialogflow/SECURITY.md b/vendor/google/cloud-dialogflow/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/cloud-dialogflow/VERSION b/vendor/google/cloud-dialogflow/VERSION new file mode 100644 index 0000000..ccbccc3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/VERSION @@ -0,0 +1 @@ +2.2.0 diff --git a/vendor/google/cloud-dialogflow/composer.json b/vendor/google/cloud-dialogflow/composer.json new file mode 100644 index 0000000..988f49a --- /dev/null +++ b/vendor/google/cloud-dialogflow/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/cloud-dialogflow", + "description": "Google Cloud Dialogflow Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\Dialogflow\\": "src", + "GPBMetadata\\Google\\Cloud\\Dialogflow\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-dialogflow", + "path": "Dialogflow", + "entry": null, + "target": "googleapis/google-cloud-php-dialogflow.git" + } + }, + "require": { + "php": "^8.1", + "google/gax": "^1.38.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "google/cloud-core": "^1.52.7" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google." + } +} diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Agent.php b/vendor/google/cloud-dialogflow/metadata/V2/Agent.php new file mode 100644 index 0000000..4a07bdf Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Agent.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/AnswerRecord.php b/vendor/google/cloud-dialogflow/metadata/V2/AnswerRecord.php new file mode 100644 index 0000000..fb3c80f Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/AnswerRecord.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/AudioConfig.php b/vendor/google/cloud-dialogflow/metadata/V2/AudioConfig.php new file mode 100644 index 0000000..e2b2c7a Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/AudioConfig.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Context.php b/vendor/google/cloud-dialogflow/metadata/V2/Context.php new file mode 100644 index 0000000..cabe397 --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/Context.php @@ -0,0 +1,70 @@ +internalAddGeneratedFile( + ' +" +(google/cloud/dialogflow/v2/context.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.proto" +Context +name ( BA +lifespan_count (BA0 + +parameters ( 2.google.protobuf.StructBA:A +!dialogflow.googleapis.com/Context>projects/{project}/agent/sessions/{session}/contexts/{context}fprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}" +ListContextsRequest9 +parent ( B)AA#!dialogflow.googleapis.com/Context + page_size (BA + +page_token ( BA"f +ListContextsResponse5 +contexts ( 2#.google.cloud.dialogflow.v2.Context +next_page_token ( "L +GetContextRequest7 +name ( B)AA# +!dialogflow.googleapis.com/Context" +CreateContextRequest9 +parent ( B)AA#!dialogflow.googleapis.com/Context9 +context ( 2#.google.cloud.dialogflow.v2.ContextBA" +UpdateContextRequest9 +context ( 2#.google.cloud.dialogflow.v2.ContextBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"O +DeleteContextRequest7 +name ( B)AA# +!dialogflow.googleapis.com/Context"U +DeleteAllContextsRequest9 +parent ( B)AA#!dialogflow.googleapis.com/Context2 +Contexts + ListContexts/.google.cloud.dialogflow.v2.ListContextsRequest0.google.cloud.dialogflow.v2.ListContextsResponse"Aparent1/v2/{parent=projects/*/agent/sessions/*}/contextsZJH/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZVT/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts + +GetContext-.google.cloud.dialogflow.v2.GetContextRequest#.google.cloud.dialogflow.v2.Context"Aname1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJH/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZVT/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*} + CreateContext0.google.cloud.dialogflow.v2.CreateContextRequest#.google.cloud.dialogflow.v2.Context"Aparent,context"1/v2/{parent=projects/*/agent/sessions/*}/contexts:contextZS"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:contextZH"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:contextZ_"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:context + UpdateContext0.google.cloud.dialogflow.v2.UpdateContextRequest#.google.cloud.dialogflow.v2.Context"Acontext,update_mask29/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:contextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:contextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:contextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:context + DeleteContext0.google.cloud.dialogflow.v2.DeleteContextRequest.google.protobuf.Empty"Aname*1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ*H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?*=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV*T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*} +DeleteAllContexts4.google.cloud.dialogflow.v2.DeleteAllContextsRequest.google.protobuf.Empty"Aparent*1/v2/{parent=projects/*/agent/sessions/*}/contextsZJ*H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?*=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV*T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contextsxAdialogflow.googleapis.comAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB +com.google.cloud.dialogflow.v2B ContextProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Conversation.php b/vendor/google/cloud-dialogflow/metadata/V2/Conversation.php new file mode 100644 index 0000000..5068ac2 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Conversation.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/ConversationDataset.php b/vendor/google/cloud-dialogflow/metadata/V2/ConversationDataset.php new file mode 100644 index 0000000..1d9e200 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/ConversationDataset.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/ConversationEvent.php b/vendor/google/cloud-dialogflow/metadata/V2/ConversationEvent.php new file mode 100644 index 0000000..7e7b2b9 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/ConversationEvent.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/ConversationModel.php b/vendor/google/cloud-dialogflow/metadata/V2/ConversationModel.php new file mode 100644 index 0000000..7bc132a Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/ConversationModel.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/ConversationProfile.php b/vendor/google/cloud-dialogflow/metadata/V2/ConversationProfile.php new file mode 100644 index 0000000..f1e997f Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/ConversationProfile.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Document.php b/vendor/google/cloud-dialogflow/metadata/V2/Document.php new file mode 100644 index 0000000..207e55a Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Document.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/EncryptionSpec.php b/vendor/google/cloud-dialogflow/metadata/V2/EncryptionSpec.php new file mode 100644 index 0000000..8e17a39 --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/EncryptionSpec.php @@ -0,0 +1,48 @@ +internalAddGeneratedFile( + ' + +0google/cloud/dialogflow/v2/encryption_spec.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto"Z +GetEncryptionSpecRequest> +name ( B0AA* +(dialogflow.googleapis.com/EncryptionSpec" +EncryptionSpec +name ( BA +kms_key ( BA:A +(dialogflow.googleapis.com/EncryptionSpec6projects/{project}/locations/{location}/encryptionSpec*encryptionSpecs2encryptionSpec"k +InitializeEncryptionSpecRequestH +encryption_spec ( 2*.google.cloud.dialogflow.v2.EncryptionSpecBA"" + InitializeEncryptionSpecResponse"u + InitializeEncryptionSpecMetadataQ +request ( 2;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestBA2 +EncryptionSpecService +GetEncryptionSpec4.google.cloud.dialogflow.v2.GetEncryptionSpecRequest*.google.cloud.dialogflow.v2.EncryptionSpec"?Aname20/v2/{name=projects/*/locations/*/encryptionSpec} +InitializeEncryptionSpec;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest.google.longrunning.Operation"AD + InitializeEncryptionSpecResponse InitializeEncryptionSpecMetadataAencryption_specP"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:*xAdialogflow.googleapis.comAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB +com.google.cloud.dialogflow.v2BEncryptionSpecProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/metadata/V2/EntityType.php b/vendor/google/cloud-dialogflow/metadata/V2/EntityType.php new file mode 100644 index 0000000..4c6b3d2 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/EntityType.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Environment.php b/vendor/google/cloud-dialogflow/metadata/V2/Environment.php new file mode 100644 index 0000000..6f2ebb1 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Environment.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Fulfillment.php b/vendor/google/cloud-dialogflow/metadata/V2/Fulfillment.php new file mode 100644 index 0000000..0fe45f2 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Fulfillment.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Gcs.php b/vendor/google/cloud-dialogflow/metadata/V2/Gcs.php new file mode 100644 index 0000000..17288a5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/Gcs.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +$google/cloud/dialogflow/v2/gcs.protogoogle.cloud.dialogflow.v2" + +GcsSources +uris ( BA" +GcsDestination +uri ( B +com.google.cloud.dialogflow.v2BGcsProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Generator.php b/vendor/google/cloud-dialogflow/metadata/V2/Generator.php new file mode 100644 index 0000000..353fab3 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Generator.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/HumanAgentAssistantEvent.php b/vendor/google/cloud-dialogflow/metadata/V2/HumanAgentAssistantEvent.php new file mode 100644 index 0000000..b3a1cbe --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/HumanAgentAssistantEvent.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Intent.php b/vendor/google/cloud-dialogflow/metadata/V2/Intent.php new file mode 100644 index 0000000..3b9d4d8 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Intent.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/KnowledgeBase.php b/vendor/google/cloud-dialogflow/metadata/V2/KnowledgeBase.php new file mode 100644 index 0000000..0473fd3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/KnowledgeBase.php @@ -0,0 +1,66 @@ +internalAddGeneratedFile( + ' + +/google/cloud/dialogflow/v2/knowledge_base.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" + KnowledgeBase +name (  + display_name ( BA + language_code ( :A +\'dialogflow.googleapis.com/KnowledgeBase2projects/{project}/knowledgeBases/{knowledge_base}Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" +ListKnowledgeBasesRequest? +parent ( B/AA)\'dialogflow.googleapis.com/KnowledgeBase + page_size ( + +page_token (  +filter ( "y +ListKnowledgeBasesResponseB +knowledge_bases ( 2).google.cloud.dialogflow.v2.KnowledgeBase +next_page_token ( "X +GetKnowledgeBaseRequest= +name ( B/AA) +\'dialogflow.googleapis.com/KnowledgeBase" +CreateKnowledgeBaseRequest? +parent ( B/AA)\'dialogflow.googleapis.com/KnowledgeBaseF +knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBA"o +DeleteKnowledgeBaseRequest= +name ( B/AA) +\'dialogflow.googleapis.com/KnowledgeBase +force (BA" +UpdateKnowledgeBaseRequestF +knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBA4 + update_mask ( 2.google.protobuf.FieldMaskBA2 +KnowledgeBases +ListKnowledgeBases5.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest6.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse"Aparent&/v2/{parent=projects/*}/knowledgeBasesZ42/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.,/v2/{parent=projects/*/agent}/knowledgeBases +GetKnowledgeBase3.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"Aname&/v2/{name=projects/*/knowledgeBases/*}Z42/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.,/v2/{name=projects/*/agent/knowledgeBases/*} +CreateKnowledgeBase6.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"Aparent,knowledge_base"&/v2/{parent=projects/*}/knowledgeBases:knowledge_baseZD"2/v2/{parent=projects/*/locations/*}/knowledgeBases:knowledge_baseZ>",/v2/{parent=projects/*/agent}/knowledgeBases:knowledge_base +DeleteKnowledgeBase6.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.google.protobuf.Empty"Aname*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*} +UpdateKnowledgeBase6.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"Aknowledge_base,update_mask25/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:knowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:knowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:knowledge_basexAdialogflow.googleapis.comAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB +com.google.cloud.dialogflow.v2BKnowledgeBaseProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Participant.php b/vendor/google/cloud-dialogflow/metadata/V2/Participant.php new file mode 100644 index 0000000..ddccc26 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Participant.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Session.php b/vendor/google/cloud-dialogflow/metadata/V2/Session.php new file mode 100644 index 0000000..65e8326 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Session.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/SessionEntityType.php b/vendor/google/cloud-dialogflow/metadata/V2/SessionEntityType.php new file mode 100644 index 0000000..8df38c1 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/SessionEntityType.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/ValidationResult.php b/vendor/google/cloud-dialogflow/metadata/V2/ValidationResult.php new file mode 100644 index 0000000..481fcd0 Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/ValidationResult.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Version.php b/vendor/google/cloud-dialogflow/metadata/V2/Version.php new file mode 100644 index 0000000..135ff8b Binary files /dev/null and b/vendor/google/cloud-dialogflow/metadata/V2/Version.php differ diff --git a/vendor/google/cloud-dialogflow/metadata/V2/Webhook.php b/vendor/google/cloud-dialogflow/metadata/V2/Webhook.php new file mode 100644 index 0000000..df90db7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/metadata/V2/Webhook.php @@ -0,0 +1,50 @@ +internalAddGeneratedFile( + ' + +(google/cloud/dialogflow/v2/webhook.protogoogle.cloud.dialogflow.v2\'google/cloud/dialogflow/v2/intent.proto(google/cloud/dialogflow/v2/session.proto4google/cloud/dialogflow/v2/session_entity_type.protogoogle/protobuf/struct.proto" +WebhookRequest +session (  + response_id ( = + query_result ( 2\'.google.cloud.dialogflow.v2.QueryResult_ +original_detect_intent_request ( 27.google.cloud.dialogflow.v2.OriginalDetectIntentRequest" +WebhookResponse +fulfillment_text ( H +fulfillment_messages ( 2*.google.cloud.dialogflow.v2.Intent.Message +source ( ( +payload ( 2.google.protobuf.Struct< +output_contexts ( 2#.google.cloud.dialogflow.v2.ContextD +followup_event_input ( 2&.google.cloud.dialogflow.v2.EventInputK +session_entity_types + ( 2-.google.cloud.dialogflow.v2.SessionEntityType"h +OriginalDetectIntentRequest +source (  +version ( ( +payload ( 2.google.protobuf.StructB +com.google.cloud.dialogflow.v2B WebhookProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbDFGoogle.Cloud.Dialogflow.V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Agent.php b/vendor/google/cloud-dialogflow/src/V2/Agent.php new file mode 100644 index 0000000..13164b2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Agent.php @@ -0,0 +1,543 @@ +google.cloud.dialogflow.v2.Agent + */ +class Agent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $default_language_code = ''; + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $supported_language_codes; + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = ''; + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $avatar_uri = ''; + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_logging = false; + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $match_mode = 0; + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $classification_threshold = 0.0; + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $api_version = 0; + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tier = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project of this agent. + * Format: `projects/`. + * @type string $display_name + * Required. The name of this agent. + * @type string $default_language_code + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_language_codes + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * @type string $time_zone + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * @type string $description + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * @type string $avatar_uri + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * @type bool $enable_logging + * Optional. Determines whether this agent should log conversation queries. + * @type int $match_mode + * Optional. Determines how intents are detected from user queries. + * @type float $classification_threshold + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * @type int $api_version + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * @type int $tier + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDefaultLanguageCode() + { + return $this->default_language_code; + } + + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDefaultLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->default_language_code = $var; + + return $this; + } + + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedLanguageCodes() + { + return $this->supported_language_codes; + } + + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->supported_language_codes = $arr; + + return $this; + } + + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAvatarUri() + { + return $this->avatar_uri; + } + + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAvatarUri($var) + { + GPBUtil::checkString($var, True); + $this->avatar_uri = $var; + + return $this; + } + + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableLogging() + { + return $this->enable_logging; + } + + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableLogging($var) + { + GPBUtil::checkBool($var); + $this->enable_logging = $var; + + return $this; + } + + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return int + * @deprecated + */ + public function getMatchMode() + { + if ($this->match_mode !== 0) { + @trigger_error('match_mode is deprecated.', E_USER_DEPRECATED); + } + return $this->match_mode; + } + + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + * @deprecated + */ + public function setMatchMode($var) + { + @trigger_error('match_mode is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\MatchMode::class); + $this->match_mode = $var; + + return $this; + } + + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getClassificationThreshold() + { + return $this->classification_threshold; + } + + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setClassificationThreshold($var) + { + GPBUtil::checkFloat($var); + $this->classification_threshold = $var; + + return $this; + } + + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\ApiVersion::class); + $this->api_version = $var; + + return $this; + } + + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTier() + { + return $this->tier; + } + + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\Tier::class); + $this->tier = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Agent/ApiVersion.php b/vendor/google/cloud-dialogflow/src/V2/Agent/ApiVersion.php new file mode 100644 index 0000000..d81f985 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Agent/ApiVersion.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Agent.ApiVersion + */ +class ApiVersion +{ + /** + * Not specified. + * + * Generated from protobuf enum API_VERSION_UNSPECIFIED = 0; + */ + const API_VERSION_UNSPECIFIED = 0; + /** + * Legacy V1 API. + * + * Generated from protobuf enum API_VERSION_V1 = 1; + */ + const API_VERSION_V1 = 1; + /** + * V2 API. + * + * Generated from protobuf enum API_VERSION_V2 = 2; + */ + const API_VERSION_V2 = 2; + /** + * V2beta1 API. + * + * Generated from protobuf enum API_VERSION_V2_BETA_1 = 3; + */ + const API_VERSION_V2_BETA_1 = 3; + + private static $valueToName = [ + self::API_VERSION_UNSPECIFIED => 'API_VERSION_UNSPECIFIED', + self::API_VERSION_V1 => 'API_VERSION_V1', + self::API_VERSION_V2 => 'API_VERSION_V2', + self::API_VERSION_V2_BETA_1 => 'API_VERSION_V2_BETA_1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Agent/MatchMode.php b/vendor/google/cloud-dialogflow/src/V2/Agent/MatchMode.php new file mode 100644 index 0000000..7401d69 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Agent/MatchMode.php @@ -0,0 +1,64 @@ +google.cloud.dialogflow.v2.Agent.MatchMode + */ +class MatchMode +{ + /** + * Not specified. + * + * Generated from protobuf enum MATCH_MODE_UNSPECIFIED = 0; + */ + const MATCH_MODE_UNSPECIFIED = 0; + /** + * Best for agents with a small number of examples in intents and/or wide + * use of templates syntax and composite entities. + * + * Generated from protobuf enum MATCH_MODE_HYBRID = 1; + */ + const MATCH_MODE_HYBRID = 1; + /** + * Can be used for agents with a large number of examples in intents, + * especially the ones using @sys.any or very large custom entities. + * + * Generated from protobuf enum MATCH_MODE_ML_ONLY = 2; + */ + const MATCH_MODE_ML_ONLY = 2; + + private static $valueToName = [ + self::MATCH_MODE_UNSPECIFIED => 'MATCH_MODE_UNSPECIFIED', + self::MATCH_MODE_HYBRID => 'MATCH_MODE_HYBRID', + self::MATCH_MODE_ML_ONLY => 'MATCH_MODE_ML_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Agent/Tier.php b/vendor/google/cloud-dialogflow/src/V2/Agent/Tier.php new file mode 100644 index 0000000..79b2318 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Agent/Tier.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.Agent.Tier + */ +class Tier +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * Trial Edition, previously known as Standard Edition. + * + * Generated from protobuf enum TIER_STANDARD = 1; + */ + const TIER_STANDARD = 1; + /** + * Essentials Edition, previously known as Enterprise Essential Edition. + * + * Generated from protobuf enum TIER_ENTERPRISE = 2; + */ + const TIER_ENTERPRISE = 2; + /** + * Essentials Edition (same as TIER_ENTERPRISE), previously known as + * Enterprise Plus Edition. + * + * Generated from protobuf enum TIER_ENTERPRISE_PLUS = 3 [deprecated = true]; + */ + const TIER_ENTERPRISE_PLUS = 3; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::TIER_STANDARD => 'TIER_STANDARD', + self::TIER_ENTERPRISE => 'TIER_ENTERPRISE', + self::TIER_ENTERPRISE_PLUS => 'TIER_ENTERPRISE_PLUS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback.php new file mode 100644 index 0000000..1b8743f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback.php @@ -0,0 +1,331 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback + */ +class AgentAssistantFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_relevance = 0; + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_correctness = 0; + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_efficiency = 0; + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $summarization_feedback = null; + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_search_feedback = null; + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_assist_feedback = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $answer_relevance + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * @type int $document_correctness + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * @type int $document_efficiency + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $summarization_feedback + * Optional. Feedback for conversation summarization. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $knowledge_search_feedback + * Optional. Feedback for knowledge search. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $knowledge_assist_feedback + * Optional. Feedback for knowledge assist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAnswerRelevance() + { + return $this->answer_relevance; + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAnswerRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\AnswerRelevance::class); + $this->answer_relevance = $var; + + return $this; + } + + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDocumentCorrectness() + { + return $this->document_correctness; + } + + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDocumentCorrectness($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\DocumentCorrectness::class); + $this->document_correctness = $var; + + return $this; + } + + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDocumentEfficiency() + { + return $this->document_efficiency; + } + + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDocumentEfficiency($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\DocumentEfficiency::class); + $this->document_efficiency = $var; + + return $this; + } + + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback|null + */ + public function getSummarizationFeedback() + { + return $this->summarization_feedback; + } + + public function hasSummarizationFeedback() + { + return isset($this->summarization_feedback); + } + + public function clearSummarizationFeedback() + { + unset($this->summarization_feedback); + } + + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $var + * @return $this + */ + public function setSummarizationFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback::class); + $this->summarization_feedback = $var; + + return $this; + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback|null + */ + public function getKnowledgeSearchFeedback() + { + return $this->knowledge_search_feedback; + } + + public function hasKnowledgeSearchFeedback() + { + return isset($this->knowledge_search_feedback); + } + + public function clearKnowledgeSearchFeedback() + { + unset($this->knowledge_search_feedback); + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $var + * @return $this + */ + public function setKnowledgeSearchFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback::class); + $this->knowledge_search_feedback = $var; + + return $this; + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback|null + */ + public function getKnowledgeAssistFeedback() + { + return $this->knowledge_assist_feedback; + } + + public function hasKnowledgeAssistFeedback() + { + return isset($this->knowledge_assist_feedback); + } + + public function clearKnowledgeAssistFeedback() + { + unset($this->knowledge_assist_feedback); + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $var + * @return $this + */ + public function setKnowledgeAssistFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback::class); + $this->knowledge_assist_feedback = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/AnswerRelevance.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/AnswerRelevance.php new file mode 100644 index 0000000..3f3827b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/AnswerRelevance.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance + */ +class AnswerRelevance +{ + /** + * Answer relevance unspecified. + * + * Generated from protobuf enum ANSWER_RELEVANCE_UNSPECIFIED = 0; + */ + const ANSWER_RELEVANCE_UNSPECIFIED = 0; + /** + * Answer is irrelevant to query. + * + * Generated from protobuf enum IRRELEVANT = 1; + */ + const IRRELEVANT = 1; + /** + * Answer is relevant to query. + * + * Generated from protobuf enum RELEVANT = 2; + */ + const RELEVANT = 2; + + private static $valueToName = [ + self::ANSWER_RELEVANCE_UNSPECIFIED => 'ANSWER_RELEVANCE_UNSPECIFIED', + self::IRRELEVANT => 'IRRELEVANT', + self::RELEVANT => 'RELEVANT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentCorrectness.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentCorrectness.php new file mode 100644 index 0000000..0b0f089 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentCorrectness.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness + */ +class DocumentCorrectness +{ + /** + * Document correctness unspecified. + * + * Generated from protobuf enum DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + */ + const DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + /** + * Information in document is incorrect. + * + * Generated from protobuf enum INCORRECT = 1; + */ + const INCORRECT = 1; + /** + * Information in document is correct. + * + * Generated from protobuf enum CORRECT = 2; + */ + const CORRECT = 2; + + private static $valueToName = [ + self::DOCUMENT_CORRECTNESS_UNSPECIFIED => 'DOCUMENT_CORRECTNESS_UNSPECIFIED', + self::INCORRECT => 'INCORRECT', + self::CORRECT => 'CORRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentEfficiency.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentEfficiency.php new file mode 100644 index 0000000..d164799 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/DocumentEfficiency.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency + */ +class DocumentEfficiency +{ + /** + * Document efficiency unspecified. + * + * Generated from protobuf enum DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + */ + const DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + /** + * Document is inefficient. + * + * Generated from protobuf enum INEFFICIENT = 1; + */ + const INEFFICIENT = 1; + /** + * Document is efficient. + * + * Generated from protobuf enum EFFICIENT = 2; + */ + const EFFICIENT = 2; + + private static $valueToName = [ + self::DOCUMENT_EFFICIENCY_UNSPECIFIED => 'DOCUMENT_EFFICIENCY_UNSPECIFIED', + self::INEFFICIENT => 'INEFFICIENT', + self::EFFICIENT => 'EFFICIENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php new file mode 100644 index 0000000..f3dc6a3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback + */ +class KnowledgeAssistFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php new file mode 100644 index 0000000..16c54ca --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback + */ +class KnowledgeSearchFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/SummarizationFeedback.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/SummarizationFeedback.php new file mode 100644 index 0000000..21ba9cc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantFeedback/SummarizationFeedback.php @@ -0,0 +1,190 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback + */ +class SummarizationFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + */ + protected $submit_time = null; + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + */ + protected $summary_text = ''; + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $text_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Timestamp when composing of the summary starts. + * @type \Google\Protobuf\Timestamp $submit_time + * Timestamp when the summary was submitted. + * @type string $summary_text + * Text of actual submitted summary. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * Optional. Actual text sections of submitted summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSubmitTime() + { + return $this->submit_time; + } + + public function hasSubmitTime() + { + return isset($this->submit_time); + } + + public function clearSubmitTime() + { + unset($this->submit_time); + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSubmitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->submit_time = $var; + + return $this; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @return string + */ + public function getSummaryText() + { + return $this->summary_text; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @param string $var + * @return $this + */ + public function setSummaryText($var) + { + GPBUtil::checkString($var, True); + $this->summary_text = $var; + + return $this; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AgentAssistantRecord.php b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantRecord.php new file mode 100644 index 0000000..d36c798 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AgentAssistantRecord.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.AgentAssistantRecord + */ +class AgentAssistantRecord extends \Google\Protobuf\Internal\Message +{ + protected $answer; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ArticleAnswer $article_suggestion_answer + * Output only. The article suggestion answer. + * @type \Google\Cloud\Dialogflow\V2\FaqAnswer $faq_answer + * Output only. The FAQ answer. + * @type \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $dialogflow_assist_answer + * Output only. Dialogflow assist answer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ArticleAnswer|null + */ + public function getArticleSuggestionAnswer() + { + return $this->readOneof(5); + } + + public function hasArticleSuggestionAnswer() + { + return $this->hasOneof(5); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ArticleAnswer $var + * @return $this + */ + public function setArticleSuggestionAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleAnswer::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\FaqAnswer|null + */ + public function getFaqAnswer() + { + return $this->readOneof(6); + } + + public function hasFaqAnswer() + { + return $this->hasOneof(6); + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\FaqAnswer $var + * @return $this + */ + public function setFaqAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FaqAnswer::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer|null + */ + public function getDialogflowAssistAnswer() + { + return $this->readOneof(7); + } + + public function hasDialogflowAssistAnswer() + { + return $this->hasOneof(7); + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $var + * @return $this + */ + public function setDialogflowAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getAnswer() + { + return $this->whichOneof("answer"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentRequest.php b/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentRequest.php new file mode 100644 index 0000000..253b3d3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentRequest.php @@ -0,0 +1,521 @@ +google.cloud.dialogflow.v2.AnalyzeContentRequest + */ +class AnalyzeContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $participant = ''; + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + */ + protected $reply_audio_config = null; + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + */ + protected $query_params = null; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + */ + protected $assist_query_params = null; + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + */ + protected $cx_parameters = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + */ + protected $request_id = ''; + protected $input; + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\TextInput $textInput The natural language text to be processed. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function build(string $participant, \Google\Cloud\Dialogflow\V2\TextInput $textInput): self + { + return (new self()) + ->setParticipant($participant) + ->setTextInput($textInput); + } + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EventInput $eventInput An input event to send to Dialogflow. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function buildFromParticipantEventInput(string $participant, \Google\Cloud\Dialogflow\V2\EventInput $eventInput): self + { + return (new self()) + ->setParticipant($participant) + ->setEventInput($eventInput); + } + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\AudioInput $audioInput The natural language speech audio to be processed. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function buildFromParticipantAudioInput(string $participant, \Google\Cloud\Dialogflow\V2\AudioInput $audioInput): self + { + return (new self()) + ->setParticipant($participant) + ->setAudioInput($audioInput); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $text_input + * The natural language text to be processed. + * @type \Google\Cloud\Dialogflow\V2\AudioInput $audio_input + * The natural language speech audio to be processed. + * @type \Google\Cloud\Dialogflow\V2\EventInput $event_input + * An input event to send to Dialogflow. + * @type \Google\Cloud\Dialogflow\V2\SuggestionInput $suggestion_input + * An input representing the selection of a suggestion. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getTextInput() + { + return $this->readOneof(6); + } + + public function hasTextInput() + { + return $this->hasOneof(6); + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The natural language speech audio to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioInput audio_input = 7; + * @return \Google\Cloud\Dialogflow\V2\AudioInput|null + */ + public function getAudioInput() + { + return $this->readOneof(7); + } + + public function hasAudioInput() + { + return $this->hasOneof(7); + } + + /** + * The natural language speech audio to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioInput audio_input = 7; + * @param \Google\Cloud\Dialogflow\V2\AudioInput $var + * @return $this + */ + public function setAudioInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AudioInput::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getEventInput() + { + return $this->readOneof(8); + } + + public function hasEventInput() + { + return $this->hasOneof(8); + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setEventInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @return \Google\Cloud\Dialogflow\V2\SuggestionInput|null + */ + public function getSuggestionInput() + { + return $this->readOneof(12); + } + + public function hasSuggestionInput() + { + return $this->hasOneof(12); + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @param \Google\Cloud\Dialogflow\V2\SuggestionInput $var + * @return $this + */ + public function setSuggestionInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionInput::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getReplyAudioConfig() + { + return $this->reply_audio_config; + } + + public function hasReplyAudioConfig() + { + return isset($this->reply_audio_config); + } + + public function clearReplyAudioConfig() + { + unset($this->reply_audio_config); + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setReplyAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->reply_audio_config = $var; + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentResponse.php b/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentResponse.php new file mode 100644 index 0000000..0302ea4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnalyzeContentResponse.php @@ -0,0 +1,432 @@ +google.cloud.dialogflow.v2.AnalyzeContentResponse + */ +class AnalyzeContentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + */ + protected $reply_text = ''; + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + */ + protected $reply_audio = null; + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + */ + protected $automated_agent_reply = null; + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + */ + protected $message = null; + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + */ + private $human_agent_suggestion_results; + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + */ + private $end_user_suggestion_results; + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + */ + protected $dtmf_parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reply_text + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * @type \Google\Cloud\Dialogflow\V2\OutputAudio $reply_audio + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $automated_agent_reply + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * @type \Google\Cloud\Dialogflow\V2\Message $message + * Message analyzed by CCAI. + * @type array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $human_agent_suggestion_results + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * @type array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $end_user_suggestion_results + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * @type \Google\Cloud\Dialogflow\V2\DtmfParameters $dtmf_parameters + * Indicates the parameters of DTMF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + * @return string + */ + public function getReplyText() + { + return $this->reply_text; + } + + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + * @param string $var + * @return $this + */ + public function setReplyText($var) + { + GPBUtil::checkString($var, True); + $this->reply_text = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + * @return \Google\Cloud\Dialogflow\V2\OutputAudio|null + */ + public function getReplyAudio() + { + return $this->reply_audio; + } + + public function hasReplyAudio() + { + return isset($this->reply_audio); + } + + public function clearReplyAudio() + { + unset($this->reply_audio); + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + * @param \Google\Cloud\Dialogflow\V2\OutputAudio $var + * @return $this + */ + public function setReplyAudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudio::class); + $this->reply_audio = $var; + + return $this; + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentReply|null + */ + public function getAutomatedAgentReply() + { + return $this->automated_agent_reply; + } + + public function hasAutomatedAgentReply() + { + return isset($this->automated_agent_reply); + } + + public function clearAutomatedAgentReply() + { + unset($this->automated_agent_reply); + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $var + * @return $this + */ + public function setAutomatedAgentReply($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply::class); + $this->automated_agent_reply = $var; + + return $this; + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->message = $var; + + return $this; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHumanAgentSuggestionResults() + { + return $this->human_agent_suggestion_results; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + * @param array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHumanAgentSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->human_agent_suggestion_results = $arr; + + return $this; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndUserSuggestionResults() + { + return $this->end_user_suggestion_results; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + * @param array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndUserSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->end_user_suggestion_results = $arr; + + return $this; + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + * @return \Google\Cloud\Dialogflow\V2\DtmfParameters|null + */ + public function getDtmfParameters() + { + return $this->dtmf_parameters; + } + + public function hasDtmfParameters() + { + return isset($this->dtmf_parameters); + } + + public function clearDtmfParameters() + { + unset($this->dtmf_parameters); + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + * @param \Google\Cloud\Dialogflow\V2\DtmfParameters $var + * @return $this + */ + public function setDtmfParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DtmfParameters::class); + $this->dtmf_parameters = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnnotatedMessagePart.php b/vendor/google/cloud-dialogflow/src/V2/AnnotatedMessagePart.php new file mode 100644 index 0000000..932abff --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnnotatedMessagePart.php @@ -0,0 +1,195 @@ +google.cloud.dialogflow.v2.AnnotatedMessagePart + */ +class AnnotatedMessagePart extends \Google\Protobuf\Internal\Message +{ + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + */ + protected $entity_type = ''; + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + */ + protected $formatted_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * A part of a message possibly annotated with an entity. + * @type string $entity_type + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * @type \Google\Protobuf\Value $formatted_value + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `@sys.unit-currency`, this may contain: + *
+     *           {
+     *             "amount": 5,
+     *             "currency": "USD"
+     *           }
+     *           
+ * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + * @return string + */ + public function getEntityType() + { + return $this->entity_type; + } + + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + * @param string $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkString($var, True); + $this->entity_type = $var; + + return $this; + } + + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + * @return \Google\Protobuf\Value|null + */ + public function getFormattedValue() + { + return $this->formatted_value; + } + + public function hasFormattedValue() + { + return isset($this->formatted_value); + } + + public function clearFormattedValue() + { + unset($this->formatted_value); + } + + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setFormattedValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->formatted_value = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback.php b/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback.php new file mode 100644 index 0000000..6063491 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback.php @@ -0,0 +1,282 @@ +google.cloud.dialogflow.v2.AnswerFeedback + */ +class AnswerFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + */ + protected $correctness_level = 0; + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + */ + protected $clicked = false; + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + */ + protected $click_time = null; + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + */ + protected $displayed = false; + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + */ + protected $display_time = null; + protected $detail_feedback; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $correctness_level + * The correctness level of the specific answer. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $agent_assistant_detail_feedback + * Detail feedback of agent assist suggestions. + * @type bool $clicked + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * @type \Google\Protobuf\Timestamp $click_time + * Time when the answer/item was clicked. + * @type bool $displayed + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * @type \Google\Protobuf\Timestamp $display_time + * Time when the answer/item was displayed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + * @return int + */ + public function getCorrectnessLevel() + { + return $this->correctness_level; + } + + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + * @param int $var + * @return $this + */ + public function setCorrectnessLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AnswerFeedback\CorrectnessLevel::class); + $this->correctness_level = $var; + + return $this; + } + + /** + * Detail feedback of agent assist suggestions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback|null + */ + public function getAgentAssistantDetailFeedback() + { + return $this->readOneof(2); + } + + public function hasAgentAssistantDetailFeedback() + { + return $this->hasOneof(2); + } + + /** + * Detail feedback of agent assist suggestions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $var + * @return $this + */ + public function setAgentAssistantDetailFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + * @return bool + */ + public function getClicked() + { + return $this->clicked; + } + + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + * @param bool $var + * @return $this + */ + public function setClicked($var) + { + GPBUtil::checkBool($var); + $this->clicked = $var; + + return $this; + } + + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getClickTime() + { + return $this->click_time; + } + + public function hasClickTime() + { + return isset($this->click_time); + } + + public function clearClickTime() + { + unset($this->click_time); + } + + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setClickTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->click_time = $var; + + return $this; + } + + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + * @return bool + */ + public function getDisplayed() + { + return $this->displayed; + } + + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + * @param bool $var + * @return $this + */ + public function setDisplayed($var) + { + GPBUtil::checkBool($var); + $this->displayed = $var; + + return $this; + } + + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDisplayTime() + { + return $this->display_time; + } + + public function hasDisplayTime() + { + return isset($this->display_time); + } + + public function clearDisplayTime() + { + unset($this->display_time); + } + + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDisplayTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->display_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getDetailFeedback() + { + return $this->whichOneof("detail_feedback"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback/CorrectnessLevel.php b/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback/CorrectnessLevel.php new file mode 100644 index 0000000..d67105a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnswerFeedback/CorrectnessLevel.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel + */ +class CorrectnessLevel +{ + /** + * Correctness level unspecified. + * + * Generated from protobuf enum CORRECTNESS_LEVEL_UNSPECIFIED = 0; + */ + const CORRECTNESS_LEVEL_UNSPECIFIED = 0; + /** + * Answer is totally wrong. + * + * Generated from protobuf enum NOT_CORRECT = 1; + */ + const NOT_CORRECT = 1; + /** + * Answer is partially correct. + * + * Generated from protobuf enum PARTIALLY_CORRECT = 2; + */ + const PARTIALLY_CORRECT = 2; + /** + * Answer is fully correct. + * + * Generated from protobuf enum FULLY_CORRECT = 3; + */ + const FULLY_CORRECT = 3; + + private static $valueToName = [ + self::CORRECTNESS_LEVEL_UNSPECIFIED => 'CORRECTNESS_LEVEL_UNSPECIFIED', + self::NOT_CORRECT => 'NOT_CORRECT', + self::PARTIALLY_CORRECT => 'PARTIALLY_CORRECT', + self::FULLY_CORRECT => 'FULLY_CORRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/AnswerRecord.php b/vendor/google/cloud-dialogflow/src/V2/AnswerRecord.php new file mode 100644 index 0000000..d173d57 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AnswerRecord.php @@ -0,0 +1,190 @@ +google.cloud.dialogflow.v2.AnswerRecord + */ +class AnswerRecord extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_feedback = null; + protected $record; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * @type \Google\Cloud\Dialogflow\V2\AnswerFeedback $answer_feedback + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantRecord $agent_assistant_record + * Output only. The record for human agent assistant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\AnswerFeedback|null + */ + public function getAnswerFeedback() + { + return $this->answer_feedback; + } + + public function hasAnswerFeedback() + { + return isset($this->answer_feedback); + } + + public function clearAnswerFeedback() + { + unset($this->answer_feedback); + } + + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\AnswerFeedback $var + * @return $this + */ + public function setAnswerFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AnswerFeedback::class); + $this->answer_feedback = $var; + + return $this; + } + + /** + * Output only. The record for human agent assistant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantRecord agent_assistant_record = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantRecord|null + */ + public function getAgentAssistantRecord() + { + return $this->readOneof(4); + } + + public function hasAgentAssistantRecord() + { + return $this->hasOneof(4); + } + + /** + * Output only. The record for human agent assistant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantRecord agent_assistant_record = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantRecord $var + * @return $this + */ + public function setAgentAssistantRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantRecord::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getRecord() + { + return $this->whichOneof("record"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ArticleAnswer.php b/vendor/google/cloud-dialogflow/src/V2/ArticleAnswer.php new file mode 100644 index 0000000..ecbdd73 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ArticleAnswer.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.ArticleAnswer + */ +class ArticleAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The article title. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + */ + private $snippets; + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + */ + private $metadata; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The article title. + * @type string $uri + * The article URI. + * @type array|\Google\Protobuf\Internal\RepeatedField $snippets + * Article snippets. + * @type float $confidence + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * @type array|\Google\Protobuf\Internal\MapField $metadata + * A map that contains metadata about the answer and the + * document from which it originates. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The article title. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The article title. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnippets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->snippets = $arr; + + return $this; + } + + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ArticleSuggestionModelMetadata.php b/vendor/google/cloud-dialogflow/src/V2/ArticleSuggestionModelMetadata.php new file mode 100644 index 0000000..615d7a2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ArticleSuggestionModelMetadata.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata + */ +class ArticleSuggestionModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $training_model_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $training_model_type + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainingModelType() + { + return $this->training_model_type; + } + + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainingModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\ModelType::class); + $this->training_model_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AssistQueryParameters.php b/vendor/google/cloud-dialogflow/src/V2/AssistQueryParameters.php new file mode 100644 index 0000000..2deb569 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AssistQueryParameters.php @@ -0,0 +1,131 @@ +google.cloud.dialogflow.v2.AssistQueryParameters + */ +class AssistQueryParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + */ + private $documents_metadata_filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $documents_metadata_filters + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDocumentsMetadataFilters() + { + return $this->documents_metadata_filters; + } + + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDocumentsMetadataFilters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents_metadata_filters = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AudioEncoding.php b/vendor/google/cloud-dialogflow/src/V2/AudioEncoding.php new file mode 100644 index 0000000..e630d14 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AudioEncoding.php @@ -0,0 +1,125 @@ +google.cloud.dialogflow.v2.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * + * Generated from protobuf enum AUDIO_ENCODING_LINEAR_16 = 1; + */ + const AUDIO_ENCODING_LINEAR_16 = 1; + /** + * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + * Codec) is the recommended encoding because it is lossless (therefore + * recognition is not compromised) and requires only about half the + * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + * 24-bit samples, however, not all fields in `STREAMINFO` are supported. + * + * Generated from protobuf enum AUDIO_ENCODING_FLAC = 2; + */ + const AUDIO_ENCODING_FLAC = 2; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * + * Generated from protobuf enum AUDIO_ENCODING_MULAW = 3; + */ + const AUDIO_ENCODING_MULAW = 3; + /** + * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR = 4; + */ + const AUDIO_ENCODING_AMR = 4; + /** + * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR_WB = 5; + */ + const AUDIO_ENCODING_AMR_WB = 5; + /** + * Opus encoded audio frames in Ogg container + * ([OggOpus](https://wiki.xiph.org/OggOpus)). + * `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_OGG_OPUS = 6; + */ + const AUDIO_ENCODING_OGG_OPUS = 6; + /** + * Although the use of lossy encodings is not recommended, if a very low + * bitrate encoding is required, `OGG_OPUS` is highly preferred over + * Speex encoding. The [Speex](https://speex.org/) encoding supported by + * Dialogflow API has a header byte in each block, as in MIME type + * `audio/x-speex-with-header-byte`. + * It is a variant of the RTP Speex encoding defined in + * [RFC 5574](https://tools.ietf.org/html/rfc5574). + * The stream is a sequence of blocks, one block per RTP packet. Each block + * starts with a byte containing the length of the block, in bytes, followed + * by one or more frames of Speex data, padded to an integral number of + * bytes (octets) as specified in RFC 5574. In other words, each RTP header + * is replaced with a single byte containing the block length. Only Speex + * wideband is supported. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + */ + const AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum AUDIO_ENCODING_ALAW = 8; + */ + const AUDIO_ENCODING_ALAW = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::AUDIO_ENCODING_LINEAR_16 => 'AUDIO_ENCODING_LINEAR_16', + self::AUDIO_ENCODING_FLAC => 'AUDIO_ENCODING_FLAC', + self::AUDIO_ENCODING_MULAW => 'AUDIO_ENCODING_MULAW', + self::AUDIO_ENCODING_AMR => 'AUDIO_ENCODING_AMR', + self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', + self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', + self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', + self::AUDIO_ENCODING_ALAW => 'AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AudioInput.php b/vendor/google/cloud-dialogflow/src/V2/AudioInput.php new file mode 100644 index 0000000..f4591eb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AudioInput.php @@ -0,0 +1,123 @@ +google.cloud.dialogflow.v2.AudioInput + */ +class AudioInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $config = null; + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $config + * Required. Instructs the speech recognizer how to process the speech audio. + * @type string $audio + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAudio() + { + return $this->audio; + } + + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAudio($var) + { + GPBUtil::checkString($var, False); + $this->audio = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentConfig.php b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentConfig.php new file mode 100644 index 0000000..9c86f69 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentConfig.php @@ -0,0 +1,175 @@ +google.cloud.dialogflow.v2.AutomatedAgentConfig + */ +class AutomatedAgentConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $session_ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * @type \Google\Protobuf\Duration $session_ttl + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getSessionTtl() + { + return $this->session_ttl; + } + + public function hasSessionTtl() + { + return isset($this->session_ttl); + } + + public function clearSessionTtl() + { + unset($this->session_ttl); + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSessionTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->session_ttl = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply.php b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply.php new file mode 100644 index 0000000..a7eb6d7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply.php @@ -0,0 +1,203 @@ +google.cloud.dialogflow.v2.AutomatedAgentReply + */ +class AutomatedAgentReply extends \Google\Protobuf\Internal\Message +{ + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + */ + protected $detect_intent_response = null; + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + */ + protected $automated_agent_reply_type = 0; + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + */ + protected $allow_cancellation = false; + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + */ + protected $cx_current_page = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\DetectIntentResponse $detect_intent_response + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * @type int $automated_agent_reply_type + * AutomatedAgentReply type. + * @type bool $allow_cancellation + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * @type string $cx_current_page + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + * @return \Google\Cloud\Dialogflow\V2\DetectIntentResponse|null + */ + public function getDetectIntentResponse() + { + return $this->detect_intent_response; + } + + public function hasDetectIntentResponse() + { + return isset($this->detect_intent_response); + } + + public function clearDetectIntentResponse() + { + unset($this->detect_intent_response); + } + + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + * @param \Google\Cloud\Dialogflow\V2\DetectIntentResponse $var + * @return $this + */ + public function setDetectIntentResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DetectIntentResponse::class); + $this->detect_intent_response = $var; + + return $this; + } + + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + * @return int + */ + public function getAutomatedAgentReplyType() + { + return $this->automated_agent_reply_type; + } + + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + * @param int $var + * @return $this + */ + public function setAutomatedAgentReplyType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply\AutomatedAgentReplyType::class); + $this->automated_agent_reply_type = $var; + + return $this; + } + + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + * @return bool + */ + public function getAllowCancellation() + { + return $this->allow_cancellation; + } + + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + * @param bool $var + * @return $this + */ + public function setAllowCancellation($var) + { + GPBUtil::checkBool($var); + $this->allow_cancellation = $var; + + return $this; + } + + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + * @return string + */ + public function getCxCurrentPage() + { + return $this->cx_current_page; + } + + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + * @param string $var + * @return $this + */ + public function setCxCurrentPage($var) + { + GPBUtil::checkString($var, True); + $this->cx_current_page = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply/AutomatedAgentReplyType.php b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply/AutomatedAgentReplyType.php new file mode 100644 index 0000000..aa4dd0b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/AutomatedAgentReply/AutomatedAgentReplyType.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType + */ +class AutomatedAgentReplyType +{ + /** + * Not specified. This should never happen. + * + * Generated from protobuf enum AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0; + */ + const AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0; + /** + * Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables + * `return_partial_response` can be returned as partial reply. + * WARNING: partial reply is not eligible for barge-in. + * + * Generated from protobuf enum PARTIAL = 1; + */ + const PARTIAL = 1; + /** + * Final reply. + * + * Generated from protobuf enum FINAL = 2; + */ + const PBFINAL = 2; + + private static $valueToName = [ + self::AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED => 'AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED', + self::PARTIAL => 'PARTIAL', + self::PBFINAL => 'FINAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchCreateEntitiesRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchCreateEntitiesRequest.php new file mode 100644 index 0000000..c783511 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchCreateEntitiesRequest.php @@ -0,0 +1,196 @@ +google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + */ +class BatchCreateEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchCreateEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entities): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities); + } + + /** + * @param string $parent Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchCreateEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntitiesLanguageCode(string $parent, array $entities, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * @type array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $entities + * Required. The entities to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntitiesRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntitiesRequest.php new file mode 100644 index 0000000..5eca1fa --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntitiesRequest.php @@ -0,0 +1,208 @@ +google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + */ +class BatchDeleteEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entity_values; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string[] $entityValues Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entityValues): self + { + return (new self()) + ->setParent($parent) + ->setEntityValues($entityValues); + } + + /** + * @param string $parent Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string[] $entityValues Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntityValuesLanguageCode(string $parent, array $entityValues, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntityValues($entityValues) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $entity_values + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityValues() + { + return $this->entity_values; + } + + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entity_values = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntityTypesRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntityTypesRequest.php new file mode 100644 index 0000000..cd9bed4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteEntityTypesRequest.php @@ -0,0 +1,128 @@ +google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + */ +class BatchDeleteEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entity_type_names; + + /** + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string[] $entityTypeNames Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent, array $entityTypeNames): self + { + return (new self()) + ->setParent($parent) + ->setEntityTypeNames($entityTypeNames); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @type array|\Google\Protobuf\Internal\RepeatedField $entity_type_names + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityTypeNames() + { + return $this->entity_type_names; + } + + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityTypeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entity_type_names = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchDeleteIntentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteIntentsRequest.php new file mode 100644 index 0000000..268ec6c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchDeleteIntentsRequest.php @@ -0,0 +1,128 @@ +google.cloud.dialogflow.v2.BatchDeleteIntentsRequest + */ +class BatchDeleteIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $intents; + + /** + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent[] $intents Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteIntentsRequest + * + * @experimental + */ + public static function build(string $parent, array $intents): self + { + return (new self()) + ->setParent($parent) + ->setIntents($intents); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @type array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $intents + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntents() + { + return $this->intents; + } + + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntitiesRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntitiesRequest.php new file mode 100644 index 0000000..3a34274 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntitiesRequest.php @@ -0,0 +1,240 @@ +google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + */ +class BatchUpdateEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param string $parent Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to update or create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entities): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities); + } + + /** + * @param string $parent Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to update or create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntitiesLanguageCode(string $parent, array $entities, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * @type array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $entities + * Required. The entities to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesRequest.php new file mode 100644 index 0000000..6a281fc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesRequest.php @@ -0,0 +1,250 @@ +google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + */ +class BatchUpdateEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + protected $entity_type_batch; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * @type string $entity_type_batch_uri + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * @type \Google\Cloud\Dialogflow\V2\EntityTypeBatch $entity_type_batch_inline + * The collection of entity types to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * + * Generated from protobuf field string entity_type_batch_uri = 2; + * @return string + */ + public function getEntityTypeBatchUri() + { + return $this->readOneof(2); + } + + public function hasEntityTypeBatchUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * + * Generated from protobuf field string entity_type_batch_uri = 2; + * @param string $var + * @return $this + */ + public function setEntityTypeBatchUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The collection of entity types to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityTypeBatch entity_type_batch_inline = 3; + * @return \Google\Cloud\Dialogflow\V2\EntityTypeBatch|null + */ + public function getEntityTypeBatchInline() + { + return $this->readOneof(3); + } + + public function hasEntityTypeBatchInline() + { + return $this->hasOneof(3); + } + + /** + * The collection of entity types to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityTypeBatch entity_type_batch_inline = 3; + * @param \Google\Cloud\Dialogflow\V2\EntityTypeBatch $var + * @return $this + */ + public function setEntityTypeBatchInline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityTypeBatch::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * @return string + */ + public function getEntityTypeBatch() + { + return $this->whichOneof("entity_type_batch"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesResponse.php b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesResponse.php new file mode 100644 index 0000000..b73eca8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateEntityTypesResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + */ +class BatchUpdateEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $entity_types + * The collection of updated or created entity types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsRequest.php new file mode 100644 index 0000000..1420d06 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsRequest.php @@ -0,0 +1,314 @@ +google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + */ +class BatchUpdateIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + protected $intent_batch; + + /** + * @param string $parent Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentBatchUri The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateIntentsRequest + * + * @experimental + */ + public static function build(string $parent, string $intentBatchUri): self + { + return (new self()) + ->setParent($parent) + ->setIntentBatchUri($intentBatchUri); + } + + /** + * @param string $parent Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\IntentBatch $intentBatchInline The collection of intents to update or create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateIntentsRequest + * + * @experimental + */ + public static function buildFromParentIntentBatchInline(string $parent, \Google\Cloud\Dialogflow\V2\IntentBatch $intentBatchInline): self + { + return (new self()) + ->setParent($parent) + ->setIntentBatchInline($intentBatchInline); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * @type string $intent_batch_uri + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * @type \Google\Cloud\Dialogflow\V2\IntentBatch $intent_batch_inline + * The collection of intents to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * Generated from protobuf field string intent_batch_uri = 2; + * @return string + */ + public function getIntentBatchUri() + { + return $this->readOneof(2); + } + + public function hasIntentBatchUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * Generated from protobuf field string intent_batch_uri = 2; + * @param string $var + * @return $this + */ + public function setIntentBatchUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The collection of intents to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentBatch intent_batch_inline = 3; + * @return \Google\Cloud\Dialogflow\V2\IntentBatch|null + */ + public function getIntentBatchInline() + { + return $this->readOneof(3); + } + + public function hasIntentBatchInline() + { + return $this->hasOneof(3); + } + + /** + * The collection of intents to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentBatch intent_batch_inline = 3; + * @param \Google\Cloud\Dialogflow\V2\IntentBatch $var + * @return $this + */ + public function setIntentBatchInline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentBatch::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + + /** + * @return string + */ + public function getIntentBatch() + { + return $this->whichOneof("intent_batch"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsResponse.php new file mode 100644 index 0000000..fe289de --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/BatchUpdateIntentsResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.BatchUpdateIntentsResponse + */ +class BatchUpdateIntentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $intents + * The collection of updated or created intents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntents() + { + return $this->intents; + } + + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigOperationMetadata.php new file mode 100644 index 0000000..c570a3a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata + */ +class ClearSuggestionFeatureConfigOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * @type int $participant_role + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to remove. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp whe the request was created. The time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigRequest.php b/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigRequest.php new file mode 100644 index 0000000..bed39bb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ClearSuggestionFeatureConfigRequest.php @@ -0,0 +1,185 @@ +google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest + */ +class ClearSuggestionFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * @return \Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function build(string $conversationProfile): self + { + return (new self()) + ->setConversationProfile($conversationProfile); + } + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @param int $participantRole Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\Participant\Role} + * @param int $suggestionFeatureType Required. The type of the suggestion feature to remove. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type} + * + * @return \Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function buildFromConversationProfileParticipantRoleSuggestionFeatureType(string $conversationProfile, int $participantRole, int $suggestionFeatureType): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @type int $participant_role + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to remove. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/AgentsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/AgentsClient.php new file mode 100644 index 0000000..8fc5d6a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/AgentsClient.php @@ -0,0 +1,740 @@ + deleteAgentAsync(DeleteAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportAgentAsync(ExportAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAgentAsync(GetAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getValidationResultAsync(GetValidationResultRequest $request, array $optionalArgs = []) + * @method PromiseInterface importAgentAsync(ImportAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreAgentAsync(RestoreAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAgentsAsync(SearchAgentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setAgentAsync(SetAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface trainAgentAsync(TrainAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class AgentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/agents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/agents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/agents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/agents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\AgentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new AgentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified agent. + * + * The async variant is {@see AgentsClient::deleteAgentAsync()} . + * + * @example samples/V2/AgentsClient/delete_agent.php + * + * @param DeleteAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAgent(DeleteAgentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAgent', $request, $callOptions)->wait(); + } + + /** + * Exports the specified agent to a ZIP file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] + * + * The async variant is {@see AgentsClient::exportAgentAsync()} . + * + * @example samples/V2/AgentsClient/export_agent.php + * + * @param ExportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportAgent(ExportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportAgent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent. + * + * The async variant is {@see AgentsClient::getAgentAsync()} . + * + * @example samples/V2/AgentsClient/get_agent.php + * + * @param GetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAgent(GetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('GetAgent', $request, $callOptions)->wait(); + } + + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * The async variant is {@see AgentsClient::getValidationResultAsync()} . + * + * @example samples/V2/AgentsClient/get_validation_result.php + * + * @param GetValidationResultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ValidationResult + * + * @throws ApiException Thrown if the API call fails. + */ + public function getValidationResult(GetValidationResultRequest $request, array $callOptions = []): ValidationResult + { + return $this->startApiCall('GetValidationResult', $request, $callOptions)->wait(); + } + + /** + * Imports the specified agent from a ZIP file. + * + * Uploads new intents and entity types without deleting the existing ones. + * Intents and entity types with the same name are replaced with the new + * versions from + * [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After + * the import, the imported draft agent will be trained automatically (unless + * disabled in agent settings). However, once the import is done, training may + * not be completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when importing is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::importAgentAsync()} . + * + * @example samples/V2/AgentsClient/import_agent.php + * + * @param ImportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importAgent(ImportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportAgent', $request, $callOptions)->wait(); + } + + /** + * Restores the specified agent from a ZIP file. + * + * Replaces the current agent version with a new one. All the intents and + * entity types in the older version are deleted. After the restore, the + * restored draft agent will be trained automatically (unless disabled in + * agent settings). However, once the restore is done, training may not be + * completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when restoring is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::restoreAgentAsync()} . + * + * @example samples/V2/AgentsClient/restore_agent.php + * + * @param RestoreAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreAgent(RestoreAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreAgent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of agents. + * + * Since there is at most one conversational agent per project, this method is + * useful primarily for listing all agents across projects the caller has + * access to. One can achieve that with a wildcard project collection id "-". + * Refer to [List + * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * + * The async variant is {@see AgentsClient::searchAgentsAsync()} . + * + * @example samples/V2/AgentsClient/search_agents.php + * + * @param SearchAgentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAgents(SearchAgentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAgents', $request, $callOptions); + } + + /** + * Creates/updates the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::setAgentAsync()} . + * + * @example samples/V2/AgentsClient/set_agent.php + * + * @param SetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function setAgent(SetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('SetAgent', $request, $callOptions)->wait(); + } + + /** + * Trains the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::trainAgentAsync()} . + * + * @example samples/V2/AgentsClient/train_agent.php + * + * @param TrainAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function trainAgent(TrainAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TrainAgent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AgentsClient::getLocationAsync()} . + * + * @example samples/V2/AgentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AgentsClient::listLocationsAsync()} . + * + * @example samples/V2/AgentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/AnswerRecordsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/AnswerRecordsClient.php new file mode 100644 index 0000000..0182ba0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/AnswerRecordsClient.php @@ -0,0 +1,734 @@ + listAnswerRecordsAsync(ListAnswerRecordsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAnswerRecordAsync(UpdateAnswerRecordRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class AnswerRecordsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/answer_records_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/answer_records_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/answer_records_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/answer_records_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted answer_record resource. + */ + public static function answerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('answerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a intent + * resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted intent resource. + */ + public static function intentName(string $project, string $intent): string + { + return self::getPathTemplate('intent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted project_answer_record resource. + */ + public static function projectAnswerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('projectAnswerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_intent resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted project_intent resource. + */ + public static function projectIntentName(string $project, string $intent): string + { + return self::getPathTemplate('projectIntent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_answer_record resource. + * + * @param string $project + * @param string $location + * @param string $answerRecord + * + * @return string The formatted project_location_answer_record resource. + */ + public static function projectLocationAnswerRecordName(string $project, string $location, string $answerRecord): string + { + return self::getPathTemplate('projectLocationAnswerRecord')->render([ + 'project' => $project, + 'location' => $location, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_intent resource. + * + * @param string $project + * @param string $location + * @param string $intent + * + * @return string The formatted project_location_intent resource. + */ + public static function projectLocationIntentName(string $project, string $location, string $intent): string + { + return self::getPathTemplate('projectLocationIntent')->render([ + 'project' => $project, + 'location' => $location, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\AnswerRecordsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new AnswerRecordsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the list of all answer records in the specified project in reverse + * chronological order. + * + * The async variant is {@see AnswerRecordsClient::listAnswerRecordsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_answer_records.php + * + * @param ListAnswerRecordsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAnswerRecords(ListAnswerRecordsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAnswerRecords', $request, $callOptions); + } + + /** + * Updates the specified answer record. + * + * The async variant is {@see AnswerRecordsClient::updateAnswerRecordAsync()} . + * + * @example samples/V2/AnswerRecordsClient/update_answer_record.php + * + * @param UpdateAnswerRecordRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnswerRecord + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAnswerRecord(UpdateAnswerRecordRequest $request, array $callOptions = []): AnswerRecord + { + return $this->startApiCall('UpdateAnswerRecord', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AnswerRecordsClient::getLocationAsync()} . + * + * @example samples/V2/AnswerRecordsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AnswerRecordsClient::listLocationsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ContextsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ContextsClient.php new file mode 100644 index 0000000..eed6fbd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ContextsClient.php @@ -0,0 +1,646 @@ + createContextAsync(CreateContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAllContextsAsync(DeleteAllContextsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteContextAsync(DeleteContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface getContextAsync(GetContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface listContextsAsync(ListContextsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateContextAsync(UpdateContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ContextsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/contexts_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/contexts_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/contexts_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/contexts_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ContextsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ContextsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a context. + * + * If the specified context already exists, overrides the context. + * + * The async variant is {@see ContextsClient::createContextAsync()} . + * + * @example samples/V2/ContextsClient/create_context.php + * + * @param CreateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function createContext(CreateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('CreateContext', $request, $callOptions)->wait(); + } + + /** + * Deletes all active contexts in the specified session. + * + * The async variant is {@see ContextsClient::deleteAllContextsAsync()} . + * + * @example samples/V2/ContextsClient/delete_all_contexts.php + * + * @param DeleteAllContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAllContexts(DeleteAllContextsRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAllContexts', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified context. + * + * The async variant is {@see ContextsClient::deleteContextAsync()} . + * + * @example samples/V2/ContextsClient/delete_context.php + * + * @param DeleteContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteContext(DeleteContextRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteContext', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified context. + * + * The async variant is {@see ContextsClient::getContextAsync()} . + * + * @example samples/V2/ContextsClient/get_context.php + * + * @param GetContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function getContext(GetContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('GetContext', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all contexts in the specified session. + * + * The async variant is {@see ContextsClient::listContextsAsync()} . + * + * @example samples/V2/ContextsClient/list_contexts.php + * + * @param ListContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listContexts(ListContextsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListContexts', $request, $callOptions); + } + + /** + * Updates the specified context. + * + * The async variant is {@see ContextsClient::updateContextAsync()} . + * + * @example samples/V2/ContextsClient/update_context.php + * + * @param UpdateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateContext(UpdateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('UpdateContext', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ContextsClient::getLocationAsync()} . + * + * @example samples/V2/ContextsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ContextsClient::listLocationsAsync()} . + * + * @example samples/V2/ContextsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ConversationDatasetsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationDatasetsClient.php new file mode 100644 index 0000000..3e98f2d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationDatasetsClient.php @@ -0,0 +1,540 @@ + createConversationDatasetAsync(CreateConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationDatasetAsync(DeleteConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationDatasetAsync(GetConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface importConversationDataAsync(ImportConversationDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationDatasetsAsync(ListConversationDatasetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationDatasetsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_datasets_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_datasets_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_datasets_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_datasets_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_dataset resource. + * + * @param string $project + * @param string $location + * @param string $conversationDataset + * + * @return string The formatted conversation_dataset resource. + */ + public static function conversationDatasetName(string $project, string $location, string $conversationDataset): string + { + return self::getPathTemplate('conversationDataset')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_dataset' => $conversationDataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - conversationDataset: projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationDatasetsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationDatasetsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new conversation dataset. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + * - `response`: + * [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + * + * The async variant is + * {@see ConversationDatasetsClient::createConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/create_conversation_dataset.php + * + * @param CreateConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationDataset(CreateConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation dataset. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationDatasetsClient::deleteConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php + * + * @param DeleteConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationDataset(DeleteConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation dataset. + * + * The async variant is + * {@see ConversationDatasetsClient::getConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_conversation_dataset.php + * + * @param GetConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationDataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationDataset(GetConversationDatasetRequest $request, array $callOptions = []): ConversationDataset + { + return $this->startApiCall('GetConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Import data into the specified conversation dataset. Note that it + * is not allowed to import data to a conversation dataset that + * already has data in it. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + * - `response`: + * [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + * + * The async variant is + * {@see ConversationDatasetsClient::importConversationDataAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/import_conversation_data.php + * + * @param ImportConversationDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importConversationData(ImportConversationDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportConversationData', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation datasets in the specified + * project and location. + * + * The async variant is + * {@see ConversationDatasetsClient::listConversationDatasetsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_conversation_datasets.php + * + * @param ListConversationDatasetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationDatasets(ListConversationDatasetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationDatasets', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationDatasetsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationDatasetsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ConversationModelsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationModelsClient.php new file mode 100644 index 0000000..7addb5b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationModelsClient.php @@ -0,0 +1,830 @@ + createConversationModelAsync(CreateConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationModelEvaluationAsync(CreateConversationModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationModelAsync(DeleteConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deployConversationModelAsync(DeployConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationModelAsync(GetConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationModelEvaluationAsync(GetConversationModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationModelEvaluationsAsync(ListConversationModelEvaluationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationModelsAsync(ListConversationModelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeployConversationModelAsync(UndeployConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationModelsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_models_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_models_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_models_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_models_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_dataset resource. + * + * @param string $project + * @param string $location + * @param string $conversationDataset + * + * @return string The formatted conversation_dataset resource. + */ + public static function conversationDatasetName(string $project, string $location, string $conversationDataset): string + { + return self::getPathTemplate('conversationDataset')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_dataset' => $conversationDataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model_evaluation resource. + * + * @param string $project + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted conversation_model_evaluation resource. + */ + public static function conversationModelEvaluationName(string $project, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('conversationModelEvaluation')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model_evaluation resource. + * + * @param string $project + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted project_conversation_model_evaluation resource. + */ + public static function projectConversationModelEvaluationName(string $project, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('projectConversationModelEvaluation')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model_evaluation resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted project_location_conversation_model_evaluation resource. + */ + public static function projectLocationConversationModelEvaluationName(string $project, string $location, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('projectLocationConversationModelEvaluation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - conversationDataset: projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationModelEvaluation: projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationModelEvaluation: projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationModelEvaluation: projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationModelsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationModelsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a model. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + * - `response`: + * [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + * + * The async variant is + * {@see ConversationModelsClient::createConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model.php + * + * @param CreateConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModel(CreateConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModel', $request, $callOptions)->wait(); + } + + /** + * Creates evaluation of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::createConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php + * + * @param CreateConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModelEvaluation(CreateConversationModelEvaluationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Deletes a model. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deleteConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/delete_conversation_model.php + * + * @param DeleteConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationModel(DeleteConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationModel', $request, $callOptions)->wait(); + } + + /** + * Deploys a model. If a model is already deployed, deploying it + * has no effect. A model can only serve prediction requests after it gets + * deployed. For article suggestion, custom model will not be used unless + * it is deployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/deploy_conversation_model.php + * + * @param DeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployConversationModel(DeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model.php + * + * @param GetConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModel(GetConversationModelRequest $request, array $callOptions = []): ConversationModel + { + return $this->startApiCall('GetConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets an evaluation of conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php + * + * @param GetConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModelEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModelEvaluation(GetConversationModelEvaluationRequest $request, array $callOptions = []): ConversationModelEvaluation + { + return $this->startApiCall('GetConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Lists evaluations of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelEvaluationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php + * + * @param ListConversationModelEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModelEvaluations(ListConversationModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModelEvaluations', $request, $callOptions); + } + + /** + * Lists conversation models. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_models.php + * + * @param ListConversationModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModels(ListConversationModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModels', $request, $callOptions); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * If the model is currently being used: + * - For article suggestion, article suggestion will fallback to the default + * model if model is undeployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::undeployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/undeploy_conversation_model.php + * + * @param UndeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeployConversationModel(UndeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationModelsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationModelsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ConversationProfilesClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationProfilesClient.php new file mode 100644 index 0000000..0df3846 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationProfilesClient.php @@ -0,0 +1,941 @@ + clearSuggestionFeatureConfigAsync(ClearSuggestionFeatureConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationProfileAsync(CreateConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationProfileAsync(DeleteConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationProfileAsync(GetConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationProfilesAsync(ListConversationProfilesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSuggestionFeatureConfigAsync(SetSuggestionFeatureConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateConversationProfileAsync(UpdateConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationProfilesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_profiles_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_profiles_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_profiles_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_profiles_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cx_security_settings resource. + * + * @param string $project + * @param string $location + * @param string $securitySettings + * + * @return string The formatted cx_security_settings resource. + */ + public static function cXSecuritySettingsName(string $project, string $location, string $securitySettings): string + { + return self::getPathTemplate('cXSecuritySettings')->render([ + 'project' => $project, + 'location' => $location, + 'security_settings' => $securitySettings, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted conversation_profile resource. + */ + public static function conversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('conversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted project_conversation_profile resource. + */ + public static function projectConversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('projectConversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_profile resource. + * + * @param string $project + * @param string $location + * @param string $conversationProfile + * + * @return string The formatted project_location_conversation_profile resource. + */ + public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string + { + return self::getPathTemplate('projectLocationConversationProfile')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationProfilesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationProfilesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Clears a suggestion feature from a conversation profile for the given + * participant role. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + * - `response`: + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + * + * The async variant is + * {@see ConversationProfilesClient::clearSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php + * + * @param ClearSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function clearSuggestionFeatureConfig(ClearSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ClearSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Creates a conversation profile in the specified project. + * + * [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + * and + * [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is + * {@see ConversationProfilesClient::createConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/create_conversation_profile.php + * + * @param CreateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationProfile(CreateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('CreateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::deleteConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/delete_conversation_profile.php + * + * @param DeleteConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationProfile(DeleteConversationProfileRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::getConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_conversation_profile.php + * + * @param GetConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationProfile(GetConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('GetConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation profiles in the specified project. + * + * The async variant is + * {@see ConversationProfilesClient::listConversationProfilesAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_conversation_profiles.php + * + * @param ListConversationProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationProfiles(ListConversationProfilesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationProfiles', $request, $callOptions); + } + + /** + * Adds or updates a suggestion feature in a conversation profile. + * If the conversation profile contains the type of suggestion feature for + * the participant role, it will update it. Otherwise it will insert the + * suggestion feature. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + * - `response`: + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + * + * If a long running operation to add or update suggestion feature + * config for the same conversation profile, participant role and suggestion + * feature type exists, please cancel the existing long running operation + * before sending such request, otherwise the request will be rejected. + * + * The async variant is + * {@see ConversationProfilesClient::setSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php + * + * @param SetSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSuggestionFeatureConfig(SetSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the specified conversation profile. + * + * [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + * and + * [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is + * {@see ConversationProfilesClient::updateConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/update_conversation_profile.php + * + * @param UpdateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConversationProfile(UpdateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('UpdateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationProfilesClient::getLocationAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationProfilesClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ConversationsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationsClient.php new file mode 100644 index 0000000..f3a966a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ConversationsClient.php @@ -0,0 +1,1175 @@ + completeConversationAsync(CompleteConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationAsync(CreateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateStatelessSuggestionAsync(GenerateStatelessSuggestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateStatelessSummaryAsync(GenerateStatelessSummaryRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateSuggestionsAsync(GenerateSuggestionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface ingestContextReferencesAsync(IngestContextReferencesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMessagesAsync(ListMessagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchKnowledgeAsync(SearchKnowledgeRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestConversationSummaryAsync(SuggestConversationSummaryRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cx_security_settings resource. + * + * @param string $project + * @param string $location + * @param string $securitySettings + * + * @return string The formatted cx_security_settings resource. + */ + public static function cXSecuritySettingsName(string $project, string $location, string $securitySettings): string + { + return self::getPathTemplate('cXSecuritySettings')->render([ + 'project' => $project, + 'location' => $location, + 'security_settings' => $securitySettings, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a conversation + * resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted conversation resource. + */ + public static function conversationName(string $project, string $conversation): string + { + return self::getPathTemplate('conversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted conversation_profile resource. + */ + public static function conversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('conversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted data_store resource. + */ + public static function dataStoreName(string $project, string $location, string $collection, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('message')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted project_conversation resource. + */ + public static function projectConversationName(string $project, string $conversation): string + { + return self::getPathTemplate('projectConversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_message resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted project_conversation_message resource. + */ + public static function projectConversationMessageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('projectConversationMessage')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted project_conversation_profile resource. + */ + public static function projectConversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('projectConversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + */ + public static function projectLocationCollectionDataStoreName(string $project, string $location, string $collection, string $dataStore): string + { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * + * @return string The formatted project_location_conversation resource. + */ + public static function projectLocationConversationName(string $project, string $location, string $conversation): string + { + return self::getPathTemplate('projectLocationConversation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_message resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $message + * + * @return string The formatted project_location_conversation_message resource. + */ + public static function projectLocationConversationMessageName(string $project, string $location, string $conversation, string $message): string + { + return self::getPathTemplate('projectLocationConversationMessage')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_profile resource. + * + * @param string $project + * @param string $location + * @param string $conversationProfile + * + * @return string The formatted project_location_conversation_profile resource. + */ + public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string + { + return self::getPathTemplate('projectLocationConversationProfile')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} + * - conversation: projects/{project}/conversations/{conversation} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - dataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectConversation: projects/{project}/conversations/{conversation} + * - projectConversationMessage: projects/{project}/conversations/{conversation}/messages/{message} + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - projectLocationConversation: projects/{project}/locations/{location}/conversations/{conversation} + * - projectLocationConversationMessage: projects/{project}/locations/{location}/conversations/{conversation}/messages/{message} + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * The async variant is {@see ConversationsClient::completeConversationAsync()} . + * + * @example samples/V2/ConversationsClient/complete_conversation.php + * + * @param CompleteConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function completeConversation(CompleteConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CompleteConversation', $request, $callOptions)->wait(); + } + + /** + * Creates a new conversation. Conversations are auto-completed after 24 + * hours. + * + * Conversation Lifecycle: + * There are two stages during a conversation: Automated Agent Stage and + * Assist Stage. + * + * For Automated Agent Stage, there will be a dialogflow agent responding to + * user queries. + * + * For Assist Stage, there's no dialogflow agent responding to user queries. + * But we will provide suggestions which are generated from conversation. + * + * If + * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] + * is configured for a dialogflow agent, conversation will start from + * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + * during `Automated Agent Stage`, once an + * [Intent][google.cloud.dialogflow.v2.Intent] with + * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] + * is triggered, conversation will transfer to Assist Stage. + * + * The async variant is {@see ConversationsClient::createConversationAsync()} . + * + * @example samples/V2/ConversationsClient/create_conversation.php + * + * @param CreateConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversation(CreateConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a suggestion for a conversation that does not have a + * resource created for it. + * + * The async variant is + * {@see ConversationsClient::generateStatelessSuggestionAsync()} . + * + * @example samples/V2/ConversationsClient/generate_stateless_suggestion.php + * + * @param GenerateStatelessSuggestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSuggestionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSuggestion(GenerateStatelessSuggestionRequest $request, array $callOptions = []): GenerateStatelessSuggestionResponse + { + return $this->startApiCall('GenerateStatelessSuggestion', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a summary for a conversation that does not have a + * resource created for it. + * + * The async variant is {@see ConversationsClient::generateStatelessSummaryAsync()} + * . + * + * @example samples/V2/ConversationsClient/generate_stateless_summary.php + * + * @param GenerateStatelessSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSummary(GenerateStatelessSummaryRequest $request, array $callOptions = []): GenerateStatelessSummaryResponse + { + return $this->startApiCall('GenerateStatelessSummary', $request, $callOptions)->wait(); + } + + /** + * Generates all the suggestions using generators configured in the + * conversation profile. A generator is used only if its trigger event is + * matched. + * + * The async variant is {@see ConversationsClient::generateSuggestionsAsync()} . + * + * @example samples/V2/ConversationsClient/generate_suggestions.php + * + * @param GenerateSuggestionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateSuggestionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateSuggestions(GenerateSuggestionsRequest $request, array $callOptions = []): GenerateSuggestionsResponse + { + return $this->startApiCall('GenerateSuggestions', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specific conversation. + * + * The async variant is {@see ConversationsClient::getConversationAsync()} . + * + * @example samples/V2/ConversationsClient/get_conversation.php + * + * @param GetConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversation(GetConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); + } + + /** + * Data ingestion API. + * Ingests context references for an existing conversation. + * + * The async variant is {@see ConversationsClient::ingestContextReferencesAsync()} + * . + * + * @example samples/V2/ConversationsClient/ingest_context_references.php + * + * @param IngestContextReferencesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return IngestContextReferencesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function ingestContextReferences(IngestContextReferencesRequest $request, array $callOptions = []): IngestContextReferencesResponse + { + return $this->startApiCall('IngestContextReferences', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversations in the specified project. + * + * The async variant is {@see ConversationsClient::listConversationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_conversations.php + * + * @param ListConversationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversations', $request, $callOptions); + } + + /** + * Lists messages that belong to a given conversation. + * `messages` are ordered by `create_time` in descending order. To fetch + * updates without duplication, send request with filter + * `create_time_epoch_microseconds > + * [first item's create_time of previous request]` and empty page_token. + * + * The async variant is {@see ConversationsClient::listMessagesAsync()} . + * + * @example samples/V2/ConversationsClient/list_messages.php + * + * @param ListMessagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMessages', $request, $callOptions); + } + + /** + * Get answers for the given query based on knowledge documents. + * + * The async variant is {@see ConversationsClient::searchKnowledgeAsync()} . + * + * @example samples/V2/ConversationsClient/search_knowledge.php + * + * @param SearchKnowledgeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SearchKnowledgeResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchKnowledge(SearchKnowledgeRequest $request, array $callOptions = []): SearchKnowledgeResponse + { + return $this->startApiCall('SearchKnowledge', $request, $callOptions)->wait(); + } + + /** + * Suggests summary for a conversation based on specific historical messages. + * The range of the messages to be used for summary can be specified in the + * request. + * + * The async variant is + * {@see ConversationsClient::suggestConversationSummaryAsync()} . + * + * @example samples/V2/ConversationsClient/suggest_conversation_summary.php + * + * @param SuggestConversationSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestConversationSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestConversationSummary(SuggestConversationSummaryRequest $request, array $callOptions = []): SuggestConversationSummaryResponse + { + return $this->startApiCall('SuggestConversationSummary', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/DocumentsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/DocumentsClient.php new file mode 100644 index 0000000..8650f8e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/DocumentsClient.php @@ -0,0 +1,724 @@ + createDocumentAsync(CreateDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDocumentAsync(DeleteDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDocumentAsync(ExportDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDocumentAsync(GetDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDocumentsAsync(ImportDocumentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDocumentsAsync(ListDocumentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface reloadDocumentAsync(ReloadDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDocumentAsync(UpdateDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DocumentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/documents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/documents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/documents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/documents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\DocumentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new DocumentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::createDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/create_document.php + * + * @param CreateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDocument(CreateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is {@see DocumentsClient::deleteDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/delete_document.php + * + * @param DeleteDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); + } + + /** + * Exports a smart messaging candidate document into the specified + * destination. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::exportDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/export_document.php + * + * @param ExportDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportDocument(ExportDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportDocument', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified document. + * + * The async variant is {@see DocumentsClient::getDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/get_document.php + * + * @param GetDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); + } + + /** + * Creates documents by importing data from external sources. + * Dialogflow supports up to 350 documents in each request. If you try to + * import more, Dialogflow will return an error. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: + * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] + * + * The async variant is {@see DocumentsClient::importDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/import_documents.php + * + * @param ImportDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all documents of the knowledge base. + * + * The async variant is {@see DocumentsClient::listDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/list_documents.php + * + * @param ListDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDocuments', $request, $callOptions); + } + + /** + * Reloads the specified document from its specified source, content_uri or + * content. The previously loaded content of the document will be deleted. + * Note: Even when the content of the document has not changed, there still + * may be side effects because of internal implementation changes. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * The async variant is {@see DocumentsClient::reloadDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/reload_document.php + * + * @param ReloadDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reloadDocument(ReloadDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ReloadDocument', $request, $callOptions)->wait(); + } + + /** + * Updates the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::updateDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/update_document.php + * + * @param UpdateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DocumentsClient::getLocationAsync()} . + * + * @example samples/V2/DocumentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DocumentsClient::listLocationsAsync()} . + * + * @example samples/V2/DocumentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/EncryptionSpecServiceClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/EncryptionSpecServiceClient.php new file mode 100644 index 0000000..03095cc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/EncryptionSpecServiceClient.php @@ -0,0 +1,401 @@ + getEncryptionSpecAsync(GetEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface initializeEncryptionSpecAsync(InitializeEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EncryptionSpecServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.EncryptionSpecService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/encryption_spec_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * encryption_spec resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted encryption_spec resource. + */ + public static function encryptionSpecName(string $project, string $location): string + { + return self::getPathTemplate('encryptionSpec')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EncryptionSpecServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EncryptionSpecServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets location-level encryption key specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::getEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php + * + * @param GetEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EncryptionSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $callOptions = []): EncryptionSpec + { + return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Initializes a location-level encryption key specification. An error will + * be thrown if the location has resources already created before the + * initialization. Once the encryption specification is initialized at a + * location, it is immutable and all newly created resources under the + * location will be encrypted with the existing specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::initializeEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php + * + * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeEncryptionSpec(InitializeEncryptionSpecRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EncryptionSpecServiceClient::getLocationAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EncryptionSpecServiceClient::listLocationsAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/EntityTypesClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/EntityTypesClient.php new file mode 100644 index 0000000..1496933 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/EntityTypesClient.php @@ -0,0 +1,787 @@ + batchCreateEntitiesAsync(BatchCreateEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface createEntityTypeAsync(CreateEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteEntityTypeAsync(DeleteEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEntityTypeAsync(GetEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEntityTypesAsync(ListEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateEntityTypeAsync(UpdateEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EntityTypesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/entity_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/entity_types_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/entity_types_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/entity_types_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a entity_type + * resource. + * + * @param string $project + * @param string $entityType + * + * @return string The formatted entity_type resource. + */ + public static function entityTypeName(string $project, string $entityType): string + { + return self::getPathTemplate('entityType')->render([ + 'project' => $project, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_entity_type resource. + * + * @param string $project + * @param string $entityType + * + * @return string The formatted project_entity_type resource. + */ + public static function projectEntityTypeName(string $project, string $entityType): string + { + return self::getPathTemplate('projectEntityType')->render([ + 'project' => $project, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $entityType + * + * @return string The formatted project_location_entity_type resource. + */ + public static function projectLocationEntityTypeName(string $project, string $location, string $entityType): string + { + return self::getPathTemplate('projectLocationEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - entityType: projects/{project}/agent/entityTypes/{entity_type} + * - projectAgent: projects/{project}/agent + * - projectEntityType: projects/{project}/agent/entityTypes/{entity_type} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEntityType: projects/{project}/locations/{location}/agent/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EntityTypesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EntityTypesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates multiple new entities in the specified entity type. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchCreateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_create_entities.php + * + * @param BatchCreateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCreateEntities(BatchCreateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchCreateEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entities in the specified entity type. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entities.php + * + * @param BatchDeleteEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntities(BatchDeleteEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entity_types.php + * + * @param BatchDeleteEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntityTypes(BatchDeleteEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Updates or creates multiple entities in the specified entity type. This + * method does not affect entities in the entity type that aren't explicitly + * specified in the request. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * + * The async variant is {@see EntityTypesClient::batchUpdateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entities.php + * + * @param BatchUpdateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntities(BatchUpdateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntities', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchUpdateEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entity_types.php + * + * @param BatchUpdateEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntityTypes(BatchUpdateEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::createEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/create_entity_type.php + * + * @param CreateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEntityType(CreateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('CreateEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::deleteEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/delete_entity_type.php + * + * @param DeleteEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEntityType(DeleteEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified entity type. + * + * The async variant is {@see EntityTypesClient::getEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/get_entity_type.php + * + * @param GetEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEntityType(GetEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('GetEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all entity types in the specified agent. + * + * The async variant is {@see EntityTypesClient::listEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/list_entity_types.php + * + * @param ListEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEntityTypes(ListEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::updateEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/update_entity_type.php + * + * @param UpdateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEntityType(UpdateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('UpdateEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/EntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/EntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/EnvironmentsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/EnvironmentsClient.php new file mode 100644 index 0000000..4a5ad30 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/EnvironmentsClient.php @@ -0,0 +1,655 @@ + createEnvironmentAsync(CreateEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteEnvironmentAsync(DeleteEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEnvironmentAsync(GetEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEnvironmentHistoryAsync(GetEnvironmentHistoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEnvironmentsAsync(ListEnvironmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateEnvironmentAsync(UpdateEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EnvironmentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/environments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/environments_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/environments_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/environments_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a environment + * resource. + * + * @param string $project + * @param string $environment + * + * @return string The formatted environment resource. + */ + public static function environmentName(string $project, string $environment): string + { + return self::getPathTemplate('environment')->render([ + 'project' => $project, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a fulfillment + * resource. + * + * @param string $project + * + * @return string The formatted fulfillment resource. + */ + public static function fulfillmentName(string $project): string + { + return self::getPathTemplate('fulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment resource. + * + * @param string $project + * @param string $environment + * + * @return string The formatted project_environment resource. + */ + public static function projectEnvironmentName(string $project, string $environment): string + { + return self::getPathTemplate('projectEnvironment')->render([ + 'project' => $project, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_fulfillment resource. + * + * @param string $project + * + * @return string The formatted project_fulfillment resource. + */ + public static function projectFulfillmentName(string $project): string + { + return self::getPathTemplate('projectFulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment resource. + * + * @param string $project + * @param string $location + * @param string $environment + * + * @return string The formatted project_location_environment resource. + */ + public static function projectLocationEnvironmentName(string $project, string $location, string $environment): string + { + return self::getPathTemplate('projectLocationEnvironment')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_fulfillment resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_fulfillment resource. + */ + public static function projectLocationFulfillmentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationFulfillment')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_version resource. + * + * @param string $project + * @param string $location + * @param string $version + * + * @return string The formatted project_location_version resource. + */ + public static function projectLocationVersionName(string $project, string $location, string $version): string + { + return self::getPathTemplate('projectLocationVersion')->render([ + 'project' => $project, + 'location' => $location, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_version resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted project_version resource. + */ + public static function projectVersionName(string $project, string $version): string + { + return self::getPathTemplate('projectVersion')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a version + * resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted version resource. + */ + public static function versionName(string $project, string $version): string + { + return self::getPathTemplate('version')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - environment: projects/{project}/agent/environments/{environment} + * - fulfillment: projects/{project}/agent/fulfillment + * - projectAgent: projects/{project}/agent + * - projectEnvironment: projects/{project}/agent/environments/{environment} + * - projectFulfillment: projects/{project}/agent/fulfillment + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEnvironment: projects/{project}/locations/{location}/agent/environments/{environment} + * - projectLocationFulfillment: projects/{project}/locations/{location}/agent/fulfillment + * - projectLocationVersion: projects/{project}/locations/{location}/agent/versions/{version} + * - projectVersion: projects/{project}/agent/versions/{version} + * - version: projects/{project}/agent/versions/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EnvironmentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EnvironmentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an agent environment. + * + * The async variant is {@see EnvironmentsClient::createEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/create_environment.php + * + * @param CreateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEnvironment(CreateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('CreateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::deleteEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/delete_environment.php + * + * @param DeleteEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEnvironment(DeleteEnvironmentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEnvironment', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment.php + * + * @param GetEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironment(GetEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('GetEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets the history of the specified environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentHistoryAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment_history.php + * + * @param GetEnvironmentHistoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironmentHistory(GetEnvironmentHistoryRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('GetEnvironmentHistory', $request, $callOptions); + } + + /** + * Returns the list of all non-default environments of the specified agent. + * + * The async variant is {@see EnvironmentsClient::listEnvironmentsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_environments.php + * + * @param ListEnvironmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEnvironments(ListEnvironmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEnvironments', $request, $callOptions); + } + + /** + * Updates the specified agent environment. + * + * This method allows you to deploy new agent versions into the environment. + * When an environment is pointed to a new agent version by setting + * `environment.agent_version`, the environment is temporarily set to the + * `LOADING` state. During that time, the environment continues serving the + * previous version of the agent. After the new agent version is done loading, + * the environment is set back to the `RUNNING` state. + * You can use "-" as Environment ID in environment name to update an agent + * version in the default environment. WARNING: this will negate all recent + * changes to the draft agent and can't be undone. You may want to save the + * draft agent to a version before calling this method. + * + * The async variant is {@see EnvironmentsClient::updateEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/update_environment.php + * + * @param UpdateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEnvironment(UpdateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('UpdateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EnvironmentsClient::getLocationAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EnvironmentsClient::listLocationsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/FulfillmentsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/FulfillmentsClient.php new file mode 100644 index 0000000..a7ed384 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/FulfillmentsClient.php @@ -0,0 +1,372 @@ + getFulfillmentAsync(GetFulfillmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFulfillmentAsync(UpdateFulfillmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class FulfillmentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/fulfillments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/fulfillments_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/fulfillments_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/fulfillments_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a fulfillment + * resource. + * + * @param string $project + * + * @return string The formatted fulfillment resource. + */ + public static function fulfillmentName(string $project): string + { + return self::getPathTemplate('fulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_fulfillment resource. + * + * @param string $project + * + * @return string The formatted project_fulfillment resource. + */ + public static function projectFulfillmentName(string $project): string + { + return self::getPathTemplate('projectFulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_fulfillment resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_fulfillment resource. + */ + public static function projectLocationFulfillmentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationFulfillment')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - fulfillment: projects/{project}/agent/fulfillment + * - projectFulfillment: projects/{project}/agent/fulfillment + * - projectLocationFulfillment: projects/{project}/locations/{location}/agent/fulfillment + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\FulfillmentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new FulfillmentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the fulfillment. + * + * The async variant is {@see FulfillmentsClient::getFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_fulfillment.php + * + * @param GetFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFulfillment(GetFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('GetFulfillment', $request, $callOptions)->wait(); + } + + /** + * Updates the fulfillment. + * + * The async variant is {@see FulfillmentsClient::updateFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/update_fulfillment.php + * + * @param UpdateFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFulfillment(UpdateFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('UpdateFulfillment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see FulfillmentsClient::getLocationAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see FulfillmentsClient::listLocationsAsync()} . + * + * @example samples/V2/FulfillmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/GeneratorsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/GeneratorsClient.php new file mode 100644 index 0000000..b891a18 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/GeneratorsClient.php @@ -0,0 +1,444 @@ + createGeneratorAsync(CreateGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteGeneratorAsync(DeleteGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGeneratorAsync(GetGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGeneratorsAsync(ListGeneratorsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateGeneratorAsync(UpdateGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class GeneratorsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Generators'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\GeneratorsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new GeneratorsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a generator. + * + * The async variant is {@see GeneratorsClient::createGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/create_generator.php + * + * @param CreateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGenerator(CreateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('CreateGenerator', $request, $callOptions)->wait(); + } + + /** + * Deletes a generator. + * + * The async variant is {@see GeneratorsClient::deleteGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/delete_generator.php + * + * @param DeleteGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGenerator(DeleteGeneratorRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGenerator', $request, $callOptions)->wait(); + } + + /** + * Retrieves a generator. + * + * The async variant is {@see GeneratorsClient::getGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/get_generator.php + * + * @param GetGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGenerator(GetGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('GetGenerator', $request, $callOptions)->wait(); + } + + /** + * Lists generators. + * + * The async variant is {@see GeneratorsClient::listGeneratorsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_generators.php + * + * @param ListGeneratorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGenerators(ListGeneratorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGenerators', $request, $callOptions); + } + + /** + * Updates a generator. + * + * The async variant is {@see GeneratorsClient::updateGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/update_generator.php + * + * @param UpdateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerator(UpdateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('UpdateGenerator', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see GeneratorsClient::getLocationAsync()} . + * + * @example samples/V2/GeneratorsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see GeneratorsClient::listLocationsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/IntentsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/IntentsClient.php new file mode 100644 index 0000000..37ea2d0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/IntentsClient.php @@ -0,0 +1,874 @@ + batchDeleteIntentsAsync(BatchDeleteIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateIntentsAsync(BatchUpdateIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface createIntentAsync(CreateIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteIntentAsync(DeleteIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIntentAsync(GetIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listIntentsAsync(ListIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateIntentAsync(UpdateIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class IntentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/intents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/intents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/intents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/intents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a intent + * resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted intent resource. + */ + public static function intentName(string $project, string $intent): string + { + return self::getPathTemplate('intent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_intent resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted project_intent resource. + */ + public static function projectIntentName(string $project, string $intent): string + { + return self::getPathTemplate('projectIntent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_intent resource. + * + * @param string $project + * @param string $location + * @param string $intent + * + * @return string The formatted project_location_intent resource. + */ + public static function projectLocationIntentName(string $project, string $location, string $intent): string + { + return self::getPathTemplate('projectLocationIntent')->render([ + 'project' => $project, + 'location' => $location, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - projectAgent: projects/{project}/agent + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\IntentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new IntentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::batchDeleteIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_delete_intents.php + * + * @param BatchDeleteIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteIntents(BatchDeleteIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteIntents', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::batchUpdateIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_update_intents.php + * + * @param BatchUpdateIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateIntents(BatchUpdateIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateIntents', $request, $callOptions)->wait(); + } + + /** + * Creates an intent in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::createIntentAsync()} . + * + * @example samples/V2/IntentsClient/create_intent.php + * + * @param CreateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function createIntent(CreateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('CreateIntent', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified intent and its direct or indirect followup intents. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::deleteIntentAsync()} . + * + * @example samples/V2/IntentsClient/delete_intent.php + * + * @param DeleteIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIntent(DeleteIntentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteIntent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified intent. + * + * The async variant is {@see IntentsClient::getIntentAsync()} . + * + * @example samples/V2/IntentsClient/get_intent.php + * + * @param GetIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIntent(GetIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('GetIntent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all intents in the specified agent. + * + * The async variant is {@see IntentsClient::listIntentsAsync()} . + * + * @example samples/V2/IntentsClient/list_intents.php + * + * @param ListIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIntents(ListIntentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIntents', $request, $callOptions); + } + + /** + * Updates the specified intent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::updateIntentAsync()} . + * + * @example samples/V2/IntentsClient/update_intent.php + * + * @param UpdateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateIntent(UpdateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('UpdateIntent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see IntentsClient::getLocationAsync()} . + * + * @example samples/V2/IntentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see IntentsClient::listLocationsAsync()} . + * + * @example samples/V2/IntentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/KnowledgeBasesClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/KnowledgeBasesClient.php new file mode 100644 index 0000000..a2e0e6c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/KnowledgeBasesClient.php @@ -0,0 +1,495 @@ + createKnowledgeBaseAsync(CreateKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getKnowledgeBaseAsync(GetKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface listKnowledgeBasesAsync(ListKnowledgeBasesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class KnowledgeBasesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/knowledge_bases_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/knowledge_bases_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/knowledge_bases_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/knowledge_bases_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\KnowledgeBasesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new KnowledgeBasesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::createKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/create_knowledge_base.php + * + * @param CreateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKnowledgeBase(CreateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('CreateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::deleteKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/delete_knowledge_base.php + * + * @param DeleteKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteKnowledgeBase(DeleteKnowledgeBaseRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::getKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_knowledge_base.php + * + * @param GetKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKnowledgeBase(GetKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('GetKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all knowledge bases of the specified agent. + * + * The async variant is {@see KnowledgeBasesClient::listKnowledgeBasesAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_knowledge_bases.php + * + * @param ListKnowledgeBasesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKnowledgeBases(ListKnowledgeBasesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListKnowledgeBases', $request, $callOptions); + } + + /** + * Updates the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::updateKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/update_knowledge_base.php + * + * @param UpdateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateKnowledgeBase(UpdateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('UpdateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see KnowledgeBasesClient::getLocationAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see KnowledgeBasesClient::listLocationsAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/ParticipantsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/ParticipantsClient.php new file mode 100644 index 0000000..6a003b5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/ParticipantsClient.php @@ -0,0 +1,1093 @@ + analyzeContentAsync(AnalyzeContentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createParticipantAsync(CreateParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface getParticipantAsync(GetParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface listParticipantsAsync(ListParticipantsRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestArticlesAsync(SuggestArticlesRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestFaqAnswersAsync(SuggestFaqAnswersRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestKnowledgeAssistAsync(SuggestKnowledgeAssistRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestSmartRepliesAsync(SuggestSmartRepliesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateParticipantAsync(UpdateParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ParticipantsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/participants_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/participants_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/participants_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/participants_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a conversation + * resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted conversation resource. + */ + public static function conversationName(string $project, string $conversation): string + { + return self::getPathTemplate('conversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('message')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a participant + * resource. + * + * @param string $project + * @param string $conversation + * @param string $participant + * + * @return string The formatted participant resource. + */ + public static function participantName(string $project, string $conversation, string $participant): string + { + return self::getPathTemplate('participant')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted project_conversation resource. + */ + public static function projectConversationName(string $project, string $conversation): string + { + return self::getPathTemplate('projectConversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_message resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted project_conversation_message resource. + */ + public static function projectConversationMessageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('projectConversationMessage')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_participant resource. + * + * @param string $project + * @param string $conversation + * @param string $participant + * + * @return string The formatted project_conversation_participant resource. + */ + public static function projectConversationParticipantName(string $project, string $conversation, string $participant): string + { + return self::getPathTemplate('projectConversationParticipant')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * + * @return string The formatted project_location_conversation resource. + */ + public static function projectLocationConversationName(string $project, string $location, string $conversation): string + { + return self::getPathTemplate('projectLocationConversation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_message resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $message + * + * @return string The formatted project_location_conversation_message resource. + */ + public static function projectLocationConversationMessageName(string $project, string $location, string $conversation, string $message): string + { + return self::getPathTemplate('projectLocationConversationMessage')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_participant resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $participant + * + * @return string The formatted project_location_conversation_participant resource. + */ + public static function projectLocationConversationParticipantName(string $project, string $location, string $conversation, string $participant): string + { + return self::getPathTemplate('projectLocationConversationParticipant')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - conversation: projects/{project}/conversations/{conversation} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - participant: projects/{project}/conversations/{conversation}/participants/{participant} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - projectConversation: projects/{project}/conversations/{conversation} + * - projectConversationMessage: projects/{project}/conversations/{conversation}/messages/{message} + * - projectConversationParticipant: projects/{project}/conversations/{conversation}/participants/{participant} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationConversation: projects/{project}/locations/{location}/conversations/{conversation} + * - projectLocationConversationMessage: projects/{project}/locations/{location}/conversations/{conversation}/messages/{message} + * - projectLocationConversationParticipant: projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ParticipantsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ParticipantsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * + * Note: Always use agent versions for production traffic + * sent to virtual agents. See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * The async variant is {@see ParticipantsClient::analyzeContentAsync()} . + * + * @example samples/V2/ParticipantsClient/analyze_content.php + * + * @param AnalyzeContentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeContentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeContent(AnalyzeContentRequest $request, array $callOptions = []): AnalyzeContentResponse + { + return $this->startApiCall('AnalyzeContent', $request, $callOptions)->wait(); + } + + /** + * Creates a new participant in a conversation. + * + * The async variant is {@see ParticipantsClient::createParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/create_participant.php + * + * @param CreateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function createParticipant(CreateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('CreateParticipant', $request, $callOptions)->wait(); + } + + /** + * Retrieves a conversation participant. + * + * The async variant is {@see ParticipantsClient::getParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/get_participant.php + * + * @param GetParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function getParticipant(GetParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('GetParticipant', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all participants in the specified conversation. + * + * The async variant is {@see ParticipantsClient::listParticipantsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_participants.php + * + * @param ListParticipantsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listParticipants(ListParticipantsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListParticipants', $request, $callOptions); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * Note: This method is only available through the gRPC API (not REST). + * + * The top-level message sent to the client by the server is + * `StreamingAnalyzeContentResponse`. Multiple response messages can be + * returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete + * transcript of what the user said. The next message contains the + * `reply_text` field and potentially the `reply_audio` field. The message can + * also contain the `automated_agent_reply` field. + * + * Note: Always use agent versions for production traffic + * sent to virtual agents. See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/ParticipantsClient/streaming_analyze_content.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingAnalyzeContent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingAnalyzeContent', null, $callOptions); + } + + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestArticlesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_articles.php + * + * @param SuggestArticlesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestArticlesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestArticles(SuggestArticlesRequest $request, array $callOptions = []): SuggestArticlesResponse + { + return $this->startApiCall('SuggestArticles', $request, $callOptions)->wait(); + } + + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestFaqAnswersAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_faq_answers.php + * + * @param SuggestFaqAnswersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestFaqAnswersResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestFaqAnswers(SuggestFaqAnswersRequest $request, array $callOptions = []): SuggestFaqAnswersResponse + { + return $this->startApiCall('SuggestFaqAnswers', $request, $callOptions)->wait(); + } + + /** + * Gets knowledge assist suggestions based on historical messages. + * + * The async variant is {@see ParticipantsClient::suggestKnowledgeAssistAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_knowledge_assist.php + * + * @param SuggestKnowledgeAssistRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestKnowledgeAssistResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestKnowledgeAssist(SuggestKnowledgeAssistRequest $request, array $callOptions = []): SuggestKnowledgeAssistResponse + { + return $this->startApiCall('SuggestKnowledgeAssist', $request, $callOptions)->wait(); + } + + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestSmartRepliesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_smart_replies.php + * + * @param SuggestSmartRepliesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestSmartRepliesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestSmartReplies(SuggestSmartRepliesRequest $request, array $callOptions = []): SuggestSmartRepliesResponse + { + return $this->startApiCall('SuggestSmartReplies', $request, $callOptions)->wait(); + } + + /** + * Updates the specified participant. + * + * The async variant is {@see ParticipantsClient::updateParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/update_participant.php + * + * @param UpdateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateParticipant(UpdateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('UpdateParticipant', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParticipantsClient::getLocationAsync()} . + * + * @example samples/V2/ParticipantsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ParticipantsClient::listLocationsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/SessionEntityTypesClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/SessionEntityTypesClient.php new file mode 100644 index 0000000..8356eaf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/SessionEntityTypesClient.php @@ -0,0 +1,647 @@ + createSessionEntityTypeAsync(CreateSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSessionEntityTypeAsync(DeleteSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSessionEntityTypeAsync(GetSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSessionEntityTypesAsync(ListSessionEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSessionEntityTypeAsync(UpdateSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class SessionEntityTypesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/session_entity_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/session_entity_types_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/session_entity_types_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/session_entity_types_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\SessionEntityTypesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SessionEntityTypesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a session entity type. + * + * If the specified session entity type already exists, overrides the session + * entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::createSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/create_session_entity_type.php + * + * @param CreateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSessionEntityType(CreateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('CreateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::deleteSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/delete_session_entity_type.php + * + * @param DeleteSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSessionEntityType(DeleteSessionEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::getSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_session_entity_type.php + * + * @param GetSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSessionEntityType(GetSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('GetSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all session entity types in the specified session. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::listSessionEntityTypesAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_session_entity_types.php + * + * @param ListSessionEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSessionEntityTypes(ListSessionEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSessionEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::updateSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/update_session_entity_type.php + * + * @param UpdateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSessionEntityType(UpdateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('UpdateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionEntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see SessionEntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/SessionsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/SessionsClient.php new file mode 100644 index 0000000..e4a5048 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/SessionsClient.php @@ -0,0 +1,692 @@ + detectIntentAsync(DetectIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class SessionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/sessions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/sessions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/sessions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/sessions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\SessionsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SessionsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Processes a natural language query and returns structured, actionable data + * as a result. This method is not idempotent, because it may cause contexts + * and session entity types to be updated, which in turn might affect + * results of future queries. + * + * If you might use + * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + * or other CCAI products now or in the future, consider using + * [AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * instead of `DetectIntent`. `AnalyzeContent` has additional + * functionality for Agent Assist and other CCAI products. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * The async variant is {@see SessionsClient::detectIntentAsync()} . + * + * @example samples/V2/SessionsClient/detect_intent.php + * + * @param DetectIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DetectIntentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detectIntent(DetectIntentRequest $request, array $callOptions = []): DetectIntentResponse + { + return $this->startApiCall('DetectIntent', $request, $callOptions)->wait(); + } + + /** + * Processes a natural language query in audio format in a streaming fashion + * and returns structured, actionable data as a result. This method is only + * available via the gRPC API (not REST). + * + * If you might use + * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + * or other CCAI products now or in the future, consider using + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has + * additional functionality for Agent Assist and other CCAI products. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/SessionsClient/streaming_detect_intent.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingDetectIntent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingDetectIntent', null, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionsClient::getLocationAsync()} . + * + * @example samples/V2/SessionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see SessionsClient::listLocationsAsync()} . + * + * @example samples/V2/SessionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/Client/VersionsClient.php b/vendor/google/cloud-dialogflow/src/V2/Client/VersionsClient.php new file mode 100644 index 0000000..5cbc2ef --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Client/VersionsClient.php @@ -0,0 +1,516 @@ + createVersionAsync(CreateVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteVersionAsync(DeleteVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getVersionAsync(GetVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listVersionsAsync(ListVersionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateVersionAsync(UpdateVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class VersionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/versions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/versions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/versions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/versions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_version resource. + * + * @param string $project + * @param string $location + * @param string $version + * + * @return string The formatted project_location_version resource. + */ + public static function projectLocationVersionName(string $project, string $location, string $version): string + { + return self::getPathTemplate('projectLocationVersion')->render([ + 'project' => $project, + 'location' => $location, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_version resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted project_version resource. + */ + public static function projectVersionName(string $project, string $version): string + { + return self::getPathTemplate('projectVersion')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a version + * resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted version resource. + */ + public static function versionName(string $project, string $version): string + { + return self::getPathTemplate('version')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - projectAgent: projects/{project}/agent + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationVersion: projects/{project}/locations/{location}/agent/versions/{version} + * - projectVersion: projects/{project}/agent/versions/{version} + * - version: projects/{project}/agent/versions/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\VersionsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new VersionsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an agent version. + * + * The new version points to the agent instance in the "default" environment. + * + * The async variant is {@see VersionsClient::createVersionAsync()} . + * + * @example samples/V2/VersionsClient/create_version.php + * + * @param CreateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVersion(CreateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('CreateVersion', $request, $callOptions)->wait(); + } + + /** + * Delete the specified agent version. + * + * The async variant is {@see VersionsClient::deleteVersionAsync()} . + * + * @example samples/V2/VersionsClient/delete_version.php + * + * @param DeleteVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteVersion(DeleteVersionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteVersion', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent version. + * + * The async variant is {@see VersionsClient::getVersionAsync()} . + * + * @example samples/V2/VersionsClient/get_version.php + * + * @param GetVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVersion(GetVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('GetVersion', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all versions of the specified agent. + * + * The async variant is {@see VersionsClient::listVersionsAsync()} . + * + * @example samples/V2/VersionsClient/list_versions.php + * + * @param ListVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVersions(ListVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVersions', $request, $callOptions); + } + + /** + * Updates the specified agent version. + * + * Note that this method does not allow you to update the state of the agent + * the given version points to. It allows you to update only mutable + * properties of the version resource. + * + * The async variant is {@see VersionsClient::updateVersionAsync()} . + * + * @example samples/V2/VersionsClient/update_version.php + * + * @param UpdateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVersion(UpdateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('UpdateVersion', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see VersionsClient::getLocationAsync()} . + * + * @example samples/V2/VersionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see VersionsClient::listLocationsAsync()} . + * + * @example samples/V2/VersionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/CloudConversationDebuggingInfo.php b/vendor/google/cloud-dialogflow/src/V2/CloudConversationDebuggingInfo.php new file mode 100644 index 0000000..739ec5a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CloudConversationDebuggingInfo.php @@ -0,0 +1,750 @@ +google.cloud.dialogflow.v2.CloudConversationDebuggingInfo + */ +class CloudConversationDebuggingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + */ + protected $audio_data_chunks = 0; + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + */ + protected $result_end_time_offset = null; + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + */ + protected $first_audio_duration = null; + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + */ + protected $single_utterance = false; + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + */ + private $speech_partial_results_end_times; + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + */ + private $speech_final_results_end_times; + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + */ + protected $partial_responses = 0; + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + */ + protected $speaker_id_passive_latency_ms_offset = 0; + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + */ + protected $bargein_event_triggered = false; + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + */ + protected $speech_single_utterance = false; + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + */ + private $dtmf_partial_results_times; + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + */ + private $dtmf_final_results_times; + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + */ + protected $single_utterance_end_time_offset = null; + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + */ + protected $no_speech_timeout = null; + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + */ + protected $endpointing_timeout = null; + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + */ + protected $is_input_text = false; + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + */ + protected $client_half_close_time_offset = null; + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + */ + protected $client_half_close_streaming_time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_data_chunks + * Number of input audio data chunks in streaming requests. + * @type \Google\Protobuf\Duration $result_end_time_offset + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * @type \Google\Protobuf\Duration $first_audio_duration + * Duration of first audio chunk. + * @type bool $single_utterance + * Whether client used single utterance mode. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $speech_partial_results_end_times + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $speech_final_results_end_times + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * @type int $partial_responses + * Total number of partial responses. + * @type int $speaker_id_passive_latency_ms_offset + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * @type bool $bargein_event_triggered + * Whether a barge-in event is triggered in this request. + * @type bool $speech_single_utterance + * Whether speech uses single utterance mode. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $dtmf_partial_results_times + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $dtmf_final_results_times + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * @type \Google\Protobuf\Duration $single_utterance_end_time_offset + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * @type \Google\Protobuf\Duration $no_speech_timeout + * No speech timeout settings for the stream. + * @type \Google\Protobuf\Duration $endpointing_timeout + * Speech endpointing timeout settings for the stream. + * @type bool $is_input_text + * Whether the streaming terminates with an injected text query. + * @type \Google\Protobuf\Duration $client_half_close_time_offset + * Client half close time in terms of input audio duration. + * @type \Google\Protobuf\Duration $client_half_close_streaming_time_offset + * Client half close time in terms of API streaming duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @return int + */ + public function getAudioDataChunks() + { + return $this->audio_data_chunks; + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @param int $var + * @return $this + */ + public function setAudioDataChunks($var) + { + GPBUtil::checkInt32($var); + $this->audio_data_chunks = $var; + + return $this; + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getResultEndTimeOffset() + { + return $this->result_end_time_offset; + } + + public function hasResultEndTimeOffset() + { + return isset($this->result_end_time_offset); + } + + public function clearResultEndTimeOffset() + { + unset($this->result_end_time_offset); + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setResultEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->result_end_time_offset = $var; + + return $this; + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getFirstAudioDuration() + { + return $this->first_audio_duration; + } + + public function hasFirstAudioDuration() + { + return isset($this->first_audio_duration); + } + + public function clearFirstAudioDuration() + { + unset($this->first_audio_duration); + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFirstAudioDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->first_audio_duration = $var; + + return $this; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechPartialResultsEndTimes() + { + return $this->speech_partial_results_end_times; + } + + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechPartialResultsEndTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->speech_partial_results_end_times = $arr; + + return $this; + } + + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechFinalResultsEndTimes() + { + return $this->speech_final_results_end_times; + } + + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechFinalResultsEndTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->speech_final_results_end_times = $arr; + + return $this; + } + + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + * @return int + */ + public function getPartialResponses() + { + return $this->partial_responses; + } + + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + * @param int $var + * @return $this + */ + public function setPartialResponses($var) + { + GPBUtil::checkInt32($var); + $this->partial_responses = $var; + + return $this; + } + + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + * @return int + */ + public function getSpeakerIdPassiveLatencyMsOffset() + { + return $this->speaker_id_passive_latency_ms_offset; + } + + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + * @param int $var + * @return $this + */ + public function setSpeakerIdPassiveLatencyMsOffset($var) + { + GPBUtil::checkInt32($var); + $this->speaker_id_passive_latency_ms_offset = $var; + + return $this; + } + + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + * @return bool + */ + public function getBargeinEventTriggered() + { + return $this->bargein_event_triggered; + } + + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + * @param bool $var + * @return $this + */ + public function setBargeinEventTriggered($var) + { + GPBUtil::checkBool($var); + $this->bargein_event_triggered = $var; + + return $this; + } + + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + * @return bool + */ + public function getSpeechSingleUtterance() + { + return $this->speech_single_utterance; + } + + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + * @param bool $var + * @return $this + */ + public function setSpeechSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->speech_single_utterance = $var; + + return $this; + } + + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDtmfPartialResultsTimes() + { + return $this->dtmf_partial_results_times; + } + + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDtmfPartialResultsTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->dtmf_partial_results_times = $arr; + + return $this; + } + + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDtmfFinalResultsTimes() + { + return $this->dtmf_final_results_times; + } + + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDtmfFinalResultsTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->dtmf_final_results_times = $arr; + + return $this; + } + + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + * @return \Google\Protobuf\Duration|null + */ + public function getSingleUtteranceEndTimeOffset() + { + return $this->single_utterance_end_time_offset; + } + + public function hasSingleUtteranceEndTimeOffset() + { + return isset($this->single_utterance_end_time_offset); + } + + public function clearSingleUtteranceEndTimeOffset() + { + unset($this->single_utterance_end_time_offset); + } + + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSingleUtteranceEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->single_utterance_end_time_offset = $var; + + return $this; + } + + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @return \Google\Protobuf\Duration|null + */ + public function getNoSpeechTimeout() + { + return $this->no_speech_timeout; + } + + public function hasNoSpeechTimeout() + { + return isset($this->no_speech_timeout); + } + + public function clearNoSpeechTimeout() + { + unset($this->no_speech_timeout); + } + + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setNoSpeechTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->no_speech_timeout = $var; + + return $this; + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @return \Google\Protobuf\Duration|null + */ + public function getEndpointingTimeout() + { + return $this->endpointing_timeout; + } + + public function hasEndpointingTimeout() + { + return isset($this->endpointing_timeout); + } + + public function clearEndpointingTimeout() + { + unset($this->endpointing_timeout); + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndpointingTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->endpointing_timeout = $var; + + return $this; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @return bool + */ + public function getIsInputText() + { + return $this->is_input_text; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @param bool $var + * @return $this + */ + public function setIsInputText($var) + { + GPBUtil::checkBool($var); + $this->is_input_text = $var; + + return $this; + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseTimeOffset() + { + return $this->client_half_close_time_offset; + } + + public function hasClientHalfCloseTimeOffset() + { + return isset($this->client_half_close_time_offset); + } + + public function clearClientHalfCloseTimeOffset() + { + unset($this->client_half_close_time_offset); + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_time_offset = $var; + + return $this; + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseStreamingTimeOffset() + { + return $this->client_half_close_streaming_time_offset; + } + + public function hasClientHalfCloseStreamingTimeOffset() + { + return isset($this->client_half_close_streaming_time_offset); + } + + public function clearClientHalfCloseStreamingTimeOffset() + { + unset($this->client_half_close_streaming_time_offset); + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseStreamingTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_streaming_time_offset = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CompleteConversationRequest.php b/vendor/google/cloud-dialogflow/src/V2/CompleteConversationRequest.php new file mode 100644 index 0000000..32ef27e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CompleteConversationRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.CompleteConversationRequest + */ +class CompleteConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\CompleteConversationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Context.php b/vendor/google/cloud-dialogflow/src/V2/Context.php new file mode 100644 index 0000000..917ef8d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Context.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.Context + */ +class Context extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $lifespan_count = 0; + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * @type int $lifespan_count + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * @type \Google\Protobuf\Struct $parameters + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLifespanCount() + { + return $this->lifespan_count; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLifespanCount($var) + { + GPBUtil::checkInt32($var); + $this->lifespan_count = $var; + + return $this; + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation.php b/vendor/google/cloud-dialogflow/src/V2/Conversation.php new file mode 100644 index 0000000..20037a3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation.php @@ -0,0 +1,458 @@ +google.cloud.dialogflow.v2.Conversation + */ +class Conversation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $lifecycle_state = 0; + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_number = null; + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_stage = 0; + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $telephony_connection_info = null; + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ingested_context_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * @type int $lifecycle_state + * Output only. The current state of the Conversation. + * @type string $conversation_profile + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * @type \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $phone_number + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the conversation was started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the conversation was finished. + * @type int $conversation_stage + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * @type \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo $telephony_connection_info + * Output only. The telephony connection information. + * @type array|\Google\Protobuf\Internal\MapField $ingested_context_references + * Output only. The context reference updates provided by external systems. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLifecycleState() + { + return $this->lifecycle_state; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLifecycleState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\LifecycleState::class); + $this->lifecycle_state = $var; + + return $this; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + public function hasPhoneNumber() + { + return isset($this->phone_number); + } + + public function clearPhoneNumber() + { + unset($this->phone_number); + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber::class); + $this->phone_number = $var; + + return $this; + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConversationStage() + { + return $this->conversation_stage; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConversationStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ConversationStage::class); + $this->conversation_stage = $var; + + return $this; + } + + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo|null + */ + public function getTelephonyConnectionInfo() + { + return $this->telephony_connection_info; + } + + public function hasTelephonyConnectionInfo() + { + return isset($this->telephony_connection_info); + } + + public function clearTelephonyConnectionInfo() + { + unset($this->telephony_connection_info); + } + + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo $var + * @return $this + */ + public function setTelephonyConnectionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo::class); + $this->telephony_connection_info = $var; + + return $this; + } + + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getIngestedContextReferences() + { + return $this->ingested_context_references; + } + + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setIngestedContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->ingested_context_references = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference.php new file mode 100644 index 0000000..5645e29 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference.php @@ -0,0 +1,184 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference + */ +class ContextReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $context_contents; + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mode = 0; + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent>|\Google\Protobuf\Internal\RepeatedField $context_contents + * Required. The list of content updates for a context reference. + * @type int $update_mode + * Required. The mode in which context reference contents are updated. + * @type string $language_code + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the context reference was first created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContextContents() + { + return $this->context_contents; + } + + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContextContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent::class); + $this->context_contents = $arr; + + return $this; + } + + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getUpdateMode() + { + return $this->update_mode; + } + + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setUpdateMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\UpdateMode::class); + $this->update_mode = $var; + + return $this; + } + + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent.php new file mode 100644 index 0000000..fbe6459 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent + */ +class ContextContent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content = ''; + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content_format = 0; + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ingestion_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Required. The information ingested in a single request. + * @type int $content_format + * Required. The format of the ingested string. + * @type \Google\Protobuf\Timestamp $ingestion_time + * Output only. The time when this information was incorporated into the + * relevant context reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getContentFormat() + { + return $this->content_format; + } + + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setContentFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent\ContentFormat::class); + $this->content_format = $var; + + return $this; + } + + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getIngestionTime() + { + return $this->ingestion_time; + } + + public function hasIngestionTime() + { + return isset($this->ingestion_time); + } + + public function clearIngestionTime() + { + unset($this->ingestion_time); + } + + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setIngestionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->ingestion_time = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent/ContentFormat.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent/ContentFormat.php new file mode 100644 index 0000000..be198a4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/ContextContent/ContentFormat.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat + */ +class ContentFormat +{ + /** + * Unspecified content format. + * + * Generated from protobuf enum CONTENT_FORMAT_UNSPECIFIED = 0; + */ + const CONTENT_FORMAT_UNSPECIFIED = 0; + /** + * Content was provided in JSON format. + * + * Generated from protobuf enum JSON = 1; + */ + const JSON = 1; + /** + * Content was provided as plain text. + * + * Generated from protobuf enum PLAIN_TEXT = 2; + */ + const PLAIN_TEXT = 2; + + private static $valueToName = [ + self::CONTENT_FORMAT_UNSPECIFIED => 'CONTENT_FORMAT_UNSPECIFIED', + self::JSON => 'JSON', + self::PLAIN_TEXT => 'PLAIN_TEXT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/UpdateMode.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/UpdateMode.php new file mode 100644 index 0000000..42f5c6a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/ContextReference/UpdateMode.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode + */ +class UpdateMode +{ + /** + * Unspecified update mode. + * + * Generated from protobuf enum UPDATE_MODE_UNSPECIFIED = 0; + */ + const UPDATE_MODE_UNSPECIFIED = 0; + /** + * Context content updates are applied in append mode. + * + * Generated from protobuf enum APPEND = 1; + */ + const APPEND = 1; + /** + * Context content updates are applied in overwrite mode. + * + * Generated from protobuf enum OVERWRITE = 2; + */ + const OVERWRITE = 2; + + private static $valueToName = [ + self::UPDATE_MODE_UNSPECIFIED => 'UPDATE_MODE_UNSPECIFIED', + self::APPEND => 'APPEND', + self::OVERWRITE => 'OVERWRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/ConversationStage.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/ConversationStage.php new file mode 100644 index 0000000..6c331a6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/ConversationStage.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Conversation.ConversationStage + */ +class ConversationStage +{ + /** + * Unknown. Should never be used after a conversation is successfully + * created. + * + * Generated from protobuf enum CONVERSATION_STAGE_UNSPECIFIED = 0; + */ + const CONVERSATION_STAGE_UNSPECIFIED = 0; + /** + * The conversation should return virtual agent responses into the + * conversation. + * + * Generated from protobuf enum VIRTUAL_AGENT_STAGE = 1; + */ + const VIRTUAL_AGENT_STAGE = 1; + /** + * The conversation should not provide responses, just listen and provide + * suggestions. + * + * Generated from protobuf enum HUMAN_ASSIST_STAGE = 2; + */ + const HUMAN_ASSIST_STAGE = 2; + + private static $valueToName = [ + self::CONVERSATION_STAGE_UNSPECIFIED => 'CONVERSATION_STAGE_UNSPECIFIED', + self::VIRTUAL_AGENT_STAGE => 'VIRTUAL_AGENT_STAGE', + self::HUMAN_ASSIST_STAGE => 'HUMAN_ASSIST_STAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/LifecycleState.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/LifecycleState.php new file mode 100644 index 0000000..88463ec --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/LifecycleState.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Conversation.LifecycleState + */ +class LifecycleState +{ + /** + * Unknown. + * + * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + const LIFECYCLE_STATE_UNSPECIFIED = 0; + /** + * Conversation is currently open for media analysis. + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Conversation has been completed. + * + * Generated from protobuf enum COMPLETED = 2; + */ + const COMPLETED = 2; + + private static $valueToName = [ + self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::COMPLETED => 'COMPLETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo.php new file mode 100644 index 0000000..e0371ec --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo.php @@ -0,0 +1,175 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo + */ +class TelephonyConnectionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dialed_number = ''; + /** + * Optional. SDP of the call. It's initially the SDP answer to the endpoint, + * but maybe later updated for the purpose of making the link active, etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sdp = ''; + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $sip_headers; + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $extra_mime_contents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dialed_number + * Output only. The number dialed to connect this call in E.164 format. + * @type string $sdp + * Optional. SDP of the call. It's initially the SDP answer to the endpoint, + * but maybe later updated for the purpose of making the link active, etc. + * @type array<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader>|\Google\Protobuf\Internal\RepeatedField $sip_headers + * Output only. The SIP headers from the initial SIP INVITE. + * @type array<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent>|\Google\Protobuf\Internal\RepeatedField $extra_mime_contents + * Output only. The mime content from the initial SIP INVITE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDialedNumber() + { + return $this->dialed_number; + } + + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDialedNumber($var) + { + GPBUtil::checkString($var, True); + $this->dialed_number = $var; + + return $this; + } + + /** + * Optional. SDP of the call. It's initially the SDP answer to the endpoint, + * but maybe later updated for the purpose of making the link active, etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSdp() + { + return $this->sdp; + } + + /** + * Optional. SDP of the call. It's initially the SDP answer to the endpoint, + * but maybe later updated for the purpose of making the link active, etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSdp($var) + { + GPBUtil::checkString($var, True); + $this->sdp = $var; + + return $this; + } + + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSipHeaders() + { + return $this->sip_headers; + } + + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSipHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader::class); + $this->sip_headers = $arr; + + return $this; + } + + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtraMimeContents() + { + return $this->extra_mime_contents; + } + + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtraMimeContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent::class); + $this->extra_mime_contents = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/MimeContent.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/MimeContent.php new file mode 100644 index 0000000..cd8ed0b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/MimeContent.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent + */ +class MimeContent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mime_type = ''; + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mime_type + * Optional. The mime type of the content. + * @type string $content + * Optional. The content payload. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->content = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/SipHeader.php b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/SipHeader.php new file mode 100644 index 0000000..0f3b7c5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Conversation/TelephonyConnectionInfo/SipHeader.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader + */ +class SipHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the header. + * @type string $value + * Optional. The value of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationContext.php b/vendor/google/cloud-dialogflow/src/V2/ConversationContext.php new file mode 100644 index 0000000..30ebd37 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ConversationContext + */ +class ConversationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $message_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $message_entries + * Optional. List of message transcripts in the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessageEntries() + { + return $this->message_entries; + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessageEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\MessageEntry::class); + $this->message_entries = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationDataset.php b/vendor/google/cloud-dialogflow/src/V2/ConversationDataset.php new file mode 100644 index 0000000..f0bcdc3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationDataset.php @@ -0,0 +1,412 @@ +google.cloud.dialogflow.v2.ConversationDataset + */ +class ConversationDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $input_config = null; + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_info = null; + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_count = 0; + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @type string $display_name + * Required. The display name of the dataset. Maximum of 64 bytes. + * @type string $description + * Optional. The description of the dataset. Maximum of 10000 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this dataset. + * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config + * Output only. Input configurations set during conversation data import. + * @type \Google\Cloud\Dialogflow\V2\ConversationInfo $conversation_info + * Output only. Metadata set during conversation data import. + * @type int|string $conversation_count + * Output only. The number of conversations this conversation dataset + * contains. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationInfo|null + */ + public function getConversationInfo() + { + return $this->conversation_info; + } + + public function hasConversationInfo() + { + return isset($this->conversation_info); + } + + public function clearConversationInfo() + { + unset($this->conversation_info); + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationInfo $var + * @return $this + */ + public function setConversationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationInfo::class); + $this->conversation_info = $var; + + return $this; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getConversationCount() + { + return $this->conversation_count; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt64($var); + $this->conversation_count = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationEvent.php b/vendor/google/cloud-dialogflow/src/V2/ConversationEvent.php new file mode 100644 index 0000000..d7c8e8a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationEvent.php @@ -0,0 +1,233 @@ +google.cloud.dialogflow.v2.ConversationEvent + */ +class ConversationEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + */ + protected $conversation = ''; + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + */ + protected $type = 0; + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + */ + protected $error_status = null; + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * @type int $type + * The type of the event that this notification refers to. + * @type \Google\Rpc\Status $error_status + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * @type \Google\Cloud\Dialogflow\V2\Message $new_message_payload + * Payload of NEW_MESSAGE event. + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $new_recognition_result_payload + * Payload of NEW_RECOGNITION_RESULT event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationEvent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationEvent\Type::class); + $this->type = $var; + + return $this; + } + + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + * @return \Google\Rpc\Status|null + */ + public function getErrorStatus() + { + return $this->error_status; + } + + public function hasErrorStatus() + { + return isset($this->error_status); + } + + public function clearErrorStatus() + { + unset($this->error_status); + } + + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setErrorStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error_status = $var; + + return $this; + } + + /** + * Payload of NEW_MESSAGE event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message new_message_payload = 4; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getNewMessagePayload() + { + return $this->readOneof(4); + } + + public function hasNewMessagePayload() + { + return $this->hasOneof(4); + } + + /** + * Payload of NEW_MESSAGE event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message new_message_payload = 4; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setNewMessagePayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Payload of NEW_RECOGNITION_RESULT event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult new_recognition_result_payload = 5; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getNewRecognitionResultPayload() + { + return $this->readOneof(5); + } + + public function hasNewRecognitionResultPayload() + { + return $this->hasOneof(5); + } + + /** + * Payload of NEW_RECOGNITION_RESULT event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult new_recognition_result_payload = 5; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setNewRecognitionResultPayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationEvent/Type.php b/vendor/google/cloud-dialogflow/src/V2/ConversationEvent/Type.php new file mode 100644 index 0000000..cfb9f48 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationEvent/Type.php @@ -0,0 +1,104 @@ +google.cloud.dialogflow.v2.ConversationEvent.Type + */ +class Type +{ + /** + * Type not set. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A new conversation has been opened. This is fired when a telephone call + * is answered, or a conversation is created via the API. + * + * Generated from protobuf enum CONVERSATION_STARTED = 1; + */ + const CONVERSATION_STARTED = 1; + /** + * An existing conversation has closed. This is fired when a telephone call + * is terminated, or a conversation is closed via the API. + * + * Generated from protobuf enum CONVERSATION_FINISHED = 2; + */ + const CONVERSATION_FINISHED = 2; + /** + * An existing conversation has received notification from Dialogflow that + * human intervention is required. + * + * Generated from protobuf enum HUMAN_INTERVENTION_NEEDED = 3; + */ + const HUMAN_INTERVENTION_NEEDED = 3; + /** + * An existing conversation has received a new message, either from API or + * telephony. It is configured in + * [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config] + * + * Generated from protobuf enum NEW_MESSAGE = 5; + */ + const NEW_MESSAGE = 5; + /** + * An existing conversation has received a new speech recognition result. + * This is mainly for delivering intermediate transcripts. The notification + * is configured in + * [ConversationProfile.new_recognition_event_notification_config][]. + * + * Generated from protobuf enum NEW_RECOGNITION_RESULT = 7; + */ + const NEW_RECOGNITION_RESULT = 7; + /** + * Unrecoverable error during a telephone call. + * In general non-recoverable errors only occur if something was + * misconfigured in the ConversationProfile corresponding to the call. After + * a non-recoverable error, Dialogflow may stop responding. + * We don't fire this event: + * * in an API call because we can directly return the error, or, + * * when we can recover from an error. + * + * Generated from protobuf enum UNRECOVERABLE_ERROR = 4; + */ + const UNRECOVERABLE_ERROR = 4; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::CONVERSATION_STARTED => 'CONVERSATION_STARTED', + self::CONVERSATION_FINISHED => 'CONVERSATION_FINISHED', + self::HUMAN_INTERVENTION_NEEDED => 'HUMAN_INTERVENTION_NEEDED', + self::NEW_MESSAGE => 'NEW_MESSAGE', + self::NEW_RECOGNITION_RESULT => 'NEW_RECOGNITION_RESULT', + self::UNRECOVERABLE_ERROR => 'UNRECOVERABLE_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationInfo.php b/vendor/google/cloud-dialogflow/src/V2/ConversationInfo.php new file mode 100644 index 0000000..b4466ff --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationInfo.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.ConversationInfo + */ +class ConversationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationModel.php b/vendor/google/cloud-dialogflow/src/V2/ConversationModel.php new file mode 100644 index 0000000..fa2896f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationModel.php @@ -0,0 +1,442 @@ +google.cloud.dialogflow.v2.ConversationModel + */ +class ConversationModel extends \Google\Protobuf\Internal\Message +{ + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $datasets; + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + */ + protected $language_code = ''; + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + protected $model_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * @type string $display_name + * Required. The display name of the model. At most 64 bytes long. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this model. + * @type array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $datasets + * Required. Datasets used to create model. + * @type int $state + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * @type string $language_code + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $article_suggestion_model_metadata + * Metadata for article suggestion models. + * @type \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $smart_reply_model_metadata + * Metadata for smart reply models. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\InputDataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\State::class); + $this->state = $var; + + return $this; + } + + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Metadata for article suggestion models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8; + * @return \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata|null + */ + public function getArticleSuggestionModelMetadata() + { + return $this->readOneof(8); + } + + public function hasArticleSuggestionModelMetadata() + { + return $this->hasOneof(8); + } + + /** + * Metadata for article suggestion models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8; + * @param \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $var + * @return $this + */ + public function setArticleSuggestionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Metadata for smart reply models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9; + * @return \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata|null + */ + public function getSmartReplyModelMetadata() + { + return $this->readOneof(9); + } + + public function hasSmartReplyModelMetadata() + { + return $this->hasOneof(9); + } + + /** + * Metadata for smart reply models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $var + * @return $this + */ + public function setSmartReplyModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * @return string + */ + public function getModelMetadata() + { + return $this->whichOneof("model_metadata"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationModel/ModelType.php b/vendor/google/cloud-dialogflow/src/V2/ConversationModel/ModelType.php new file mode 100644 index 0000000..94886d3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationModel/ModelType.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.ConversationModel.ModelType + */ +class ModelType +{ + /** + * ModelType unspecified. + * + * Generated from protobuf enum MODEL_TYPE_UNSPECIFIED = 0; + */ + const MODEL_TYPE_UNSPECIFIED = 0; + /** + * ModelType smart reply dual encoder model. + * + * Generated from protobuf enum SMART_REPLY_DUAL_ENCODER_MODEL = 2; + */ + const SMART_REPLY_DUAL_ENCODER_MODEL = 2; + /** + * ModelType smart reply bert model. + * + * Generated from protobuf enum SMART_REPLY_BERT_MODEL = 6; + */ + const SMART_REPLY_BERT_MODEL = 6; + + private static $valueToName = [ + self::MODEL_TYPE_UNSPECIFIED => 'MODEL_TYPE_UNSPECIFIED', + self::SMART_REPLY_DUAL_ENCODER_MODEL => 'SMART_REPLY_DUAL_ENCODER_MODEL', + self::SMART_REPLY_BERT_MODEL => 'SMART_REPLY_BERT_MODEL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationModel/State.php b/vendor/google/cloud-dialogflow/src/V2/ConversationModel/State.php new file mode 100644 index 0000000..c1e82c3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationModel/State.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ConversationModel.State + */ +class State +{ + /** + * Should not be used, an un-set enum has this value by default. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Model being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Model is not deployed but ready to deploy. + * + * Generated from protobuf enum UNDEPLOYED = 2; + */ + const UNDEPLOYED = 2; + /** + * Model is deploying. + * + * Generated from protobuf enum DEPLOYING = 3; + */ + const DEPLOYING = 3; + /** + * Model is deployed and ready to use. + * + * Generated from protobuf enum DEPLOYED = 4; + */ + const DEPLOYED = 4; + /** + * Model is undeploying. + * + * Generated from protobuf enum UNDEPLOYING = 5; + */ + const UNDEPLOYING = 5; + /** + * Model is deleting. + * + * Generated from protobuf enum DELETING = 6; + */ + const DELETING = 6; + /** + * Model is in error state. Not ready to deploy and use. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + /** + * Model is being created but the training has not started, + * The model may remain in this state until there is enough capacity to + * start training. + * + * Generated from protobuf enum PENDING = 8; + */ + const PENDING = 8; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::UNDEPLOYED => 'UNDEPLOYED', + self::DEPLOYING => 'DEPLOYING', + self::DEPLOYED => 'DEPLOYED', + self::UNDEPLOYING => 'UNDEPLOYING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationModelEvaluation.php b/vendor/google/cloud-dialogflow/src/V2/ConversationModelEvaluation.php new file mode 100644 index 0000000..7d0913e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationModelEvaluation.php @@ -0,0 +1,329 @@ +google.cloud.dialogflow.v2.ConversationModelEvaluation + */ +class ConversationModelEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_config = null; + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $raw_human_eval_template_csv = ''; + protected $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * @type string $display_name + * Optional. The display name of the model evaluation. At most 64 bytes long. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig $evaluation_config + * Optional. The configuration of the evaluation task. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this model. + * @type \Google\Cloud\Dialogflow\V2\SmartReplyMetrics $smart_reply_metrics + * Output only. Only available when model is for smart reply. + * @type string $raw_human_eval_template_csv + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig|null + */ + public function getEvaluationConfig() + { + return $this->evaluation_config; + } + + public function hasEvaluationConfig() + { + return isset($this->evaluation_config); + } + + public function clearEvaluationConfig() + { + unset($this->evaluation_config); + } + + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig $var + * @return $this + */ + public function setEvaluationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig::class); + $this->evaluation_config = $var; + + return $this; + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Only available when model is for smart reply. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyMetrics smart_reply_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\SmartReplyMetrics|null + */ + public function getSmartReplyMetrics() + { + return $this->readOneof(5); + } + + public function hasSmartReplyMetrics() + { + return $this->hasOneof(5); + } + + /** + * Output only. Only available when model is for smart reply. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyMetrics smart_reply_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyMetrics $var + * @return $this + */ + public function setSmartReplyMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRawHumanEvalTemplateCsv() + { + return $this->raw_human_eval_template_csv; + } + + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRawHumanEvalTemplateCsv($var) + { + GPBUtil::checkString($var, True); + $this->raw_human_eval_template_csv = $var; + + return $this; + } + + /** + * @return string + */ + public function getMetrics() + { + return $this->whichOneof("metrics"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationPhoneNumber.php b/vendor/google/cloud-dialogflow/src/V2/ConversationPhoneNumber.php new file mode 100644 index 0000000..b76111c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationPhoneNumber.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.ConversationPhoneNumber + */ +class ConversationPhoneNumber extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $country_code = 0; + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_number = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $country_code + * Output only. Desired country code for the phone number. + * @type string $phone_number + * Output only. The phone number to connect to this conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCountryCode() + { + return $this->country_code; + } + + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCountryCode($var) + { + GPBUtil::checkInt32($var); + $this->country_code = $var; + + return $this; + } + + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->phone_number = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ConversationProfile.php b/vendor/google/cloud-dialogflow/src/V2/ConversationProfile.php new file mode 100644 index 0000000..be421f0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ConversationProfile.php @@ -0,0 +1,779 @@ +google.cloud.dialogflow.v2.ConversationProfile + */ +class ConversationProfile extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + */ + protected $automated_agent_config = null; + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + */ + protected $human_agent_assistant_config = null; + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + */ + protected $human_agent_handoff_config = null; + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + */ + protected $notification_config = null; + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + */ + protected $logging_config = null; + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + */ + protected $new_message_event_notification_config = null; + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $new_recognition_result_notification_config = null; + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + */ + protected $stt_config = null; + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + */ + protected $language_code = ''; + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + */ + protected $time_zone = ''; + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + */ + protected $security_settings = ''; + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + */ + protected $tts_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @type string $display_name + * Required. Human readable name for this profile. Max length 1024 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the conversation profile. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of the conversation profile. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig $automated_agent_config + * Configuration for an automated agent to use with this profile. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig $human_agent_assistant_config + * Configuration for agent assistance to use with this profile. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig $human_agent_handoff_config + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $notification_config + * Configuration for publishing conversation lifecycle events. + * @type \Google\Cloud\Dialogflow\V2\LoggingConfig $logging_config + * Configuration for logging conversation lifecycle events. + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $new_message_event_notification_config + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $new_recognition_result_notification_config + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * @type \Google\Cloud\Dialogflow\V2\SpeechToTextConfig $stt_config + * Settings for speech transcription. + * @type string $language_code + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type string $time_zone + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * @type string $security_settings + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * @type \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $tts_config + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig|null + */ + public function getAutomatedAgentConfig() + { + return $this->automated_agent_config; + } + + public function hasAutomatedAgentConfig() + { + return isset($this->automated_agent_config); + } + + public function clearAutomatedAgentConfig() + { + unset($this->automated_agent_config); + } + + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig $var + * @return $this + */ + public function setAutomatedAgentConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig::class); + $this->automated_agent_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig|null + */ + public function getHumanAgentAssistantConfig() + { + return $this->human_agent_assistant_config; + } + + public function hasHumanAgentAssistantConfig() + { + return isset($this->human_agent_assistant_config); + } + + public function clearHumanAgentAssistantConfig() + { + unset($this->human_agent_assistant_config); + } + + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig $var + * @return $this + */ + public function setHumanAgentAssistantConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig::class); + $this->human_agent_assistant_config = $var; + + return $this; + } + + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig|null + */ + public function getHumanAgentHandoffConfig() + { + return $this->human_agent_handoff_config; + } + + public function hasHumanAgentHandoffConfig() + { + return isset($this->human_agent_handoff_config); + } + + public function clearHumanAgentHandoffConfig() + { + unset($this->human_agent_handoff_config); + } + + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig $var + * @return $this + */ + public function setHumanAgentHandoffConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig::class); + $this->human_agent_handoff_config = $var; + + return $this; + } + + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNotificationConfig() + { + return $this->notification_config; + } + + public function hasNotificationConfig() + { + return isset($this->notification_config); + } + + public function clearNotificationConfig() + { + unset($this->notification_config); + } + + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->notification_config = $var; + + return $this; + } + + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + * @return \Google\Cloud\Dialogflow\V2\LoggingConfig|null + */ + public function getLoggingConfig() + { + return $this->logging_config; + } + + public function hasLoggingConfig() + { + return isset($this->logging_config); + } + + public function clearLoggingConfig() + { + unset($this->logging_config); + } + + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + * @param \Google\Cloud\Dialogflow\V2\LoggingConfig $var + * @return $this + */ + public function setLoggingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\LoggingConfig::class); + $this->logging_config = $var; + + return $this; + } + + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNewMessageEventNotificationConfig() + { + return $this->new_message_event_notification_config; + } + + public function hasNewMessageEventNotificationConfig() + { + return isset($this->new_message_event_notification_config); + } + + public function clearNewMessageEventNotificationConfig() + { + unset($this->new_message_event_notification_config); + } + + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNewMessageEventNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->new_message_event_notification_config = $var; + + return $this; + } + + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNewRecognitionResultNotificationConfig() + { + return $this->new_recognition_result_notification_config; + } + + public function hasNewRecognitionResultNotificationConfig() + { + return isset($this->new_recognition_result_notification_config); + } + + public function clearNewRecognitionResultNotificationConfig() + { + unset($this->new_recognition_result_notification_config); + } + + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNewRecognitionResultNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->new_recognition_result_notification_config = $var; + + return $this; + } + + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + * @return \Google\Cloud\Dialogflow\V2\SpeechToTextConfig|null + */ + public function getSttConfig() + { + return $this->stt_config; + } + + public function hasSttConfig() + { + return isset($this->stt_config); + } + + public function clearSttConfig() + { + unset($this->stt_config); + } + + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + * @param \Google\Cloud\Dialogflow\V2\SpeechToTextConfig $var + * @return $this + */ + public function setSttConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SpeechToTextConfig::class); + $this->stt_config = $var; + + return $this; + } + + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + * @return string + */ + public function getSecuritySettings() + { + return $this->security_settings; + } + + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecuritySettings($var) + { + GPBUtil::checkString($var, True); + $this->security_settings = $var; + + return $this; + } + + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + * @return \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig|null + */ + public function getTtsConfig() + { + return $this->tts_config; + } + + public function hasTtsConfig() + { + return isset($this->tts_config); + } + + public function clearTtsConfig() + { + unset($this->tts_config); + } + + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + * @param \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $var + * @return $this + */ + public function setTtsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->tts_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateContextRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateContextRequest.php new file mode 100644 index 0000000..a68b43e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateContextRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.CreateContextRequest + */ +class CreateContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $context = null; + + /** + * @param string $parent Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Context $context Required. The context to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateContextRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Context $context): self + { + return (new self()) + ->setParent($parent) + ->setContext($context); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type \Google\Cloud\Dialogflow\V2\Context $context + * Required. The context to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Context|null + */ + public function getContext() + { + return $this->context; + } + + public function hasContext() + { + return isset($this->context); + } + + public function clearContext() + { + unset($this->context); + } + + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Context $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Context::class); + $this->context = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetOperationMetadata.php new file mode 100644 index 0000000..527064d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetOperationMetadata.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata + */ +class CreateConversationDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetRequest.php new file mode 100644 index 0000000..ebccff2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationDatasetRequest.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.CreateConversationDatasetRequest + */ +class CreateConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_dataset = null; + + /** + * @param string $parent Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * @param \Google\Cloud\Dialogflow\V2\ConversationDataset $conversationDataset Required. The conversation dataset to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationDatasetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationDataset $conversationDataset): self + { + return (new self()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\ConversationDataset $conversation_dataset + * Required. The conversation dataset to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationDataset|null + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + public function hasConversationDataset() + { + return isset($this->conversation_dataset); + } + + public function clearConversationDataset() + { + unset($this->conversation_dataset); + } + + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationDataset $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationDataset::class); + $this->conversation_dataset = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata.php new file mode 100644 index 0000000..1de9349 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata.php @@ -0,0 +1,201 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata + */ +class CreateConversationModelEvaluationOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + */ + protected $conversation_model_evaluation = ''; + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + */ + protected $conversation_model = ''; + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + */ + protected $state = 0; + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model_evaluation + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * @type int $state + * State of CreateConversationModel operation. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + * @return string + */ + public function getConversationModelEvaluation() + { + return $this->conversation_model_evaluation; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + * @param string $var + * @return $this + */ + public function setConversationModelEvaluation($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model_evaluation = $var; + + return $this; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata/State.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata/State.php new file mode 100644 index 0000000..d817672 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationOperationMetadata/State.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State + */ +class State +{ + /** + * Operation status not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The operation is being prepared. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * The operation is running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The operation is cancelled. + * + * Generated from protobuf enum CANCELLED = 3; + */ + const CANCELLED = 3; + /** + * The operation has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * The operation has failed. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::INITIALIZING => 'INITIALIZING', + self::RUNNING => 'RUNNING', + self::CANCELLED => 'CANCELLED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationRequest.php new file mode 100644 index 0000000..f1363b6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelEvaluationRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest + */ +class CreateConversationModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_model_evaluation = null; + + /** + * @param string $parent Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * Please see {@see ConversationModelsClient::conversationModelName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversationModelEvaluation Required. The conversation model evaluation to be created. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversationModelEvaluation): self + { + return (new self()) + ->setParent($parent) + ->setConversationModelEvaluation($conversationModelEvaluation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * @type \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversation_model_evaluation + * Required. The conversation model evaluation to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation|null + */ + public function getConversationModelEvaluation() + { + return $this->conversation_model_evaluation; + } + + public function hasConversationModelEvaluation() + { + return isset($this->conversation_model_evaluation); + } + + public function clearConversationModelEvaluation() + { + unset($this->conversation_model_evaluation); + } + + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $var + * @return $this + */ + public function setConversationModelEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation::class); + $this->conversation_model_evaluation = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata.php new file mode 100644 index 0000000..3ec1f69 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata.php @@ -0,0 +1,155 @@ +google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata + */ +class CreateConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + */ + protected $state = 0; + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type int $state + * State of CreateConversationModel operation. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata/State.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata/State.php new file mode 100644 index 0000000..24ce721 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelOperationMetadata/State.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State + */ +class State +{ + /** + * Invalid. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Request is submitted, but training has not started yet. + * The model may remain in this state until there is enough capacity to + * start training. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The training has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The training has succeeded. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The training has been cancelled. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + /** + * The training is in cancelling state. + * + * Generated from protobuf enum CANCELLING = 5; + */ + const CANCELLING = 5; + /** + * Custom model is training. + * + * Generated from protobuf enum TRAINING = 6; + */ + const TRAINING = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + self::CANCELLING => 'CANCELLING', + self::TRAINING => 'TRAINING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelRequest.php new file mode 100644 index 0000000..bca3576 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationModelRequest.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.CreateConversationModelRequest + */ +class CreateConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_model = null; + + /** + * @param string $parent The project to create conversation model for. Format: + * `projects/` + * @param \Google\Cloud\Dialogflow\V2\ConversationModel $conversationModel Required. The conversation model to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationModelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationModel $conversationModel): self + { + return (new self()) + ->setParent($parent) + ->setConversationModel($conversationModel); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The project to create conversation model for. Format: + * `projects/` + * @type \Google\Cloud\Dialogflow\V2\ConversationModel $conversation_model + * Required. The conversation model to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationModel|null + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + public function hasConversationModel() + { + return isset($this->conversation_model); + } + + public function clearConversationModel() + { + unset($this->conversation_model); + } + + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationModel $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationModel::class); + $this->conversation_model = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationProfileRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationProfileRequest.php new file mode 100644 index 0000000..e6963cf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationProfileRequest.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.CreateConversationProfileRequest + */ +class CreateConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + + /** + * @param string $parent Required. The project to create a conversation profile for. + * Format: `projects//locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile Required. The conversation profile to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationProfileRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile): self + { + return (new self()) + ->setParent($parent) + ->setConversationProfile($conversationProfile); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. The conversation profile to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateConversationRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateConversationRequest.php new file mode 100644 index 0000000..afb451a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateConversationRequest.php @@ -0,0 +1,199 @@ +google.cloud.dialogflow.v2.CreateConversationRequest + */ +class CreateConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation = null; + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_id = ''; + + /** + * @param string $parent Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Conversation $conversation Required. The conversation to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Conversation $conversation): self + { + return (new self()) + ->setParent($parent) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\Conversation $conversation + * Required. The conversation to create. + * @type string $conversation_id + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Conversation|null + */ + public function getConversation() + { + return $this->conversation; + } + + public function hasConversation() + { + return isset($this->conversation); + } + + public function clearConversation() + { + unset($this->conversation); + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Conversation $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Conversation::class); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateDocumentRequest.php new file mode 100644 index 0000000..d642fc5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateDocumentRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateDocumentRequest + */ +class CreateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + + /** + * @param string $parent Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Document $document Required. The document to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateDocumentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Document $document): self + { + return (new self()) + ->setParent($parent) + ->setDocument($document); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @type \Google\Cloud\Dialogflow\V2\Document $document + * Required. The document to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document::class); + $this->document = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateEntityTypeRequest.php new file mode 100644 index 0000000..54bd1e8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateEntityTypeRequest.php @@ -0,0 +1,206 @@ +google.cloud.dialogflow.v2.CreateEntityTypeRequest + */ +class CreateEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_type = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The agent to create a entity type for. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateEntityTypeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\EntityType $entityType): self + { + return (new self()) + ->setParent($parent) + ->setEntityType($entityType); + } + + /** + * @param string $parent Required. The agent to create a entity type for. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\CreateEntityTypeRequest + * + * @experimental + */ + public static function buildFromParentEntityTypeLanguageCode(string $parent, \Google\Cloud\Dialogflow\V2\EntityType $entityType, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntityType($entityType) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * @type \Google\Cloud\Dialogflow\V2\EntityType $entity_type + * Required. The entity type to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EntityType|null + */ + public function getEntityType() + { + return $this->entity_type; + } + + public function hasEntityType() + { + return isset($this->entity_type); + } + + public function clearEntityType() + { + unset($this->entity_type); + } + + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateEnvironmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateEnvironmentRequest.php new file mode 100644 index 0000000..44e1ccc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateEnvironmentRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.CreateEnvironmentRequest + */ +class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment = null; + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type \Google\Cloud\Dialogflow\V2\Environment $environment + * Required. The environment to create. + * @type string $environment_id + * Required. The unique id of the new environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEnvironmentId() + { + return $this->environment_id; + } + + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEnvironmentId($var) + { + GPBUtil::checkString($var, True); + $this->environment_id = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateGeneratorRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateGeneratorRequest.php new file mode 100644 index 0000000..da70a57 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateGeneratorRequest.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.CreateGeneratorRequest + */ +class CreateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generator_id = ''; + + /** + * @param string $parent Required. The project/location to create generator for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to create. + * @param string $generatorId Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Generator $generator, string $generatorId): self + { + return (new self()) + ->setParent($parent) + ->setGenerator($generator) + ->setGeneratorId($generatorId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to create. + * @type string $generator_id + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGeneratorId() + { + return $this->generator_id; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGeneratorId($var) + { + GPBUtil::checkString($var, True); + $this->generator_id = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateIntentRequest.php new file mode 100644 index 0000000..cb16441 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateIntentRequest.php @@ -0,0 +1,240 @@ +google.cloud.dialogflow.v2.CreateIntentRequest + */ +class CreateIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $intent = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param string $parent Required. The agent to create a intent for. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateIntentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Intent $intent): self + { + return (new self()) + ->setParent($parent) + ->setIntent($intent); + } + + /** + * @param string $parent Required. The agent to create a intent for. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\CreateIntentRequest + * + * @experimental + */ + public static function buildFromParentIntentLanguageCode(string $parent, \Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setIntent($intent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * Required. The intent to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateKnowledgeBaseRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateKnowledgeBaseRequest.php new file mode 100644 index 0000000..f46bccb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateKnowledgeBaseRequest.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + */ +class CreateKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $knowledge_base = null; + + /** + * @param string $parent Required. The project to create a knowledge base for. + * Format: `projects//locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase Required. The knowledge base to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase): self + { + return (new self()) + ->setParent($parent) + ->setKnowledgeBase($knowledgeBase); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledge_base + * Required. The knowledge base to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeBase|null + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + public function hasKnowledgeBase() + { + return isset($this->knowledge_base); + } + + public function clearKnowledgeBase() + { + unset($this->knowledge_base); + } + + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_base = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateParticipantRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateParticipantRequest.php new file mode 100644 index 0000000..20b8f7f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateParticipantRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateParticipantRequest + */ +class CreateParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant = null; + + /** + * @param string $parent Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Participant $participant Required. The participant to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateParticipantRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Participant $participant): self + { + return (new self()) + ->setParent($parent) + ->setParticipant($participant); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @type \Google\Cloud\Dialogflow\V2\Participant $participant + * Required. The participant to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Participant|null + */ + public function getParticipant() + { + return $this->participant; + } + + public function hasParticipant() + { + return isset($this->participant); + } + + public function clearParticipant() + { + unset($this->participant); + } + + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Participant $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participant = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateSessionEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateSessionEntityTypeRequest.php new file mode 100644 index 0000000..136ace2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateSessionEntityTypeRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest + */ +class CreateSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_entity_type = null; + + /** + * @param string $parent Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType): self + { + return (new self()) + ->setParent($parent) + ->setSessionEntityType($sessionEntityType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType $session_entity_type + * Required. The session entity type to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SessionEntityType|null + */ + public function getSessionEntityType() + { + return $this->session_entity_type; + } + + public function hasSessionEntityType() + { + return isset($this->session_entity_type); + } + + public function clearSessionEntityType() + { + unset($this->session_entity_type); + } + + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $var + * @return $this + */ + public function setSessionEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/CreateVersionRequest.php b/vendor/google/cloud-dialogflow/src/V2/CreateVersionRequest.php new file mode 100644 index 0000000..d7797b8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/CreateVersionRequest.php @@ -0,0 +1,144 @@ +google.cloud.dialogflow.v2.CreateVersionRequest + */ +class CreateVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $version = null; + + /** + * @param string $parent Required. The agent to create a version for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Version $version Required. The version to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateVersionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Version $version): self + { + return (new self()) + ->setParent($parent) + ->setVersion($version); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type \Google\Cloud\Dialogflow\V2\Version $version + * Required. The version to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Version|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Version $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Version::class); + $this->version = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteAgentRequest.php new file mode 100644 index 0000000..a1e2bb7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.DeleteAgentRequest + */ +class DeleteAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to delete is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteAllContextsRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteAllContextsRequest.php new file mode 100644 index 0000000..49e06ce --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteAllContextsRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.DeleteAllContextsRequest + */ +class DeleteAllContextsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteAllContextsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteContextRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteContextRequest.php new file mode 100644 index 0000000..46b951b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteContextRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.DeleteContextRequest + */ +class DeleteContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteContextRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetOperationMetadata.php new file mode 100644 index 0000000..73516cf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata + */ +class DeleteConversationDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetRequest.php new file mode 100644 index 0000000..27435f1 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationDatasetRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteConversationDatasetRequest + */ +class DeleteConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelOperationMetadata.php new file mode 100644 index 0000000..30cc006 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata + */ +class DeleteConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelRequest.php new file mode 100644 index 0000000..03defaf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationModelRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteConversationModelRequest + */ +class DeleteConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteConversationProfileRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationProfileRequest.php new file mode 100644 index 0000000..232c89d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteConversationProfileRequest.php @@ -0,0 +1,94 @@ +google.cloud.dialogflow.v2.DeleteConversationProfileRequest + */ +class DeleteConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteDocumentRequest.php new file mode 100644 index 0000000..1ae4fa2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteDocumentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteDocumentRequest + */ +class DeleteDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteEntityTypeRequest.php new file mode 100644 index 0000000..710ea19 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteEntityTypeRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.DeleteEntityTypeRequest + */ +class DeleteEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteEnvironmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteEnvironmentRequest.php new file mode 100644 index 0000000..4ff70b6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteEnvironmentRequest.php @@ -0,0 +1,88 @@ +google.cloud.dialogflow.v2.DeleteEnvironmentRequest + */ +class DeleteEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteGeneratorRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteGeneratorRequest.php new file mode 100644 index 0000000..8cd00db --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteGeneratorRequest + */ +class DeleteGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteIntentRequest.php new file mode 100644 index 0000000..6d9bcb4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteIntentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteIntentRequest + */ +class DeleteIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteIntentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteKnowledgeBaseRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteKnowledgeBaseRequest.php new file mode 100644 index 0000000..7c1a9a7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteKnowledgeBaseRequest.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + */ +class DeleteKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @type bool $force + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteSessionEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteSessionEntityTypeRequest.php new file mode 100644 index 0000000..e5a1c48 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteSessionEntityTypeRequest.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest + */ +class DeleteSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeleteVersionRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeleteVersionRequest.php new file mode 100644 index 0000000..2d813ed --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeleteVersionRequest.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.DeleteVersionRequest + */ +class DeleteVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the version to delete. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelOperationMetadata.php new file mode 100644 index 0000000..fd4a874 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata + */ +class DeployConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelRequest.php b/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelRequest.php new file mode 100644 index 0000000..13c3d0a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DeployConversationModelRequest.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.DeployConversationModelRequest + */ +class DeployConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DetectIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/DetectIntentRequest.php new file mode 100644 index 0000000..8461a65 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DetectIntentRequest.php @@ -0,0 +1,428 @@ +google.cloud.dialogflow.v2.DetectIntentRequest + */ +class DetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $session = ''; + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + */ + protected $query_params = null; + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_input = null; + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + */ + protected $output_audio_config = null; + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + */ + protected $output_audio_config_mask = null; + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + */ + protected $input_audio = ''; + + /** + * @param string $session Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\QueryInput $queryInput Required. The input specification. It can be set to: + * + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * + * 2. a conversational query in the form of text, or + * + * 3. an event that specifies which intent to trigger. + * + * @return \Google\Cloud\Dialogflow\V2\DetectIntentRequest + * + * @experimental + */ + public static function build(string $session, \Google\Cloud\Dialogflow\V2\QueryInput $queryInput): self + { + return (new self()) + ->setSession($session) + ->setQueryInput($queryInput); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * The parameters of this query. + * @type \Google\Cloud\Dialogflow\V2\QueryInput $query_input + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * @type \Google\Protobuf\FieldMask $output_audio_config_mask + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * @type string $input_audio + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\QueryInput|null + */ + public function getQueryInput() + { + return $this->query_input; + } + + public function hasQueryInput() + { + return isset($this->query_input); + } + + public function clearQueryInput() + { + unset($this->query_input); + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\QueryInput $var + * @return $this + */ + public function setQueryInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryInput::class); + $this->query_input = $var; + + return $this; + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @return \Google\Protobuf\FieldMask|null + */ + public function getOutputAudioConfigMask() + { + return $this->output_audio_config_mask; + } + + public function hasOutputAudioConfigMask() + { + return isset($this->output_audio_config_mask); + } + + public function clearOutputAudioConfigMask() + { + unset($this->output_audio_config_mask); + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setOutputAudioConfigMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->output_audio_config_mask = $var; + + return $this; + } + + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + * @return string + */ + public function getInputAudio() + { + return $this->input_audio; + } + + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->input_audio = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DetectIntentResponse.php b/vendor/google/cloud-dialogflow/src/V2/DetectIntentResponse.php new file mode 100644 index 0000000..b838449 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DetectIntentResponse.php @@ -0,0 +1,273 @@ +google.cloud.dialogflow.v2.DetectIntentResponse + */ +class DetectIntentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + */ + protected $query_result = null; + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + */ + protected $webhook_status = null; + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + */ + protected $output_audio = ''; + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + */ + protected $output_audio_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_id + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * @type \Google\Rpc\Status $webhook_status + * Specifies the status of the webhook request. + * @type string $output_audio + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * The config used by the speech synthesizer to generate the output audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + * @return \Google\Rpc\Status|null + */ + public function getWebhookStatus() + { + return $this->webhook_status; + } + + public function hasWebhookStatus() + { + return isset($this->webhook_status); + } + + public function clearWebhookStatus() + { + unset($this->webhook_status); + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setWebhookStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->webhook_status = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + * @return string + */ + public function getOutputAudio() + { + return $this->output_audio; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + * @param string $var + * @return $this + */ + public function setOutputAudio($var) + { + GPBUtil::checkString($var, False); + $this->output_audio = $var; + + return $this; + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/DialogflowAssistAnswer.php b/vendor/google/cloud-dialogflow/src/V2/DialogflowAssistAnswer.php new file mode 100644 index 0000000..65b84a8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DialogflowAssistAnswer.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.DialogflowAssistAnswer + */ +class DialogflowAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + */ + protected $answer_record = ''; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * Result from v2 agent. + * @type \Google\Cloud\Dialogflow\V2\IntentSuggestion $intent_suggestion + * An intent suggestion generated from conversation. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->readOneof(1); + } + + public function hasQueryResult() + { + return $this->hasOneof(1); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @return \Google\Cloud\Dialogflow\V2\IntentSuggestion|null + */ + public function getIntentSuggestion() + { + return $this->readOneof(5); + } + + public function hasIntentSuggestion() + { + return $this->hasOneof(5); + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @param \Google\Cloud\Dialogflow\V2\IntentSuggestion $var + * @return $this + */ + public function setIntentSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentSuggestion::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Document.php b/vendor/google/cloud-dialogflow/src/V2/Document.php new file mode 100644 index 0000000..74886da --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Document.php @@ -0,0 +1,500 @@ +google.cloud.dialogflow.v2.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mime_type = ''; + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $knowledge_types; + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_auto_reload = false; + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $latest_reload_status = null; + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metadata; + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * @type string $display_name + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * @type string $mime_type + * Required. The MIME type of this document. + * @type array|\Google\Protobuf\Internal\RepeatedField $knowledge_types + * Required. The knowledge type of document content. + * @type string $content_uri + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * @type string $raw_content + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * @type bool $enable_auto_reload + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * @type \Google\Cloud\Dialogflow\V2\Document\ReloadStatus $latest_reload_status + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * @type int $state + * Output only. The current state of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKnowledgeTypes() + { + return $this->knowledge_types; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKnowledgeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Document\KnowledgeType::class); + $this->knowledge_types = $arr; + + return $this; + } + + /** + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * + * Generated from protobuf field string content_uri = 5; + * @return string + */ + public function getContentUri() + { + return $this->readOneof(5); + } + + public function hasContentUri() + { + return $this->hasOneof(5); + } + + /** + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * + * Generated from protobuf field string content_uri = 5; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * + * Generated from protobuf field bytes raw_content = 9; + * @return string + */ + public function getRawContent() + { + return $this->readOneof(9); + } + + public function hasRawContent() + { + return $this->hasOneof(9); + } + + /** + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * + * Generated from protobuf field bytes raw_content = 9; + * @param string $var + * @return $this + */ + public function setRawContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutoReload() + { + return $this->enable_auto_reload; + } + + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutoReload($var) + { + GPBUtil::checkBool($var); + $this->enable_auto_reload = $var; + + return $this; + } + + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\Document\ReloadStatus|null + */ + public function getLatestReloadStatus() + { + return $this->latest_reload_status; + } + + public function hasLatestReloadStatus() + { + return isset($this->latest_reload_status); + } + + public function clearLatestReloadStatus() + { + unset($this->latest_reload_status); + } + + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Document\ReloadStatus $var + * @return $this + */ + public function setLatestReloadStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document\ReloadStatus::class); + $this->latest_reload_status = $var; + + return $this; + } + + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Document\State::class); + $this->state = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Document/KnowledgeType.php b/vendor/google/cloud-dialogflow/src/V2/Document/KnowledgeType.php new file mode 100644 index 0000000..d8d1fe2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Document/KnowledgeType.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.Document.KnowledgeType + */ +class KnowledgeType +{ + /** + * The type is unspecified or arbitrary. + * + * Generated from protobuf enum KNOWLEDGE_TYPE_UNSPECIFIED = 0; + */ + const KNOWLEDGE_TYPE_UNSPECIFIED = 0; + /** + * The document content contains question and answer pairs as either HTML or + * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats + * may fail to be parsed. + * CSV must have questions in the first column and answers in the second, + * with no header. Because of this explicit format, they are always parsed + * accurately. + * + * Generated from protobuf enum FAQ = 1; + */ + const FAQ = 1; + /** + * Documents for which unstructured text is extracted and used for + * question answering. + * + * Generated from protobuf enum EXTRACTIVE_QA = 2; + */ + const EXTRACTIVE_QA = 2; + /** + * The entire document content as a whole can be used for query results. + * Only for Contact Center Solutions on Dialogflow. + * + * Generated from protobuf enum ARTICLE_SUGGESTION = 3; + */ + const ARTICLE_SUGGESTION = 3; + /** + * The document contains agent-facing Smart Reply entries. + * + * Generated from protobuf enum AGENT_FACING_SMART_REPLY = 4; + */ + const AGENT_FACING_SMART_REPLY = 4; + + private static $valueToName = [ + self::KNOWLEDGE_TYPE_UNSPECIFIED => 'KNOWLEDGE_TYPE_UNSPECIFIED', + self::FAQ => 'FAQ', + self::EXTRACTIVE_QA => 'EXTRACTIVE_QA', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::AGENT_FACING_SMART_REPLY => 'AGENT_FACING_SMART_REPLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Document/ReloadStatus.php b/vendor/google/cloud-dialogflow/src/V2/Document/ReloadStatus.php new file mode 100644 index 0000000..99e4900 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Document/ReloadStatus.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.Document.ReloadStatus + */ +class ReloadStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + */ + protected $time = null; + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $time + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * @type \Google\Rpc\Status $status + * The status of a reload attempt or the initial load. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->time; + } + + public function hasTime() + { + return isset($this->time); + } + + public function clearTime() + { + unset($this->time); + } + + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->time = $var; + + return $this; + } + + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Document/State.php b/vendor/google/cloud-dialogflow/src/V2/Document/State.php new file mode 100644 index 0000000..88e797a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Document/State.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.Document.State + */ +class State +{ + /** + * The document state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The document creation is in progress. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The document is active and ready to use. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The document updation is in progress. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The document is reloading. + * + * Generated from protobuf enum RELOADING = 4; + */ + const RELOADING = 4; + /** + * The document deletion is in progress. + * + * Generated from protobuf enum DELETING = 5; + */ + const DELETING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::UPDATING => 'UPDATING', + self::RELOADING => 'RELOADING', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/DtmfParameters.php b/vendor/google/cloud-dialogflow/src/V2/DtmfParameters.php new file mode 100644 index 0000000..be68501 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/DtmfParameters.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.DtmfParameters + */ +class DtmfParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + */ + protected $accepts_dtmf_input = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $accepts_dtmf_input + * Indicates whether DTMF input can be handled in the next request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + * @return bool + */ + public function getAcceptsDtmfInput() + { + return $this->accepts_dtmf_input; + } + + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + * @param bool $var + * @return $this + */ + public function setAcceptsDtmfInput($var) + { + GPBUtil::checkBool($var); + $this->accepts_dtmf_input = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/EncryptionSpec.php b/vendor/google/cloud-dialogflow/src/V2/EncryptionSpec.php new file mode 100644 index 0000000..cf409b8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EncryptionSpec.php @@ -0,0 +1,126 @@ +google.cloud.dialogflow.v2.EncryptionSpec + */ +class EncryptionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * @type string $kms_key + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/EntityType.php b/vendor/google/cloud-dialogflow/src/V2/EntityType.php new file mode 100644 index 0000000..2c3f5a2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EntityType.php @@ -0,0 +1,274 @@ +google.cloud.dialogflow.v2.EntityType + */ +class EntityType extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kind = 0; + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auto_expansion_mode = 0; + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $entities; + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_fuzzy_extraction = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * @type string $display_name + * Required. The name of the entity type. + * @type int $kind + * Required. Indicates the kind of entity type. + * @type int $auto_expansion_mode + * Optional. Indicates whether the entity type can be automatically + * expanded. + * @type array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $entities + * Optional. The collection of entity entries associated with the entity type. + * @type bool $enable_fuzzy_extraction + * Optional. Enables fuzzy entity extraction during classification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\EntityType\Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAutoExpansionMode() + { + return $this->auto_expansion_mode; + } + + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAutoExpansionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\EntityType\AutoExpansionMode::class); + $this->auto_expansion_mode = $var; + + return $this; + } + + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableFuzzyExtraction() + { + return $this->enable_fuzzy_extraction; + } + + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableFuzzyExtraction($var) + { + GPBUtil::checkBool($var); + $this->enable_fuzzy_extraction = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/EntityType/AutoExpansionMode.php b/vendor/google/cloud-dialogflow/src/V2/EntityType/AutoExpansionMode.php new file mode 100644 index 0000000..4dabbf2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EntityType/AutoExpansionMode.php @@ -0,0 +1,58 @@ +google.cloud.dialogflow.v2.EntityType.AutoExpansionMode + */ +class AutoExpansionMode +{ + /** + * Auto expansion disabled for the entity. + * + * Generated from protobuf enum AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + */ + const AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + /** + * Allows an agent to recognize values that have not been explicitly + * listed in the entity. + * + * Generated from protobuf enum AUTO_EXPANSION_MODE_DEFAULT = 1; + */ + const AUTO_EXPANSION_MODE_DEFAULT = 1; + + private static $valueToName = [ + self::AUTO_EXPANSION_MODE_UNSPECIFIED => 'AUTO_EXPANSION_MODE_UNSPECIFIED', + self::AUTO_EXPANSION_MODE_DEFAULT => 'AUTO_EXPANSION_MODE_DEFAULT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EntityType/Entity.php b/vendor/google/cloud-dialogflow/src/V2/EntityType/Entity.php new file mode 100644 index 0000000..1c0bad2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EntityType/Entity.php @@ -0,0 +1,146 @@ +google.cloud.dialogflow.v2.EntityType.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = ''; + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EntityType/Kind.php b/vendor/google/cloud-dialogflow/src/V2/EntityType/Kind.php new file mode 100644 index 0000000..184d9b8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EntityType/Kind.php @@ -0,0 +1,73 @@ +google.cloud.dialogflow.v2.EntityType.Kind + */ +class Kind +{ + /** + * Not specified. This value should be never used. + * + * Generated from protobuf enum KIND_UNSPECIFIED = 0; + */ + const KIND_UNSPECIFIED = 0; + /** + * Map entity types allow mapping of a group of synonyms to a reference + * value. + * + * Generated from protobuf enum KIND_MAP = 1; + */ + const KIND_MAP = 1; + /** + * List entity types contain a set of entries that do not map to reference + * values. However, list entity types can contain references to other entity + * types (with or without aliases). + * + * Generated from protobuf enum KIND_LIST = 2; + */ + const KIND_LIST = 2; + /** + * Regexp entity types allow to specify regular expressions in entries + * values. + * + * Generated from protobuf enum KIND_REGEXP = 3; + */ + const KIND_REGEXP = 3; + + private static $valueToName = [ + self::KIND_UNSPECIFIED => 'KIND_UNSPECIFIED', + self::KIND_MAP => 'KIND_MAP', + self::KIND_LIST => 'KIND_LIST', + self::KIND_REGEXP => 'KIND_REGEXP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EntityTypeBatch.php b/vendor/google/cloud-dialogflow/src/V2/EntityTypeBatch.php new file mode 100644 index 0000000..290c6be --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EntityTypeBatch.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.EntityTypeBatch + */ +class EntityTypeBatch extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $entity_types + * A collection of entity types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Environment.php b/vendor/google/cloud-dialogflow/src/V2/Environment.php new file mode 100644 index 0000000..89d14a7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Environment.php @@ -0,0 +1,362 @@ +google.cloud.dialogflow.v2.Environment + */ +class Environment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agent_version = ''; + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text_to_speech_settings = null; + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fulfillment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type string $description + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * @type string $agent_version + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type int $state + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * @type \Google\Cloud\Dialogflow\V2\TextToSpeechSettings $text_to_speech_settings + * Optional. Text to speech settings for this environment. + * @type \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment + * Optional. The fulfillment settings to use for this environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgentVersion() + { + return $this->agent_version; + } + + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgentVersion($var) + { + GPBUtil::checkString($var, True); + $this->agent_version = $var; + + return $this; + } + + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Environment\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\TextToSpeechSettings|null + */ + public function getTextToSpeechSettings() + { + return $this->text_to_speech_settings; + } + + public function hasTextToSpeechSettings() + { + return isset($this->text_to_speech_settings); + } + + public function clearTextToSpeechSettings() + { + unset($this->text_to_speech_settings); + } + + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\TextToSpeechSettings $var + * @return $this + */ + public function setTextToSpeechSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextToSpeechSettings::class); + $this->text_to_speech_settings = $var; + + return $this; + } + + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment|null + */ + public function getFulfillment() + { + return $this->fulfillment; + } + + public function hasFulfillment() + { + return isset($this->fulfillment); + } + + public function clearFulfillment() + { + unset($this->fulfillment); + } + + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $var + * @return $this + */ + public function setFulfillment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment::class); + $this->fulfillment = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Environment/State.php b/vendor/google/cloud-dialogflow/src/V2/Environment/State.php new file mode 100644 index 0000000..6bdb303 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Environment/State.php @@ -0,0 +1,73 @@ +google.cloud.dialogflow.v2.Environment.State + */ +class State +{ + /** + * Not specified. This value is not used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Stopped. + * + * Generated from protobuf enum STOPPED = 1; + */ + const STOPPED = 1; + /** + * Loading. + * + * Generated from protobuf enum LOADING = 2; + */ + const LOADING = 2; + /** + * Running. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::STOPPED => 'STOPPED', + self::LOADING => 'LOADING', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory.php b/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory.php new file mode 100644 index 0000000..103f608 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory.php @@ -0,0 +1,164 @@ +google.cloud.dialogflow.v2.EnvironmentHistory + */ +class EnvironmentHistory extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parent = ''; + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $entries; + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $entries + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * @type string $next_page_token + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry::class); + $this->entries = $arr; + + return $this; + } + + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory/Entry.php b/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory/Entry.php new file mode 100644 index 0000000..028781d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EnvironmentHistory/Entry.php @@ -0,0 +1,146 @@ +google.cloud.dialogflow.v2.EnvironmentHistory.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + */ + protected $agent_version = ''; + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_version + * The agent version loaded into this environment history entry. + * @type string $description + * The developer-provided description for this environment history entry. + * @type \Google\Protobuf\Timestamp $create_time + * The creation time of this environment history entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + * @return string + */ + public function getAgentVersion() + { + return $this->agent_version; + } + + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + * @param string $var + * @return $this + */ + public function setAgentVersion($var) + { + GPBUtil::checkString($var, True); + $this->agent_version = $var; + + return $this; + } + + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig.php b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig.php new file mode 100644 index 0000000..f9f61d0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.EvaluationConfig + */ +class EvaluationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $datasets; + protected $model_specific_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $datasets + * Required. Datasets used for evaluation. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $smart_reply_config + * Configuration for smart reply model evaluation. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $smart_compose_config + * Configuration for smart compose model evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\InputDataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * Configuration for smart reply model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig smart_reply_config = 2; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig|null + */ + public function getSmartReplyConfig() + { + return $this->readOneof(2); + } + + public function hasSmartReplyConfig() + { + return $this->hasOneof(2); + } + + /** + * Configuration for smart reply model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig smart_reply_config = 2; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $var + * @return $this + */ + public function setSmartReplyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Configuration for smart compose model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig smart_compose_config = 4; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig|null + */ + public function getSmartComposeConfig() + { + return $this->readOneof(4); + } + + public function hasSmartComposeConfig() + { + return $this->hasOneof(4); + } + + /** + * Configuration for smart compose model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig smart_compose_config = 4; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $var + * @return $this + */ + public function setSmartComposeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getModelSpecificConfig() + { + return $this->whichOneof("model_specific_config"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartComposeConfig.php b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartComposeConfig.php new file mode 100644 index 0000000..83ebdff --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartComposeConfig.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig + */ +class SmartComposeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + */ + protected $allowlist_document = ''; + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_result_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $allowlist_document + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * @type int $max_result_count + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getAllowlistDocument() + { + return $this->allowlist_document; + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAllowlistDocument($var) + { + GPBUtil::checkString($var, True); + $this->allowlist_document = $var; + + return $this; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxResultCount() + { + return $this->max_result_count; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxResultCount($var) + { + GPBUtil::checkInt32($var); + $this->max_result_count = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartReplyConfig.php b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartReplyConfig.php new file mode 100644 index 0000000..512358b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EvaluationConfig/SmartReplyConfig.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig + */ +class SmartReplyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + */ + protected $allowlist_document = ''; + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_result_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $allowlist_document + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * @type int $max_result_count + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getAllowlistDocument() + { + return $this->allowlist_document; + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAllowlistDocument($var) + { + GPBUtil::checkString($var, True); + $this->allowlist_document = $var; + + return $this; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxResultCount() + { + return $this->max_result_count; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxResultCount($var) + { + GPBUtil::checkInt32($var); + $this->max_result_count = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/EventInput.php b/vendor/google/cloud-dialogflow/src/V2/EventInput.php new file mode 100644 index 0000000..015785c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/EventInput.php @@ -0,0 +1,221 @@ +` can trigger a personalized welcome response. + * The parameter `name` may be used by the agent in the response: + * `"Hello #welcome_event.name! What can I do for you today?"`. + * + * Generated from protobuf message google.cloud.dialogflow.v2.EventInput + */ +class EventInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + */ + protected $parameters = null; + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the event. + * @type \Google\Protobuf\Struct $parameters + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type string $language_code + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ExportAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/ExportAgentRequest.php new file mode 100644 index 0000000..638f4e4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ExportAgentRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.ExportAgentRequest + */ +class ExportAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $agent_uri = ''; + + /** + * @param string $parent Required. The project that the agent to export is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ExportAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * @type string $agent_uri + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAgentUri() + { + return $this->agent_uri; + } + + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->agent_uri = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ExportAgentResponse.php b/vendor/google/cloud-dialogflow/src/V2/ExportAgentResponse.php new file mode 100644 index 0000000..0568ef0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ExportAgentResponse.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.ExportAgentResponse + */ +class ExportAgentResponse extends \Google\Protobuf\Internal\Message +{ + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_uri + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * + * Generated from protobuf field string agent_uri = 1; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(1); + } + + public function hasAgentUri() + { + return $this->hasOneof(1); + } + + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * + * Generated from protobuf field string agent_uri = 1; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 2; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(2); + } + + public function hasAgentContent() + { + return $this->hasOneof(2); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 2; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ExportDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/ExportDocumentRequest.php new file mode 100644 index 0000000..84bd541 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ExportDocumentRequest.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.ExportDocumentRequest + */ +class ExportDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + */ + protected $export_full_content = false; + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + */ + protected $smart_messaging_partial_update = false; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * @type \Google\Cloud\Dialogflow\V2\GcsDestination $gcs_destination + * Cloud Storage file path to export the document. + * @type bool $export_full_content + * When enabled, export the full content of the document including empirical + * probability. + * @type bool $smart_messaging_partial_update + * When enabled, export the smart messaging allowlist document for partial + * update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Cloud Storage file path to export the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination gcs_destination = 2; + * @return \Google\Cloud\Dialogflow\V2\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(2); + } + + public function hasGcsDestination() + { + return $this->hasOneof(2); + } + + /** + * Cloud Storage file path to export the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination gcs_destination = 2; + * @param \Google\Cloud\Dialogflow\V2\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + * @return bool + */ + public function getExportFullContent() + { + return $this->export_full_content; + } + + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + * @param bool $var + * @return $this + */ + public function setExportFullContent($var) + { + GPBUtil::checkBool($var); + $this->export_full_content = $var; + + return $this; + } + + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + * @return bool + */ + public function getSmartMessagingPartialUpdate() + { + return $this->smart_messaging_partial_update; + } + + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + * @param bool $var + * @return $this + */ + public function setSmartMessagingPartialUpdate($var) + { + GPBUtil::checkBool($var); + $this->smart_messaging_partial_update = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ExportOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/ExportOperationMetadata.php new file mode 100644 index 0000000..1462570 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ExportOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.ExportOperationMetadata + */ +class ExportOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + */ + protected $exported_gcs_destination = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GcsDestination $exported_gcs_destination + * Cloud Storage file path of the exported data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + * @return \Google\Cloud\Dialogflow\V2\GcsDestination|null + */ + public function getExportedGcsDestination() + { + return $this->exported_gcs_destination; + } + + public function hasExportedGcsDestination() + { + return isset($this->exported_gcs_destination); + } + + public function clearExportedGcsDestination() + { + unset($this->exported_gcs_destination); + } + + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + * @param \Google\Cloud\Dialogflow\V2\GcsDestination $var + * @return $this + */ + public function setExportedGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsDestination::class); + $this->exported_gcs_destination = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/FaqAnswer.php b/vendor/google/cloud-dialogflow/src/V2/FaqAnswer.php new file mode 100644 index 0000000..c8d2453 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/FaqAnswer.php @@ -0,0 +1,269 @@ +google.cloud.dialogflow.v2.FaqAnswer + */ +class FaqAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + */ + protected $answer = ''; + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + */ + protected $question = ''; + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + */ + protected $source = ''; + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + */ + private $metadata; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer + * The piece of text from the `source` knowledge base document. + * @type float $confidence + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * @type string $question + * The corresponding FAQ question. + * @type string $source + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * A map that contains metadata about the answer and the + * document from which it originates. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/FewShotExample.php b/vendor/google/cloud-dialogflow/src/V2/FewShotExample.php new file mode 100644 index 0000000..426155a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/FewShotExample.php @@ -0,0 +1,206 @@ +google.cloud.dialogflow.v2.FewShotExample + */ +class FewShotExample extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $extra_info; + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output = null; + protected $instruction_list; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Conversation transcripts. + * @type array|\Google\Protobuf\Internal\MapField $extra_info + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * @type \Google\Cloud\Dialogflow\V2\SummarizationSectionList $summarization_section_list + * Summarization sections. + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $output + * Required. Example output of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExtraInfo() + { + return $this->extra_info; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExtraInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->extra_info = $arr; + + return $this; + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @return \Google\Cloud\Dialogflow\V2\SummarizationSectionList|null + */ + public function getSummarizationSectionList() + { + return $this->readOneof(6); + } + + public function hasSummarizationSectionList() + { + return $this->hasOneof(6); + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @param \Google\Cloud\Dialogflow\V2\SummarizationSectionList $var + * @return $this + */ + public function setSummarizationSectionList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationSectionList::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getOutput() + { + return $this->output; + } + + public function hasOutput() + { + return isset($this->output); + } + + public function clearOutput() + { + unset($this->output); + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setOutput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->output = $var; + + return $this; + } + + /** + * @return string + */ + public function getInstructionList() + { + return $this->whichOneof("instruction_list"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/FreeFormContext.php b/vendor/google/cloud-dialogflow/src/V2/FreeFormContext.php new file mode 100644 index 0000000..ffcc26b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/FreeFormContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.FreeFormContext + */ +class FreeFormContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Optional. Free form text input to LLM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/FreeFormSuggestion.php b/vendor/google/cloud-dialogflow/src/V2/FreeFormSuggestion.php new file mode 100644 index 0000000..7c3fe62 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/FreeFormSuggestion.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.FreeFormSuggestion + */ +class FreeFormSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $response = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response + * Required. Free form suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResponse() + { + return $this->response; + } + + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Fulfillment.php b/vendor/google/cloud-dialogflow/src/V2/Fulfillment.php new file mode 100644 index 0000000..5284053 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Fulfillment.php @@ -0,0 +1,247 @@ +google.cloud.dialogflow.v2.Fulfillment + */ +class Fulfillment extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = false; + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $features; + protected $fulfillment; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * @type string $display_name + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * @type \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService $generic_web_service + * Configuration for a generic web service. + * @type bool $enabled + * Optional. Whether fulfillment is enabled. + * @type array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $features + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Configuration for a generic web service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.GenericWebService generic_web_service = 3; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService|null + */ + public function getGenericWebService() + { + return $this->readOneof(3); + } + + public function hasGenericWebService() + { + return $this->hasOneof(3); + } + + /** + * Configuration for a generic web service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.GenericWebService generic_web_service = 3; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService $var + * @return $this + */ + public function setGenericWebService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeatures() + { + return $this->features; + } + + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Fulfillment\Feature::class); + $this->features = $arr; + + return $this; + } + + /** + * @return string + */ + public function getFulfillment() + { + return $this->whichOneof("fulfillment"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature.php b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature.php new file mode 100644 index 0000000..3c91650 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Fulfillment.Feature + */ +class Feature extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The type of the feature that enabled for fulfillment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Fulfillment\Feature\Type::class); + $this->type = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature/Type.php b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature/Type.php new file mode 100644 index 0000000..694f53a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/Feature/Type.php @@ -0,0 +1,55 @@ +google.cloud.dialogflow.v2.Fulfillment.Feature.Type + */ +class Type +{ + /** + * Feature type not specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Fulfillment is enabled for SmallTalk. + * + * Generated from protobuf enum SMALLTALK = 1; + */ + const SMALLTALK = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SMALLTALK => 'SMALLTALK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Fulfillment/GenericWebService.php b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/GenericWebService.php new file mode 100644 index 0000000..8e0493c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Fulfillment/GenericWebService.php @@ -0,0 +1,236 @@ +google.cloud.dialogflow.v2.Fulfillment.GenericWebService + */ +class GenericWebService extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $username = ''; + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $password = ''; + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_headers; + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $is_cloud_function = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * @type string $username + * Optional. The user name for HTTP Basic authentication. + * @type string $password + * Optional. The password for HTTP Basic authentication. + * @type array|\Google\Protobuf\Internal\MapField $request_headers + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * @type bool $is_cloud_function + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRequestHeaders() + { + return $this->request_headers; + } + + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRequestHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->request_headers = $arr; + + return $this; + } + + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getIsCloudFunction() + { + if ($this->is_cloud_function !== false) { + @trigger_error('is_cloud_function is deprecated.', E_USER_DEPRECATED); + } + return $this->is_cloud_function; + } + + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setIsCloudFunction($var) + { + @trigger_error('is_cloud_function is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->is_cloud_function = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/GcsDestination.php b/vendor/google/cloud-dialogflow/src/V2/GcsDestination.php new file mode 100644 index 0000000..db741ca --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GcsDestination.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Gcs::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GcsSources.php b/vendor/google/cloud-dialogflow/src/V2/GcsSources.php new file mode 100644 index 0000000..f4a6871 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GcsSources.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.GcsSources + */ +class GcsSources extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $uris + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Gcs::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUris() + { + return $this->uris; + } + + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->uris = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionRequest.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionRequest.php new file mode 100644 index 0000000..e484ae5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionRequest.php @@ -0,0 +1,281 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest + */ +class GenerateStatelessSuggestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $context_references; + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $trigger_events; + protected $generator_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * @type string $generator_name + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * @type array|\Google\Protobuf\Internal\MapField $context_references + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Context of the conversation, including transcripts. + * @type array|\Google\Protobuf\Internal\RepeatedField $trigger_events + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->readOneof(2); + } + + public function hasGenerator() + { + return $this->hasOneof(2); + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @return string + */ + public function getGeneratorName() + { + return $this->readOneof(3); + } + + public function hasGeneratorName() + { + return $this->hasOneof(3); + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @param string $var + * @return $this + */ + public function setGeneratorName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getContextReferences() + { + return $this->context_references; + } + + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->context_references = $arr; + + return $this; + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTriggerEvents() + { + return $this->trigger_events; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTriggerEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_events = $arr; + + return $this; + } + + /** + * @return string + */ + public function getGeneratorResource() + { + return $this->whichOneof("generator_resource"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionResponse.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionResponse.php new file mode 100644 index 0000000..304f86b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSuggestionResponse.php @@ -0,0 +1,78 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse + */ +class GenerateStatelessSuggestionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator_suggestion = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Required. Generated suggestion for a conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->generator_suggestion; + } + + public function hasGeneratorSuggestion() + { + return isset($this->generator_suggestion); + } + + public function clearGeneratorSuggestion() + { + unset($this->generator_suggestion); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->generator_suggestion = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest.php new file mode 100644 index 0000000..444878d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest.php @@ -0,0 +1,222 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest + */ +class GenerateStatelessSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $stateless_conversation = null; + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $stateless_conversation + * Required. The conversation to suggest a summary for. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * @type int $max_context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation|null + */ + public function getStatelessConversation() + { + return $this->stateless_conversation; + } + + public function hasStatelessConversation() + { + return isset($this->stateless_conversation); + } + + public function clearStatelessConversation() + { + unset($this->stateless_conversation); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $var + * @return $this + */ + public function setStatelessConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation::class); + $this->stateless_conversation = $var; + + return $this; + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxContextSize() + { + return $this->max_context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxContextSize($var) + { + GPBUtil::checkInt32($var); + $this->max_context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest/MinimalConversation.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest/MinimalConversation.php new file mode 100644 index 0000000..a7b39d4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryRequest/MinimalConversation.php @@ -0,0 +1,123 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation + */ +class MinimalConversation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $messages; + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * @type string $parent + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse.php new file mode 100644 index 0000000..5190f20 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse.php @@ -0,0 +1,174 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse + */ +class GenerateStatelessSummaryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + */ + protected $summary = null; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary $summary + * Generated summary. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary|null + */ + public function getSummary() + { + return $this->summary; + } + + public function hasSummary() + { + return isset($this->summary); + } + + public function clearSummary() + { + unset($this->summary); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary::class); + $this->summary = $var; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse/Summary.php b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse/Summary.php new file mode 100644 index 0000000..4fa4f68 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateStatelessSummaryResponse/Summary.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + */ + private $text_sections; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsRequest.php b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsRequest.php new file mode 100644 index 0000000..144cea9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsRequest.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsRequest + */ +class GenerateSuggestionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $trigger_events; + + /** + * @param string $conversation Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GenerateSuggestionsRequest + * + * @experimental + */ + public static function build(string $conversation): self + { + return (new self()) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * @type string $latest_message + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $trigger_events + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTriggerEvents() + { + return $this->trigger_events; + } + + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTriggerEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_events = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse.php b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse.php new file mode 100644 index 0000000..3905734 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsResponse + */ +class GenerateSuggestionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + */ + private $generator_suggestion_answers; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer>|\Google\Protobuf\Internal\RepeatedField $generator_suggestion_answers + * The answers generated for the conversation based on context. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGeneratorSuggestionAnswers() + { + return $this->generator_suggestion_answers; + } + + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + * @param array<\Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGeneratorSuggestionAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer::class); + $this->generator_suggestion_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php new file mode 100644 index 0000000..c8826da --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer + */ +class GeneratorSuggestionAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + */ + protected $generator_suggestion = null; + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + */ + protected $source_generator = ''; + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Suggestion details. + * @type string $source_generator + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * @type string $answer_record + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->generator_suggestion; + } + + public function hasGeneratorSuggestion() + { + return isset($this->generator_suggestion); + } + + public function clearGeneratorSuggestion() + { + unset($this->generator_suggestion); + } + + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->generator_suggestion = $var; + + return $this; + } + + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + * @return string + */ + public function getSourceGenerator() + { + return $this->source_generator; + } + + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + * @param string $var + * @return $this + */ + public function setSourceGenerator($var) + { + GPBUtil::checkString($var, True); + $this->source_generator = $var; + + return $this; + } + + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Generator.php b/vendor/google/cloud-dialogflow/src/V2/Generator.php new file mode 100644 index 0000000..f487a35 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Generator.php @@ -0,0 +1,404 @@ +google.cloud.dialogflow.v2.Generator + */ +class Generator extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $inference_parameter = null; + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trigger_event = 0; + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + protected $context; + protected $foundation_model; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * @type string $description + * Optional. Human readable description of the generator. + * @type \Google\Cloud\Dialogflow\V2\FreeFormContext $free_form_context + * Input of free from generator to LLM. + * @type \Google\Cloud\Dialogflow\V2\SummarizationContext $summarization_context + * Input of prebuilt Summarization feature. + * @type \Google\Cloud\Dialogflow\V2\InferenceParameter $inference_parameter + * Optional. Inference parameters for this generator. + * @type int $trigger_event + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * @type string $published_model + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison@002`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this generator. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of this generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Input of free from generator to LLM. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormContext free_form_context = 11; + * @return \Google\Cloud\Dialogflow\V2\FreeFormContext|null + */ + public function getFreeFormContext() + { + return $this->readOneof(11); + } + + public function hasFreeFormContext() + { + return $this->hasOneof(11); + } + + /** + * Input of free from generator to LLM. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormContext free_form_context = 11; + * @param \Google\Cloud\Dialogflow\V2\FreeFormContext $var + * @return $this + */ + public function setFreeFormContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FreeFormContext::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @return \Google\Cloud\Dialogflow\V2\SummarizationContext|null + */ + public function getSummarizationContext() + { + return $this->readOneof(13); + } + + public function hasSummarizationContext() + { + return $this->hasOneof(13); + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @param \Google\Cloud\Dialogflow\V2\SummarizationContext $var + * @return $this + */ + public function setSummarizationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationContext::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\InferenceParameter|null + */ + public function getInferenceParameter() + { + return $this->inference_parameter; + } + + public function hasInferenceParameter() + { + return isset($this->inference_parameter); + } + + public function clearInferenceParameter() + { + unset($this->inference_parameter); + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\InferenceParameter $var + * @return $this + */ + public function setInferenceParameter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InferenceParameter::class); + $this->inference_parameter = $var; + + return $this; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTriggerEvent() + { + return $this->trigger_event; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTriggerEvent($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_event = $var; + + return $this; + } + + /** + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison@002`. + * + * Generated from protobuf field string published_model = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublishedModel() + { + return $this->readOneof(15); + } + + public function hasPublishedModel() + { + return $this->hasOneof(15); + } + + /** + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison@002`. + * + * Generated from protobuf field string published_model = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublishedModel($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getContext() + { + return $this->whichOneof("context"); + } + + /** + * @return string + */ + public function getFoundationModel() + { + return $this->whichOneof("foundation_model"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GeneratorSuggestion.php b/vendor/google/cloud-dialogflow/src/V2/GeneratorSuggestion.php new file mode 100644 index 0000000..2f2aa6c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GeneratorSuggestion.php @@ -0,0 +1,108 @@ +google.cloud.dialogflow.v2.GeneratorSuggestion + */ +class GeneratorSuggestion extends \Google\Protobuf\Internal\Message +{ + protected $suggestion; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\FreeFormSuggestion $free_form_suggestion + * Optional. Free form suggestion. + * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion $summary_suggestion + * Optional. Suggested summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Free form suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormSuggestion free_form_suggestion = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\FreeFormSuggestion|null + */ + public function getFreeFormSuggestion() + { + return $this->readOneof(1); + } + + public function hasFreeFormSuggestion() + { + return $this->hasOneof(1); + } + + /** + * Optional. Free form suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormSuggestion free_form_suggestion = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\FreeFormSuggestion $var + * @return $this + */ + public function setFreeFormSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FreeFormSuggestion::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SummarySuggestion|null + */ + public function getSummarySuggestion() + { + return $this->readOneof(2); + } + + public function hasSummarySuggestion() + { + return $this->hasOneof(2); + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion $var + * @return $this + */ + public function setSummarySuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarySuggestion::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSuggestion() + { + return $this->whichOneof("suggestion"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetAgentRequest.php new file mode 100644 index 0000000..44a4bc8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.GetAgentRequest + */ +class GetAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to fetch is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetContextRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetContextRequest.php new file mode 100644 index 0000000..a41566f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetContextRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.GetContextRequest + */ +class GetContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetContextRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetConversationDatasetRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetConversationDatasetRequest.php new file mode 100644 index 0000000..73859a7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetConversationDatasetRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationDatasetRequest + */ +class GetConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetConversationModelEvaluationRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetConversationModelEvaluationRequest.php new file mode 100644 index 0000000..0f8ebc8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetConversationModelEvaluationRequest.php @@ -0,0 +1,91 @@ +google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest + */ +class GetConversationModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationModelEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetConversationModelRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetConversationModelRequest.php new file mode 100644 index 0000000..675d2da --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetConversationModelRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetConversationModelRequest + */ +class GetConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetConversationProfileRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetConversationProfileRequest.php new file mode 100644 index 0000000..4670cd3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetConversationProfileRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationProfileRequest + */ +class GetConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetConversationRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetConversationRequest.php new file mode 100644 index 0000000..7046ac4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetConversationRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationRequest + */ +class GetConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the conversation. Format: + * `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetDocumentRequest.php new file mode 100644 index 0000000..283f734 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetDocumentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetDocumentRequest + */ +class GetDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetEncryptionSpecRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetEncryptionSpecRequest.php new file mode 100644 index 0000000..df230e6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetEncryptionSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.dialogflow.v2.GetEncryptionSpecRequest + */ +class GetEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the encryption spec resource to get. Please see + * {@see EncryptionSpecServiceClient::encryptionSpecName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetEncryptionSpecRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the encryption spec resource to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetEntityTypeRequest.php new file mode 100644 index 0000000..18edb8c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetEntityTypeRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.GetEntityTypeRequest + */ +class GetEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $name Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * @param string $name Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\GetEntityTypeRequest + * + * @experimental + */ + public static function buildFromNameLanguageCode(string $name, string $languageCode): self + { + return (new self()) + ->setName($name) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentHistoryRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentHistoryRequest.php new file mode 100644 index 0000000..8df0e18 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentHistoryRequest.php @@ -0,0 +1,160 @@ +google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest + */ +class GetEnvironmentHistoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentRequest.php new file mode 100644 index 0000000..286b2cd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetEnvironmentRequest.php @@ -0,0 +1,88 @@ +google.cloud.dialogflow.v2.GetEnvironmentRequest + */ +class GetEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetFulfillmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetFulfillmentRequest.php new file mode 100644 index 0000000..fa37a60 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetFulfillmentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.GetFulfillmentRequest + */ +class GetFulfillmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. Please see + * {@see FulfillmentsClient::fulfillmentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetFulfillmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetGeneratorRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetGeneratorRequest.php new file mode 100644 index 0000000..3109cc7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetGeneratorRequest + */ +class GetGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetIntentRequest.php new file mode 100644 index 0000000..6767222 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetIntentRequest.php @@ -0,0 +1,192 @@ +google.cloud.dialogflow.v2.GetIntentRequest + */ +class GetIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param string $name Required. The name of the intent. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetIntentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * @param string $name Required. The name of the intent. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\GetIntentRequest + * + * @experimental + */ + public static function buildFromNameLanguageCode(string $name, string $languageCode): self + { + return (new self()) + ->setName($name) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetKnowledgeBaseRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetKnowledgeBaseRequest.php new file mode 100644 index 0000000..94d7eda --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetKnowledgeBaseRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + */ +class GetKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetParticipantRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetParticipantRequest.php new file mode 100644 index 0000000..b9ab9c6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetParticipantRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetParticipantRequest + */ +class GetParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetParticipantRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetSessionEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetSessionEntityTypeRequest.php new file mode 100644 index 0000000..bcf3bf0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetSessionEntityTypeRequest.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.GetSessionEntityTypeRequest + */ +class GetSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetValidationResultRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetValidationResultRequest.php new file mode 100644 index 0000000..67ee298 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetValidationResultRequest.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.GetValidationResultRequest + */ +class GetValidationResultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent is associated with. + * Format: `projects/`. + * @type string $language_code + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/GetVersionRequest.php b/vendor/google/cloud-dialogflow/src/V2/GetVersionRequest.php new file mode 100644 index 0000000..19dad18 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/GetVersionRequest.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.GetVersionRequest + */ +class GetVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the version. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig.php new file mode 100644 index 0000000..3a0c766 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig.php @@ -0,0 +1,217 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig + */ +class HumanAgentAssistantConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + */ + protected $notification_config = null; + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + */ + protected $human_agent_suggestion_config = null; + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + */ + protected $end_user_suggestion_config = null; + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + */ + protected $message_analysis_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $notification_config + * Pub/Sub topic on which to publish new agent assistant events. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $human_agent_suggestion_config + * Configuration for agent assistance of human agent participant. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $end_user_suggestion_config + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig $message_analysis_config + * Configuration for message analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNotificationConfig() + { + return $this->notification_config; + } + + public function hasNotificationConfig() + { + return isset($this->notification_config); + } + + public function clearNotificationConfig() + { + unset($this->notification_config); + } + + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->notification_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig|null + */ + public function getHumanAgentSuggestionConfig() + { + return $this->human_agent_suggestion_config; + } + + public function hasHumanAgentSuggestionConfig() + { + return isset($this->human_agent_suggestion_config); + } + + public function clearHumanAgentSuggestionConfig() + { + unset($this->human_agent_suggestion_config); + } + + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $var + * @return $this + */ + public function setHumanAgentSuggestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig::class); + $this->human_agent_suggestion_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig|null + */ + public function getEndUserSuggestionConfig() + { + return $this->end_user_suggestion_config; + } + + public function hasEndUserSuggestionConfig() + { + return isset($this->end_user_suggestion_config); + } + + public function clearEndUserSuggestionConfig() + { + unset($this->end_user_suggestion_config); + } + + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $var + * @return $this + */ + public function setEndUserSuggestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig::class); + $this->end_user_suggestion_config = $var; + + return $this; + } + + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig|null + */ + public function getMessageAnalysisConfig() + { + return $this->message_analysis_config; + } + + public function hasMessageAnalysisConfig() + { + return isset($this->message_analysis_config); + } + + public function clearMessageAnalysisConfig() + { + unset($this->message_analysis_config); + } + + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig $var + * @return $this + */ + public function setMessageAnalysisConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig::class); + $this->message_analysis_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationModelConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationModelConfig.php new file mode 100644 index 0000000..f5f5ad8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationModelConfig.php @@ -0,0 +1,136 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + */ +class ConversationModelConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + */ + protected $model = ''; + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Conversation model resource name. Format: `projects//conversationModels/`. + * @type string $baseline_model_version + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * Summarization baseline model: + * - 1.0 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php new file mode 100644 index 0000000..34837b0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig + */ +class ConversationProcessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + */ + protected $recent_sentences_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $recent_sentences_count + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + * @return int + */ + public function getRecentSentencesCount() + { + return $this->recent_sentences_count; + } + + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + * @param int $var + * @return $this + */ + public function setRecentSentencesCount($var) + { + GPBUtil::checkInt32($var); + $this->recent_sentences_count = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php new file mode 100644 index 0000000..6effbb7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + */ +class MessageAnalysisConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + */ + protected $enable_entity_extraction = false; + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + */ + protected $enable_sentiment_analysis = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_entity_extraction + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type bool $enable_sentiment_analysis + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + * @return bool + */ + public function getEnableEntityExtraction() + { + return $this->enable_entity_extraction; + } + + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + * @param bool $var + * @return $this + */ + public function setEnableEntityExtraction($var) + { + GPBUtil::checkBool($var); + $this->enable_entity_extraction = $var; + + return $this; + } + + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + * @return bool + */ + public function getEnableSentimentAnalysis() + { + return $this->enable_sentiment_analysis; + } + + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + * @param bool $var + * @return $this + */ + public function setEnableSentimentAnalysis($var) + { + GPBUtil::checkBool($var); + $this->enable_sentiment_analysis = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionConfig.php new file mode 100644 index 0000000..35137a8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionConfig.php @@ -0,0 +1,234 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + */ +class SuggestionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + */ + private $feature_configs; + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + */ + protected $group_suggestion_responses = false; + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $generators; + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_high_latency_features_sync_delivery = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $feature_configs + * Configuration of different suggestion features. One feature can have only + * one config. + * @type bool $group_suggestion_responses + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * @type array|\Google\Protobuf\Internal\RepeatedField $generators + * Optional. List of various generator resource names used in the + * conversation profile. + * @type bool $disable_high_latency_features_sync_delivery + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeatureConfigs() + { + return $this->feature_configs; + } + + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + * @param array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeatureConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig::class); + $this->feature_configs = $arr; + + return $this; + } + + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + * @return bool + */ + public function getGroupSuggestionResponses() + { + return $this->group_suggestion_responses; + } + + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + * @param bool $var + * @return $this + */ + public function setGroupSuggestionResponses($var) + { + GPBUtil::checkBool($var); + $this->group_suggestion_responses = $var; + + return $this; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->generators = $arr; + + return $this; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableHighLatencyFeaturesSyncDelivery() + { + return $this->disable_high_latency_features_sync_delivery; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableHighLatencyFeaturesSyncDelivery($var) + { + GPBUtil::checkBool($var); + $this->disable_high_latency_features_sync_delivery = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php new file mode 100644 index 0000000..b710055 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php @@ -0,0 +1,464 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + */ +class SuggestionFeatureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + */ + protected $suggestion_feature = null; + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + */ + protected $enable_event_based_suggestion = false; + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_agent_query_logging = false; + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_when_no_answer = false; + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_conversation_augmented_query = false; + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_only = false; + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + */ + protected $suggestion_trigger_settings = null; + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + */ + protected $query_config = null; + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + */ + protected $conversation_model_config = null; + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + */ + protected $conversation_process_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SuggestionFeature $suggestion_feature + * The suggestion feature. + * @type bool $enable_event_based_suggestion + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * @type bool $disable_agent_query_logging + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_when_no_answer + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * @type bool $enable_conversation_augmented_query + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_only + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $suggestion_trigger_settings + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $query_config + * Configs of query. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $conversation_model_config + * Configs of custom conversation model. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $conversation_process_config + * Configs for processing conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @return \Google\Cloud\Dialogflow\V2\SuggestionFeature|null + */ + public function getSuggestionFeature() + { + return $this->suggestion_feature; + } + + public function hasSuggestionFeature() + { + return isset($this->suggestion_feature); + } + + public function clearSuggestionFeature() + { + unset($this->suggestion_feature); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @param \Google\Cloud\Dialogflow\V2\SuggestionFeature $var + * @return $this + */ + public function setSuggestionFeature($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature::class); + $this->suggestion_feature = $var; + + return $this; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @return bool + */ + public function getEnableEventBasedSuggestion() + { + return $this->enable_event_based_suggestion; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @param bool $var + * @return $this + */ + public function setEnableEventBasedSuggestion($var) + { + GPBUtil::checkBool($var); + $this->enable_event_based_suggestion = $var; + + return $this; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableAgentQueryLogging() + { + return $this->disable_agent_query_logging; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableAgentQueryLogging($var) + { + GPBUtil::checkBool($var); + $this->disable_agent_query_logging = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionWhenNoAnswer() + { + return $this->enable_query_suggestion_when_no_answer; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionWhenNoAnswer($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_when_no_answer = $var; + + return $this; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableConversationAugmentedQuery() + { + return $this->enable_conversation_augmented_query; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableConversationAugmentedQuery($var) + { + GPBUtil::checkBool($var); + $this->enable_conversation_augmented_query = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionOnly() + { + return $this->enable_query_suggestion_only; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionOnly($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_only = $var; + + return $this; + } + + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings|null + */ + public function getSuggestionTriggerSettings() + { + return $this->suggestion_trigger_settings; + } + + public function hasSuggestionTriggerSettings() + { + return isset($this->suggestion_trigger_settings); + } + + public function clearSuggestionTriggerSettings() + { + unset($this->suggestion_trigger_settings); + } + + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $var + * @return $this + */ + public function setSuggestionTriggerSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings::class); + $this->suggestion_trigger_settings = $var; + + return $this; + } + + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig|null + */ + public function getQueryConfig() + { + return $this->query_config; + } + + public function hasQueryConfig() + { + return isset($this->query_config); + } + + public function clearQueryConfig() + { + unset($this->query_config); + } + + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $var + * @return $this + */ + public function setQueryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig::class); + $this->query_config = $var; + + return $this; + } + + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig|null + */ + public function getConversationModelConfig() + { + return $this->conversation_model_config; + } + + public function hasConversationModelConfig() + { + return isset($this->conversation_model_config); + } + + public function clearConversationModelConfig() + { + unset($this->conversation_model_config); + } + + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $var + * @return $this + */ + public function setConversationModelConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig::class); + $this->conversation_model_config = $var; + + return $this; + } + + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig|null + */ + public function getConversationProcessConfig() + { + return $this->conversation_process_config; + } + + public function hasConversationProcessConfig() + { + return isset($this->conversation_process_config); + } + + public function clearConversationProcessConfig() + { + unset($this->conversation_process_config); + } + + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $var + * @return $this + */ + public function setConversationProcessConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig::class); + $this->conversation_process_config = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php new file mode 100644 index 0000000..02e9b2b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php @@ -0,0 +1,410 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + */ +class SuggestionQueryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + */ + protected $max_results = 0; + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + */ + protected $confidence_threshold = 0.0; + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + */ + protected $context_filter_settings = null; + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sections = null; + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + protected $query_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $knowledge_base_query_source + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $document_query_source + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $dialogflow_query_source + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * @type int $max_results + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * @type float $confidence_threshold + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $context_filter_settings + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $sections + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * @type int $context_size + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource|null + */ + public function getKnowledgeBaseQuerySource() + { + return $this->readOneof(1); + } + + public function hasKnowledgeBaseQuerySource() + { + return $this->hasOneof(1); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $var + * @return $this + */ + public function setKnowledgeBaseQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource|null + */ + public function getDocumentQuerySource() + { + return $this->readOneof(2); + } + + public function hasDocumentQuerySource() + { + return $this->hasOneof(2); + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $var + * @return $this + */ + public function setDocumentQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource|null + */ + public function getDialogflowQuerySource() + { + return $this->readOneof(3); + } + + public function hasDialogflowQuerySource() + { + return $this->hasOneof(3); + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $var + * @return $this + */ + public function setDialogflowQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @return int + */ + public function getMaxResults() + { + return $this->max_results; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @param int $var + * @return $this + */ + public function setMaxResults($var) + { + GPBUtil::checkInt32($var); + $this->max_results = $var; + + return $this; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings|null + */ + public function getContextFilterSettings() + { + return $this->context_filter_settings; + } + + public function hasContextFilterSettings() + { + return isset($this->context_filter_settings); + } + + public function clearContextFilterSettings() + { + unset($this->context_filter_settings); + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $var + * @return $this + */ + public function setContextFilterSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings::class); + $this->context_filter_settings = $var; + + return $this; + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections|null + */ + public function getSections() + { + return $this->sections; + } + + public function hasSections() + { + return isset($this->sections); + } + + public function clearSections() + { + unset($this->sections); + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $var + * @return $this + */ + public function setSections($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections::class); + $this->sections = $var; + + return $this; + } + + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * @return string + */ + public function getQuerySource() + { + return $this->whichOneof("query_source"); + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php new file mode 100644 index 0000000..a34da89 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + */ +class ContextFilterSettings extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + */ + protected $drop_handoff_messages = false; + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + */ + protected $drop_virtual_agent_messages = false; + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + */ + protected $drop_ivr_messages = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $drop_handoff_messages + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * @type bool $drop_virtual_agent_messages + * If set to true, all messages from virtual agent are dropped. + * @type bool $drop_ivr_messages + * If set to true, all messages from ivr stage are dropped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + * @return bool + */ + public function getDropHandoffMessages() + { + return $this->drop_handoff_messages; + } + + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + * @param bool $var + * @return $this + */ + public function setDropHandoffMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_handoff_messages = $var; + + return $this; + } + + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + * @return bool + */ + public function getDropVirtualAgentMessages() + { + return $this->drop_virtual_agent_messages; + } + + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + * @param bool $var + * @return $this + */ + public function setDropVirtualAgentMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_virtual_agent_messages = $var; + + return $this; + } + + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + * @return bool + */ + public function getDropIvrMessages() + { + return $this->drop_ivr_messages; + } + + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + * @param bool $var + * @return $this + */ + public function setDropIvrMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_ivr_messages = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php new file mode 100644 index 0000000..80eef85 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php @@ -0,0 +1,125 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + */ +class DialogflowQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $human_agent_side_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $human_agent_side_config + * Optional. The Dialogflow assist configuration for human agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig|null + */ + public function getHumanAgentSideConfig() + { + return $this->human_agent_side_config; + } + + public function hasHumanAgentSideConfig() + { + return isset($this->human_agent_side_config); + } + + public function clearHumanAgentSideConfig() + { + unset($this->human_agent_side_config); + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $var + * @return $this + */ + public function setHumanAgentSideConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig::class); + $this->human_agent_side_config = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php new file mode 100644 index 0000000..9ba40ab --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig + */ +class HumanAgentSideConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php new file mode 100644 index 0000000..9de540b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php @@ -0,0 +1,81 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + */ +class DocumentQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $documents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $documents + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php new file mode 100644 index 0000000..20e3bb4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php @@ -0,0 +1,81 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + */ +class KnowledgeBaseQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $knowledge_bases; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $knowledge_bases + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKnowledgeBases() + { + return $this->knowledge_bases; + } + + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKnowledgeBases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->knowledge_bases = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php new file mode 100644 index 0000000..6259164 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections + */ +class Sections extends \Google\Protobuf\Internal\Message +{ + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + */ + private $section_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $section_types + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSectionTypes() + { + return $this->section_types; + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSectionTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections\SectionType::class); + $this->section_types = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php new file mode 100644 index 0000000..ee81bee --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType + */ +class SectionType +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum SECTION_TYPE_UNSPECIFIED = 0; + */ + const SECTION_TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + + private static $valueToName = [ + self::SECTION_TYPE_UNSPECIFIED => 'SECTION_TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php new file mode 100644 index 0000000..21332d6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + */ +class SuggestionTriggerSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + */ + protected $no_smalltalk = false; + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + */ + protected $only_end_user = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $no_smalltalk + * Do not trigger if last utterance is small talk. + * @type bool $only_end_user + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + * @return bool + */ + public function getNoSmalltalk() + { + return $this->no_smalltalk; + } + + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + * @param bool $var + * @return $this + */ + public function setNoSmalltalk($var) + { + GPBUtil::checkBool($var); + $this->no_smalltalk = $var; + + return $this; + } + + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + * @return bool + */ + public function getOnlyEndUser() + { + return $this->only_end_user; + } + + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + * @param bool $var + * @return $this + */ + public function setOnlyEndUser($var) + { + GPBUtil::checkBool($var); + $this->only_end_user = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantEvent.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantEvent.php new file mode 100644 index 0000000..61331a7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentAssistantEvent.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantEvent + */ +class HumanAgentAssistantEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + */ + protected $conversation = ''; + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + */ + protected $participant = ''; + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + */ + private $suggestion_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * @type string $participant + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * @type array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $suggestion_results + * The suggestion results payload that this notification refers to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\HumanAgentAssistantEvent::initOnce(); + parent::__construct($data); + } + + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestionResults() + { + return $this->suggestion_results; + } + + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + * @param array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->suggestion_results = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig.php new file mode 100644 index 0000000..643f358 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig + */ +class HumanAgentHandoffConfig extends \Google\Protobuf\Internal\Message +{ + protected $agent_service; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig $live_person_config + * Uses [LivePerson](https://www.liveperson.com). + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig $salesforce_live_agent_config + * Uses Salesforce Live Agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Uses [LivePerson](https://www.liveperson.com). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig live_person_config = 1; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig|null + */ + public function getLivePersonConfig() + { + return $this->readOneof(1); + } + + public function hasLivePersonConfig() + { + return $this->hasOneof(1); + } + + /** + * Uses [LivePerson](https://www.liveperson.com). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig live_person_config = 1; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig $var + * @return $this + */ + public function setLivePersonConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Uses Salesforce Live Agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig|null + */ + public function getSalesforceLiveAgentConfig() + { + return $this->readOneof(2); + } + + public function hasSalesforceLiveAgentConfig() + { + return $this->hasOneof(2); + } + + /** + * Uses Salesforce Live Agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig $var + * @return $this + */ + public function setSalesforceLiveAgentConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgentService() + { + return $this->whichOneof("agent_service"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/LivePersonConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/LivePersonConfig.php new file mode 100644 index 0000000..ebff67d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/LivePersonConfig.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig + */ +class LivePersonConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account_number = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $account_number + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccountNumber() + { + return $this->account_number; + } + + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccountNumber($var) + { + GPBUtil::checkString($var, True); + $this->account_number = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php new file mode 100644 index 0000000..6e130be --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php @@ -0,0 +1,182 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + */ +class SalesforceLiveAgentConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization_id = ''; + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deployment_id = ''; + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $button_id = ''; + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_domain = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization_id + * Required. The organization ID of the Salesforce account. + * @type string $deployment_id + * Required. Live Agent deployment ID. + * @type string $button_id + * Required. Live Agent chat button ID. + * @type string $endpoint_domain + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOrganizationId() + { + return $this->organization_id; + } + + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOrganizationId($var) + { + GPBUtil::checkString($var, True); + $this->organization_id = $var; + + return $this; + } + + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeploymentId() + { + return $this->deployment_id; + } + + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeploymentId($var) + { + GPBUtil::checkString($var, True); + $this->deployment_id = $var; + + return $this; + } + + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getButtonId() + { + return $this->button_id; + } + + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setButtonId($var) + { + GPBUtil::checkString($var, True); + $this->button_id = $var; + + return $this; + } + + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEndpointDomain() + { + return $this->endpoint_domain; + } + + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEndpointDomain($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_domain = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/ImportAgentRequest.php new file mode 100644 index 0000000..6c0b27e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportAgentRequest.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.ImportAgentRequest + */ +class ImportAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * @type string $agent_uri + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(2); + } + + public function hasAgentUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(3); + } + + public function hasAgentContent() + { + return $this->hasOneof(3); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationMetadata.php new file mode 100644 index 0000000..fd0fdee --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationMetadata.php @@ -0,0 +1,163 @@ +google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata + */ +class ImportConversationDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + */ + private $partial_failures; + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_failures + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialFailures() + { + return $this->partial_failures; + } + + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialFailures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_failures = $arr; + + return $this; + } + + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationResponse.php b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationResponse.php new file mode 100644 index 0000000..9e946c0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataOperationResponse.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.ImportConversationDataOperationResponse + */ +class ImportConversationDataOperationResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + */ + protected $import_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * @type int $import_count + * Number of conversations imported successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + * @return int + */ + public function getImportCount() + { + return $this->import_count; + } + + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + * @param int $var + * @return $this + */ + public function setImportCount($var) + { + GPBUtil::checkInt32($var); + $this->import_count = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataRequest.php b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataRequest.php new file mode 100644 index 0000000..4dbfc91 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportConversationDataRequest.php @@ -0,0 +1,120 @@ +google.cloud.dialogflow.v2.ImportConversationDataRequest + */ +class ImportConversationDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config + * Required. Configuration describing where to import data from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); + $this->input_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportDocumentTemplate.php b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentTemplate.php new file mode 100644 index 0000000..674d014 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentTemplate.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.ImportDocumentTemplate + */ +class ImportDocumentTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mime_type = ''; + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $knowledge_types; + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mime_type + * Required. The MIME type of the document. + * @type array|\Google\Protobuf\Internal\RepeatedField $knowledge_types + * Required. The knowledge type of document content. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKnowledgeTypes() + { + return $this->knowledge_types; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKnowledgeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Document\KnowledgeType::class); + $this->knowledge_types = $arr; + + return $this; + } + + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsRequest.php new file mode 100644 index 0000000..a0ead26 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsRequest.php @@ -0,0 +1,212 @@ +google.cloud.dialogflow.v2.ImportDocumentsRequest + */ +class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document_template = null; + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + */ + protected $import_gcs_custom_metadata = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * @type \Google\Cloud\Dialogflow\V2\GcsSources $gcs_source + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * @type \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate $document_template + * Required. Document template used for importing all the documents. + * @type bool $import_gcs_custom_metadata + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\GcsSources|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\GcsSources $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsSources::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate|null + */ + public function getDocumentTemplate() + { + return $this->document_template; + } + + public function hasDocumentTemplate() + { + return isset($this->document_template); + } + + public function clearDocumentTemplate() + { + unset($this->document_template); + } + + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate $var + * @return $this + */ + public function setDocumentTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate::class); + $this->document_template = $var; + + return $this; + } + + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + * @return bool + */ + public function getImportGcsCustomMetadata() + { + return $this->import_gcs_custom_metadata; + } + + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + * @param bool $var + * @return $this + */ + public function setImportGcsCustomMetadata($var) + { + GPBUtil::checkBool($var); + $this->import_gcs_custom_metadata = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsResponse.php new file mode 100644 index 0000000..98f7b7a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ImportDocumentsResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.ImportDocumentsResponse + */ +class ImportDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $warnings + * Includes details about skipped documents or any other warnings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InferenceParameter.php b/vendor/google/cloud-dialogflow/src/V2/InferenceParameter.php new file mode 100644 index 0000000..20c1554 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InferenceParameter.php @@ -0,0 +1,277 @@ +google.cloud.dialogflow.v2.InferenceParameter + */ +class InferenceParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_output_tokens = null; + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $temperature = null; + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_k = null; + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_p = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_output_tokens + * Optional. Maximum number of the output tokens for the generator. + * @type float $temperature + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * @type int $top_k + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * @type float $top_p + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxOutputTokens() + { + return isset($this->max_output_tokens) ? $this->max_output_tokens : 0; + } + + public function hasMaxOutputTokens() + { + return isset($this->max_output_tokens); + } + + public function clearMaxOutputTokens() + { + unset($this->max_output_tokens); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxOutputTokens($var) + { + GPBUtil::checkInt32($var); + $this->max_output_tokens = $var; + + return $this; + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTemperature() + { + return isset($this->temperature) ? $this->temperature : 0.0; + } + + public function hasTemperature() + { + return isset($this->temperature); + } + + public function clearTemperature() + { + unset($this->temperature); + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTemperature($var) + { + GPBUtil::checkDouble($var); + $this->temperature = $var; + + return $this; + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTopK() + { + return isset($this->top_k) ? $this->top_k : 0; + } + + public function hasTopK() + { + return isset($this->top_k); + } + + public function clearTopK() + { + unset($this->top_k); + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTopK($var) + { + GPBUtil::checkInt32($var); + $this->top_k = $var; + + return $this; + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTopP() + { + return isset($this->top_p) ? $this->top_p : 0.0; + } + + public function hasTopP() + { + return isset($this->top_p); + } + + public function clearTopP() + { + unset($this->top_p); + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTopP($var) + { + GPBUtil::checkDouble($var); + $this->top_p = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesRequest.php b/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesRequest.php new file mode 100644 index 0000000..d9dd367 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesRequest.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.IngestContextReferencesRequest + */ +class IngestContextReferencesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $context_references; + + /** + * @param string $conversation Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * @param array $contextReferences Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * @return \Google\Cloud\Dialogflow\V2\IngestContextReferencesRequest + * + * @experimental + */ + public static function build(string $conversation, array $contextReferences): self + { + return (new self()) + ->setConversation($conversation) + ->setContextReferences($contextReferences); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * @type array|\Google\Protobuf\Internal\MapField $context_references + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getContextReferences() + { + return $this->context_references; + } + + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->context_references = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesResponse.php b/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesResponse.php new file mode 100644 index 0000000..646c3a2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/IngestContextReferencesResponse.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.IngestContextReferencesResponse + */ +class IngestContextReferencesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + */ + private $ingested_context_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $ingested_context_references + * All context references ingested. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getIngestedContextReferences() + { + return $this->ingested_context_references; + } + + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setIngestedContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->ingested_context_references = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecMetadata.php b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecMetadata.php new file mode 100644 index 0000000..388d113 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata + */ +class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $request + * Output only. The original request for initialization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest::class); + $this->request = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecRequest.php b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecRequest.php new file mode 100644 index 0000000..f639eea --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecRequest.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest + */ +class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $encryption_spec = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec): self + { + return (new self()) + ->setEncryptionSpec($encryptionSpec); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryption_spec + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecResponse.php b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecResponse.php new file mode 100644 index 0000000..c4ba7c5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InitializeEncryptionSpecResponse.php @@ -0,0 +1,33 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse + */ +class InitializeEncryptionSpecResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InputAudioConfig.php b/vendor/google/cloud-dialogflow/src/V2/InputAudioConfig.php new file mode 100644 index 0000000..5e77d67 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InputAudioConfig.php @@ -0,0 +1,652 @@ +google.cloud.dialogflow.v2.InputAudioConfig + */ +class InputAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sample_rate_hertz = 0; + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + */ + protected $enable_word_info = false; + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @deprecated + */ + private $phrase_hints; + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + */ + private $speech_contexts; + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + */ + protected $model = ''; + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + */ + protected $model_variant = 0; + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + */ + protected $single_utterance = false; + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + */ + protected $disable_no_speech_recognized_event = false; + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + */ + protected $enable_automatic_punctuation = false; + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + */ + private $phrase_sets; + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + */ + protected $opt_out_conformer_model_migration = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * @type bool $enable_word_info + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * @type array|\Google\Protobuf\Internal\RepeatedField $phrase_hints + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * @type array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $speech_contexts + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * @type string $model + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * @type int $model_variant + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * @type bool $single_utterance + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * @type bool $disable_no_speech_recognized_event + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * @type bool $enable_automatic_punctuation + * Enable automatic punctuation option at the speech backend. + * @type array|\Google\Protobuf\Internal\RepeatedField $phrase_sets + * A collection of phrase set resources to use for speech adaptation. + * @type bool $opt_out_conformer_model_migration + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getPhraseHints() + { + if ($this->phrase_hints->count() !== 0) { + @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); + } + return $this->phrase_hints; + } + + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setPhraseHints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + if (count($arr) !== 0) { + @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); + } + $this->phrase_hints = $arr; + + return $this; + } + + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechContexts() + { + return $this->speech_contexts; + } + + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + * @param array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SpeechContext::class); + $this->speech_contexts = $arr; + + return $this; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @return int + */ + public function getModelVariant() + { + return $this->model_variant; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @param int $var + * @return $this + */ + public function setModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->model_variant = $var; + + return $this; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @return bool + */ + public function getDisableNoSpeechRecognizedEvent() + { + return $this->disable_no_speech_recognized_event; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @param bool $var + * @return $this + */ + public function setDisableNoSpeechRecognizedEvent($var) + { + GPBUtil::checkBool($var); + $this->disable_no_speech_recognized_event = $var; + + return $this; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @return bool + */ + public function getEnableAutomaticPunctuation() + { + return $this->enable_automatic_punctuation; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticPunctuation($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_punctuation = $var; + + return $this; + } + + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPhraseSets() + { + return $this->phrase_sets; + } + + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPhraseSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrase_sets = $arr; + + return $this; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @return bool + */ + public function getOptOutConformerModelMigration() + { + return $this->opt_out_conformer_model_migration; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @param bool $var + * @return $this + */ + public function setOptOutConformerModelMigration($var) + { + GPBUtil::checkBool($var); + $this->opt_out_conformer_model_migration = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InputConfig.php b/vendor/google/cloud-dialogflow/src/V2/InputConfig.php new file mode 100644 index 0000000..eb1a430 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InputConfig.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GcsSources $gcs_source + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 1; + * @return \Google\Cloud\Dialogflow\V2\GcsSources|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 1; + * @param \Google\Cloud\Dialogflow\V2\GcsSources $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsSources::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InputDataset.php b/vendor/google/cloud-dialogflow/src/V2/InputDataset.php new file mode 100644 index 0000000..28917cd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InputDataset.php @@ -0,0 +1,76 @@ +google.cloud.dialogflow.v2.InputDataset + */ +class InputDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/InputTextConfig.php b/vendor/google/cloud-dialogflow/src/V2/InputTextConfig.php new file mode 100644 index 0000000..13adbca --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/InputTextConfig.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.InputTextConfig + */ +class InputTextConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent.php b/vendor/google/cloud-dialogflow/src/V2/Intent.php new file mode 100644 index 0000000..2fdd458 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent.php @@ -0,0 +1,904 @@ +google.cloud.dialogflow.v2.Intent + */ +class Intent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $webhook_state = 0; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $priority = 0; + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $is_fallback = false; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ml_disabled = false; + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $live_agent_handoff = false; + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_interaction = false; + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $input_context_names; + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $events; + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $training_phrases; + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $action = ''; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $output_contexts; + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reset_contexts = false; + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parameters; + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $messages; + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $default_response_platforms; + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $root_followup_intent_name = ''; + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + */ + protected $parent_followup_intent_name = ''; + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $followup_intent_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * @type string $display_name + * Required. The name of this intent. + * @type int $webhook_state + * Optional. Indicates whether webhooks are enabled for the intent. + * @type int $priority + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * @type bool $is_fallback + * Optional. Indicates whether this is a fallback intent. + * @type bool $ml_disabled + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * @type bool $live_agent_handoff + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * @type bool $end_interaction + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * @type array|\Google\Protobuf\Internal\RepeatedField $input_context_names + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $events + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $training_phrases + * Optional. The collection of examples that the agent is + * trained on. + * @type string $action + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * @type array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $output_contexts + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * @type bool $reset_contexts + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * Optional. The collection of parameters associated with the intent. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * @type array|\Google\Protobuf\Internal\RepeatedField $default_response_platforms + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * @type string $root_followup_intent_name + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * @type string $parent_followup_intent_name + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $followup_intent_info + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWebhookState() + { + return $this->webhook_state; + } + + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWebhookState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\WebhookState::class); + $this->webhook_state = $var; + + return $this; + } + + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPriority() + { + return $this->priority; + } + + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsFallback() + { + return $this->is_fallback; + } + + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsFallback($var) + { + GPBUtil::checkBool($var); + $this->is_fallback = $var; + + return $this; + } + + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMlDisabled() + { + return $this->ml_disabled; + } + + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMlDisabled($var) + { + GPBUtil::checkBool($var); + $this->ml_disabled = $var; + + return $this; + } + + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getLiveAgentHandoff() + { + return $this->live_agent_handoff; + } + + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setLiveAgentHandoff($var) + { + GPBUtil::checkBool($var); + $this->live_agent_handoff = $var; + + return $this; + } + + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEndInteraction() + { + return $this->end_interaction; + } + + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEndInteraction($var) + { + GPBUtil::checkBool($var); + $this->end_interaction = $var; + + return $this; + } + + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInputContextNames() + { + return $this->input_context_names; + } + + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInputContextNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_context_names = $arr; + + return $this; + } + + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEvents() + { + return $this->events; + } + + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->events = $arr; + + return $this; + } + + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrainingPhrases() + { + return $this->training_phrases; + } + + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrainingPhrases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase::class); + $this->training_phrases = $arr; + + return $this; + } + + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getResetContexts() + { + return $this->reset_contexts; + } + + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setResetContexts($var) + { + GPBUtil::checkBool($var); + $this->reset_contexts = $var; + + return $this; + } + + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Parameter::class); + $this->parameters = $arr; + + return $this; + } + + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDefaultResponsePlatforms() + { + return $this->default_response_platforms; + } + + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDefaultResponsePlatforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Intent\Message\Platform::class); + $this->default_response_platforms = $arr; + + return $this; + } + + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRootFollowupIntentName() + { + return $this->root_followup_intent_name; + } + + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRootFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->root_followup_intent_name = $var; + + return $this; + } + + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + * @return string + */ + public function getParentFollowupIntentName() + { + return $this->parent_followup_intent_name; + } + + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + * @param string $var + * @return $this + */ + public function setParentFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->parent_followup_intent_name = $var; + + return $this; + } + + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFollowupIntentInfo() + { + return $this->followup_intent_info; + } + + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFollowupIntentInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo::class); + $this->followup_intent_info = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/FollowupIntentInfo.php b/vendor/google/cloud-dialogflow/src/V2/Intent/FollowupIntentInfo.php new file mode 100644 index 0000000..22defb9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/FollowupIntentInfo.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + */ +class FollowupIntentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + */ + protected $followup_intent_name = ''; + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + */ + protected $parent_followup_intent_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $followup_intent_name + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * @type string $parent_followup_intent_name + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + * @return string + */ + public function getFollowupIntentName() + { + return $this->followup_intent_name; + } + + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + * @param string $var + * @return $this + */ + public function setFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->followup_intent_name = $var; + + return $this; + } + + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + * @return string + */ + public function getParentFollowupIntentName() + { + return $this->parent_followup_intent_name; + } + + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + * @param string $var + * @return $this + */ + public function setParentFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->parent_followup_intent_name = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message.php new file mode 100644 index 0000000..de77ccf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message.php @@ -0,0 +1,543 @@ +google.cloud.dialogflow.v2.Intent.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $platform = 0; + protected $message; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Text $text + * The text response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * The image response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies $quick_replies + * The quick replies response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Card $card + * The card response. + * @type \Google\Protobuf\Struct $payload + * A custom platform-specific response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses $simple_responses + * The voice and text-only responses for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard $basic_card + * The basic card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions $suggestions + * The suggestion chips for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion $link_out_suggestion + * The link out suggestion chip for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect $list_select + * The list card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect $carousel_select + * The carousel card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard $browse_carousel_card + * Browse carousel card for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard $table_card + * Table card for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent $media_content + * The media content card for Actions on Google. + * @type int $platform + * Optional. The platform that this message is intended for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The text response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Text text = 1; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Text|null + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The text response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Text text = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Text $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Text::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The image response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 2; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->readOneof(2); + } + + public function hasImage() + { + return $this->hasOneof(2); + } + + /** + * The image response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 2; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The quick replies response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.QuickReplies quick_replies = 3; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies|null + */ + public function getQuickReplies() + { + return $this->readOneof(3); + } + + public function hasQuickReplies() + { + return $this->hasOneof(3); + } + + /** + * The quick replies response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.QuickReplies quick_replies = 3; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies $var + * @return $this + */ + public function setQuickReplies($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The card response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Card card = 4; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Card|null + */ + public function getCard() + { + return $this->readOneof(4); + } + + public function hasCard() + { + return $this->hasOneof(4); + } + + /** + * The card response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Card card = 4; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Card $var + * @return $this + */ + public function setCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Card::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A custom platform-specific response. + * + * Generated from protobuf field .google.protobuf.Struct payload = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->readOneof(5); + } + + public function hasPayload() + { + return $this->hasOneof(5); + } + + /** + * A custom platform-specific response. + * + * Generated from protobuf field .google.protobuf.Struct payload = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The voice and text-only responses for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SimpleResponses simple_responses = 7; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses|null + */ + public function getSimpleResponses() + { + return $this->readOneof(7); + } + + public function hasSimpleResponses() + { + return $this->hasOneof(7); + } + + /** + * The voice and text-only responses for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SimpleResponses simple_responses = 7; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses $var + * @return $this + */ + public function setSimpleResponses($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The basic card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard basic_card = 8; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard|null + */ + public function getBasicCard() + { + return $this->readOneof(8); + } + + public function hasBasicCard() + { + return $this->hasOneof(8); + } + + /** + * The basic card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard basic_card = 8; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard $var + * @return $this + */ + public function setBasicCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The suggestion chips for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Suggestions suggestions = 9; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions|null + */ + public function getSuggestions() + { + return $this->readOneof(9); + } + + public function hasSuggestions() + { + return $this->hasOneof(9); + } + + /** + * The suggestion chips for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Suggestions suggestions = 9; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions $var + * @return $this + */ + public function setSuggestions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * The link out suggestion chip for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion link_out_suggestion = 10; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion|null + */ + public function getLinkOutSuggestion() + { + return $this->readOneof(10); + } + + public function hasLinkOutSuggestion() + { + return $this->hasOneof(10); + } + + /** + * The link out suggestion chip for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion link_out_suggestion = 10; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion $var + * @return $this + */ + public function setLinkOutSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * The list card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ListSelect list_select = 11; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect|null + */ + public function getListSelect() + { + return $this->readOneof(11); + } + + public function hasListSelect() + { + return $this->hasOneof(11); + } + + /** + * The list card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ListSelect list_select = 11; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect $var + * @return $this + */ + public function setListSelect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The carousel card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect carousel_select = 12; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect|null + */ + public function getCarouselSelect() + { + return $this->readOneof(12); + } + + public function hasCarouselSelect() + { + return $this->hasOneof(12); + } + + /** + * The carousel card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect carousel_select = 12; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect $var + * @return $this + */ + public function setCarouselSelect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Browse carousel card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard browse_carousel_card = 22; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard|null + */ + public function getBrowseCarouselCard() + { + return $this->readOneof(22); + } + + public function hasBrowseCarouselCard() + { + return $this->hasOneof(22); + } + + /** + * Browse carousel card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard browse_carousel_card = 22; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard $var + * @return $this + */ + public function setBrowseCarouselCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Table card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.TableCard table_card = 23; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard|null + */ + public function getTableCard() + { + return $this->readOneof(23); + } + + public function hasTableCard() + { + return $this->hasOneof(23); + } + + /** + * Table card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.TableCard table_card = 23; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard $var + * @return $this + */ + public function setTableCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * The media content card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent media_content = 24; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent|null + */ + public function getMediaContent() + { + return $this->readOneof(24); + } + + public function hasMediaContent() + { + return $this->hasOneof(24); + } + + /** + * The media content card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent media_content = 24; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent $var + * @return $this + */ + public function setMediaContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Platform::class); + $this->platform = $var; + + return $this; + } + + /** + * @return string + */ + public function getMessage() + { + return $this->whichOneof("message"); + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard.php new file mode 100644 index 0000000..34071e4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard.php @@ -0,0 +1,214 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard + */ +class BasicCard extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + */ + protected $formatted_text = ''; + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the card. + * @type string $subtitle + * Optional. The subtitle of the card. + * @type string $formatted_text + * Required, unless image is present. The body text of the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image for the card. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $buttons + * Optional. The collection of card buttons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + * @return string + */ + public function getFormattedText() + { + return $this->formatted_text; + } + + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + * @param string $var + * @return $this + */ + public function setFormattedText($var) + { + GPBUtil::checkString($var, True); + $this->formatted_text = $var; + + return $this; + } + + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button.php new file mode 100644 index 0000000..ce96de4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $open_uri_action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. The title of the button. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction $open_uri_action + * Required. Action to take when a user taps on the button. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction|null + */ + public function getOpenUriAction() + { + return $this->open_uri_action; + } + + public function hasOpenUriAction() + { + return isset($this->open_uri_action); + } + + public function clearOpenUriAction() + { + unset($this->open_uri_action); + } + + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction $var + * @return $this + */ + public function setOpenUriAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction::class); + $this->open_uri_action = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button/OpenUriAction.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button/OpenUriAction.php new file mode 100644 index 0000000..1783254 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BasicCard/Button/OpenUriAction.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + */ +class OpenUriAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The HTTP or HTTPS scheme URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard.php new file mode 100644 index 0000000..0e4422a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + */ +class BrowseCarouselCard extends \Google\Protobuf\Internal\Message +{ + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + */ + private $items; + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_display_options = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $items + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * @type int $image_display_options + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem::class); + $this->items = $arr; + + return $this; + } + + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getImageDisplayOptions() + { + return $this->image_display_options; + } + + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setImageDisplayOptions($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\ImageDisplayOptions::class); + $this->image_display_options = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php new file mode 100644 index 0000000..5e885fb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + */ +class BrowseCarouselCardItem extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + */ + protected $open_uri_action = null; + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $footer = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction $open_uri_action + * Required. Action to present to the user. + * @type string $title + * Required. Title of the carousel item. Maximum of two lines of text. + * @type string $description + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. Hero image for the carousel item. + * @type string $footer + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction|null + */ + public function getOpenUriAction() + { + return $this->open_uri_action; + } + + public function hasOpenUriAction() + { + return isset($this->open_uri_action); + } + + public function clearOpenUriAction() + { + unset($this->open_uri_action); + } + + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction $var + * @return $this + */ + public function setOpenUriAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction::class); + $this->open_uri_action = $var; + + return $this; + } + + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFooter() + { + return $this->footer; + } + + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFooter($var) + { + GPBUtil::checkString($var, True); + $this->footer = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php new file mode 100644 index 0000000..980ce4e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + */ +class OpenUrlAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + */ + protected $url = ''; + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $url_type_hint = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Required. URL + * @type int $url_type_hint + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getUrlTypeHint() + { + return $this->url_type_hint; + } + + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setUrlTypeHint($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction\UrlTypeHint::class); + $this->url_type_hint = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php new file mode 100644 index 0000000..582b623 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php @@ -0,0 +1,63 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint + */ +class UrlTypeHint +{ + /** + * Unspecified + * + * Generated from protobuf enum URL_TYPE_HINT_UNSPECIFIED = 0; + */ + const URL_TYPE_HINT_UNSPECIFIED = 0; + /** + * Url would be an amp action + * + * Generated from protobuf enum AMP_ACTION = 1; + */ + const AMP_ACTION = 1; + /** + * URL that points directly to AMP content, or to a canonical URL + * which refers to AMP content via . + * + * Generated from protobuf enum AMP_CONTENT = 2; + */ + const AMP_CONTENT = 2; + + private static $valueToName = [ + self::URL_TYPE_HINT_UNSPECIFIED => 'URL_TYPE_HINT_UNSPECIFIED', + self::AMP_ACTION => 'AMP_ACTION', + self::AMP_CONTENT => 'AMP_CONTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php new file mode 100644 index 0000000..4537c64 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions + */ +class ImageDisplayOptions +{ + /** + * Fill the gaps between the image and the image container with gray + * bars. + * + * Generated from protobuf enum IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0; + */ + const IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0; + /** + * Fill the gaps between the image and the image container with gray + * bars. + * + * Generated from protobuf enum GRAY = 1; + */ + const GRAY = 1; + /** + * Fill the gaps between the image and the image container with white + * bars. + * + * Generated from protobuf enum WHITE = 2; + */ + const WHITE = 2; + /** + * Image is scaled such that the image width and height match or exceed + * the container dimensions. This may crop the top and bottom of the + * image if the scaled image height is greater than the container + * height, or crop the left and right of the image if the scaled image + * width is greater than the container width. This is similar to "Zoom + * Mode" on a widescreen TV when playing a 4:3 video. + * + * Generated from protobuf enum CROPPED = 3; + */ + const CROPPED = 3; + /** + * Pad the gaps between image and image frame with a blurred copy of the + * same image. + * + * Generated from protobuf enum BLURRED_BACKGROUND = 4; + */ + const BLURRED_BACKGROUND = 4; + + private static $valueToName = [ + self::IMAGE_DISPLAY_OPTIONS_UNSPECIFIED => 'IMAGE_DISPLAY_OPTIONS_UNSPECIFIED', + self::GRAY => 'GRAY', + self::WHITE => 'WHITE', + self::CROPPED => 'CROPPED', + self::BLURRED_BACKGROUND => 'BLURRED_BACKGROUND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card.php new file mode 100644 index 0000000..74c1e50 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.Intent.Message.Card + */ +class Card extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_uri = ''; + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the card. + * @type string $subtitle + * Optional. The subtitle of the card. + * @type string $image_uri + * Optional. The public URI to an image file for the card. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $buttons + * Optional. The collection of card buttons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card/Button.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card/Button.php new file mode 100644 index 0000000..6f5b404 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Card/Button.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.Intent.Message.Card.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $postback = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Optional. The text to show on the button. + * @type string $postback + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPostback() + { + return $this->postback; + } + + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPostback($var) + { + GPBUtil::checkString($var, True); + $this->postback = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect.php new file mode 100644 index 0000000..e38307d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + */ +class CarouselSelect extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $items + * Required. Carousel items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item::class); + $this->items = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect/Item.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect/Item.php new file mode 100644 index 0000000..aeb5aa5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/CarouselSelect/Item.php @@ -0,0 +1,190 @@ +google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + */ +class Item extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $info = null; + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $info + * Required. Additional info about the option item. + * @type string $title + * Required. Title of the carousel item. + * @type string $description + * Optional. The body text of the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo|null + */ + public function getInfo() + { + return $this->info; + } + + public function hasInfo() + { + return isset($this->info); + } + + public function clearInfo() + { + unset($this->info); + } + + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $var + * @return $this + */ + public function setInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo::class); + $this->info = $var; + + return $this; + } + + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties.php new file mode 100644 index 0000000..6a7b269 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + */ +class ColumnProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + */ + protected $header = ''; + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $horizontal_alignment = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header + * Required. Column heading. + * @type int $horizontal_alignment + * Optional. Defines text alignment for all cells in this column. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->header; + } + + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->header = $var; + + return $this; + } + + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHorizontalAlignment() + { + return $this->horizontal_alignment; + } + + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHorizontalAlignment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties\HorizontalAlignment::class); + $this->horizontal_alignment = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php new file mode 100644 index 0000000..b26ae3a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment + */ +class HorizontalAlignment +{ + /** + * Text is aligned to the leading edge of the column. + * + * Generated from protobuf enum HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + */ + const HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + /** + * Text is aligned to the leading edge of the column. + * + * Generated from protobuf enum LEADING = 1; + */ + const LEADING = 1; + /** + * Text is centered in the column. + * + * Generated from protobuf enum CENTER = 2; + */ + const CENTER = 2; + /** + * Text is aligned to the trailing edge of the column. + * + * Generated from protobuf enum TRAILING = 3; + */ + const TRAILING = 3; + + private static $valueToName = [ + self::HORIZONTAL_ALIGNMENT_UNSPECIFIED => 'HORIZONTAL_ALIGNMENT_UNSPECIFIED', + self::LEADING => 'LEADING', + self::CENTER => 'CENTER', + self::TRAILING => 'TRAILING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Image.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Image.php new file mode 100644 index 0000000..b205be4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Image.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.Intent.Message.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_uri = ''; + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accessibility_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_uri + * Optional. The public URI to an image file. + * @type string $accessibility_text + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccessibilityText() + { + return $this->accessibility_text; + } + + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccessibilityText($var) + { + GPBUtil::checkString($var, True); + $this->accessibility_text = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/LinkOutSuggestion.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/LinkOutSuggestion.php new file mode 100644 index 0000000..95de65f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/LinkOutSuggestion.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + */ +class LinkOutSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $destination_name = ''; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_name + * Required. The name of the app or site this chip is linking to. + * @type string $uri + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDestinationName() + { + return $this->destination_name; + } + + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDestinationName($var) + { + GPBUtil::checkString($var, True); + $this->destination_name = $var; + + return $this; + } + + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect.php new file mode 100644 index 0000000..a684280 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect.php @@ -0,0 +1,136 @@ +google.cloud.dialogflow.v2.Intent.Message.ListSelect + */ +class ListSelect extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $items; + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The overall title of the list. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $items + * Required. List items. + * @type string $subtitle + * Optional. Subtitle of the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item::class); + $this->items = $arr; + + return $this; + } + + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect/Item.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect/Item.php new file mode 100644 index 0000000..b3486d9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/ListSelect/Item.php @@ -0,0 +1,190 @@ +google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + */ +class Item extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $info = null; + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $info + * Required. Additional information about this option. + * @type string $title + * Required. The title of the list item. + * @type string $description + * Optional. The main text describing the item. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo|null + */ + public function getInfo() + { + return $this->info; + } + + public function hasInfo() + { + return isset($this->info); + } + + public function clearInfo() + { + unset($this->info); + } + + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $var + * @return $this + */ + public function setInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo::class); + $this->info = $var; + + return $this; + } + + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent.php new file mode 100644 index 0000000..783ad40 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent + */ +class MediaContent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $media_type = 0; + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + */ + private $media_objects; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $media_type + * Optional. What type of media is the content (ie "audio"). + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $media_objects + * Required. List of media objects. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMediaType() + { + return $this->media_type; + } + + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMediaType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaType::class); + $this->media_type = $var; + + return $this; + } + + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMediaObjects() + { + return $this->media_objects; + } + + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMediaObjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject::class); + $this->media_objects = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaObject.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaObject.php new file mode 100644 index 0000000..6a47d26 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaObject.php @@ -0,0 +1,211 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + */ +class ResponseMediaObject extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + */ + protected $content_url = ''; + protected $image; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of media card. + * @type string $description + * Optional. Description of media card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $large_image + * Optional. Image to display above media content. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $icon + * Optional. Icon to display above media content. + * @type string $content_url + * Required. Url where the media is stored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Image to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image large_image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getLargeImage() + { + return $this->readOneof(3); + } + + public function hasLargeImage() + { + return $this->hasOneof(3); + } + + /** + * Optional. Image to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image large_image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setLargeImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Icon to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image icon = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getIcon() + { + return $this->readOneof(4); + } + + public function hasIcon() + { + return $this->hasOneof(4); + } + + /** + * Optional. Icon to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image icon = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + * @return string + */ + public function getContentUrl() + { + return $this->content_url; + } + + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + * @param string $var + * @return $this + */ + public function setContentUrl($var) + { + GPBUtil::checkString($var, True); + $this->content_url = $var; + + return $this; + } + + /** + * @return string + */ + public function getImage() + { + return $this->whichOneof("image"); + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaType.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaType.php new file mode 100644 index 0000000..3b1f45a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/MediaContent/ResponseMediaType.php @@ -0,0 +1,55 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType + */ +class ResponseMediaType +{ + /** + * Unspecified. + * + * Generated from protobuf enum RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0; + */ + const RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0; + /** + * Response media type is audio. + * + * Generated from protobuf enum AUDIO = 1; + */ + const AUDIO = 1; + + private static $valueToName = [ + self::RESPONSE_MEDIA_TYPE_UNSPECIFIED => 'RESPONSE_MEDIA_TYPE_UNSPECIFIED', + self::AUDIO => 'AUDIO', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Platform.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Platform.php new file mode 100644 index 0000000..99f5e3c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Platform.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.Intent.Message.Platform + */ +class Platform +{ + /** + * Default platform. + * + * Generated from protobuf enum PLATFORM_UNSPECIFIED = 0; + */ + const PLATFORM_UNSPECIFIED = 0; + /** + * Facebook. + * + * Generated from protobuf enum FACEBOOK = 1; + */ + const FACEBOOK = 1; + /** + * Slack. + * + * Generated from protobuf enum SLACK = 2; + */ + const SLACK = 2; + /** + * Telegram. + * + * Generated from protobuf enum TELEGRAM = 3; + */ + const TELEGRAM = 3; + /** + * Kik. + * + * Generated from protobuf enum KIK = 4; + */ + const KIK = 4; + /** + * Skype. + * + * Generated from protobuf enum SKYPE = 5; + */ + const SKYPE = 5; + /** + * Line. + * + * Generated from protobuf enum LINE = 6; + */ + const LINE = 6; + /** + * Viber. + * + * Generated from protobuf enum VIBER = 7; + */ + const VIBER = 7; + /** + * Google Assistant + * See [Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf enum ACTIONS_ON_GOOGLE = 8; + */ + const ACTIONS_ON_GOOGLE = 8; + /** + * Google Hangouts. + * + * Generated from protobuf enum GOOGLE_HANGOUTS = 11; + */ + const GOOGLE_HANGOUTS = 11; + + private static $valueToName = [ + self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED', + self::FACEBOOK => 'FACEBOOK', + self::SLACK => 'SLACK', + self::TELEGRAM => 'TELEGRAM', + self::KIK => 'KIK', + self::SKYPE => 'SKYPE', + self::LINE => 'LINE', + self::VIBER => 'VIBER', + self::ACTIONS_ON_GOOGLE => 'ACTIONS_ON_GOOGLE', + self::GOOGLE_HANGOUTS => 'GOOGLE_HANGOUTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/QuickReplies.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/QuickReplies.php new file mode 100644 index 0000000..fab1f5d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/QuickReplies.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Intent.Message.QuickReplies + */ +class QuickReplies extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $quick_replies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the collection of quick replies. + * @type array|\Google\Protobuf\Internal\RepeatedField $quick_replies + * Optional. The collection of quick replies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuickReplies() + { + return $this->quick_replies; + } + + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuickReplies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->quick_replies = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SelectItemInfo.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SelectItemInfo.php new file mode 100644 index 0000000..4fd924c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SelectItemInfo.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + */ +class SelectItemInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Required. A unique key that will be sent back to the agent if this + * response is given. + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponse.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponse.php new file mode 100644 index 0000000..58a0574 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponse.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + */ +class SimpleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + */ + protected $text_to_speech = ''; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + */ + protected $ssml = ''; + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text_to_speech + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * @type string $ssml + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * @type string $display_text + * Optional. The text to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + * @return string + */ + public function getTextToSpeech() + { + return $this->text_to_speech; + } + + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + * @param string $var + * @return $this + */ + public function setTextToSpeech($var) + { + GPBUtil::checkString($var, True); + $this->text_to_speech = $var; + + return $this; + } + + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + * @return string + */ + public function getSsml() + { + return $this->ssml; + } + + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + * @param string $var + * @return $this + */ + public function setSsml($var) + { + GPBUtil::checkString($var, True); + $this->ssml = $var; + + return $this; + } + + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayText() + { + return $this->display_text; + } + + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayText($var) + { + GPBUtil::checkString($var, True); + $this->display_text = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponses.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponses.php new file mode 100644 index 0000000..c2b44da --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/SimpleResponses.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + */ +class SimpleResponses extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $simple_responses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $simple_responses + * Required. The list of simple responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSimpleResponses() + { + return $this->simple_responses; + } + + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSimpleResponses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse::class); + $this->simple_responses = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestion.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestion.php new file mode 100644 index 0000000..f60117c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestion.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Intent.Message.Suggestion + */ +class Suggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. The text shown the in the suggestion chip. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestions.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestions.php new file mode 100644 index 0000000..96575a9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Suggestions.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.Suggestions + */ +class Suggestions extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $suggestions + * Required. The list of suggested replies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestions() + { + return $this->suggestions; + } + + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion::class); + $this->suggestions = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCard.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCard.php new file mode 100644 index 0000000..936a8ed --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCard.php @@ -0,0 +1,248 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCard + */ +class TableCard extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $column_properties; + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rows; + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. Title of the card. + * @type string $subtitle + * Optional. Subtitle to the title. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. Image which should be displayed on the card. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $column_properties + * Optional. Display properties for the columns in this table. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $rows + * Optional. Rows in this table of data. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $buttons + * Optional. List of buttons for the card. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColumnProperties() + { + return $this->column_properties; + } + + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColumnProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties::class); + $this->column_properties = $arr; + + return $this; + } + + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow::class); + $this->rows = $arr; + + return $this; + } + + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardCell.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardCell.php new file mode 100644 index 0000000..1136895 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardCell.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCardCell + */ +class TableCardCell extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. Text in this cell. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardRow.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardRow.php new file mode 100644 index 0000000..3d7e229 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/TableCardRow.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCardRow + */ +class TableCardRow extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $cells; + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $divider_after = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $cells + * Optional. List of cells that make up this row. + * @type bool $divider_after + * Optional. Whether to add a visual divider after this row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell::class); + $this->cells = $arr; + + return $this; + } + + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDividerAfter() + { + return $this->divider_after; + } + + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDividerAfter($var) + { + GPBUtil::checkBool($var); + $this->divider_after = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Text.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Text.php new file mode 100644 index 0000000..6ce5f64 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Message/Text.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.Text + */ +class Text extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $text; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $text + * Optional. The collection of the agent's responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setText($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->text = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/Parameter.php b/vendor/google/cloud-dialogflow/src/V2/Intent/Parameter.php new file mode 100644 index 0000000..1488ddb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/Parameter.php @@ -0,0 +1,358 @@ +google.cloud.dialogflow.v2.Intent.Parameter + */ +class Parameter extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_value = ''; + /** + * Optional. The name of the entity type, prefixed with `@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $entity_type_display_name = ''; + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mandatory = false; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $prompts; + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $is_list = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this parameter. + * @type string $display_name + * Required. The name of the parameter. + * @type string $value + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * @type string $default_value + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * @type string $entity_type_display_name + * Optional. The name of the entity type, prefixed with `@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * @type bool $mandatory + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * @type array|\Google\Protobuf\Internal\RepeatedField $prompts + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * @type bool $is_list + * Optional. Indicates whether the parameter represents a list of values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + + /** + * Optional. The name of the entity type, prefixed with `@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEntityTypeDisplayName() + { + return $this->entity_type_display_name; + } + + /** + * Optional. The name of the entity type, prefixed with `@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEntityTypeDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->entity_type_display_name = $var; + + return $this; + } + + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMandatory() + { + return $this->mandatory; + } + + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMandatory($var) + { + GPBUtil::checkBool($var); + $this->mandatory = $var; + + return $this; + } + + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrompts() + { + return $this->prompts; + } + + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrompts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->prompts = $arr; + + return $this; + } + + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsList() + { + return $this->is_list; + } + + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsList($var) + { + GPBUtil::checkBool($var); + $this->is_list = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase.php b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase.php new file mode 100644 index 0000000..01ea73e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase.php @@ -0,0 +1,238 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase + */ +class TrainingPhrase extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $parts; + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $times_added_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this training phrase. + * @type int $type + * Required. The type of the training phrase. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $parts + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * @type int $times_added_count + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParts() + { + return $this->parts; + } + + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part::class); + $this->parts = $arr; + + return $this; + } + + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimesAddedCount() + { + return $this->times_added_count; + } + + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimesAddedCount($var) + { + GPBUtil::checkInt32($var); + $this->times_added_count = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Part.php b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Part.php new file mode 100644 index 0000000..51adb1b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Part.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + */ +class Part extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * Optional. The entity type name prefixed with `@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $entity_type = ''; + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alias = ''; + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_defined = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. The text for this part. + * @type string $entity_type + * Optional. The entity type name prefixed with `@`. + * This field is required for annotated parts of the training phrase. + * @type string $alias + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * @type bool $user_defined + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The entity type name prefixed with `@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEntityType() + { + return $this->entity_type; + } + + /** + * Optional. The entity type name prefixed with `@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkString($var, True); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlias($var) + { + GPBUtil::checkString($var, True); + $this->alias = $var; + + return $this; + } + + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUserDefined() + { + return $this->user_defined; + } + + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUserDefined($var) + { + GPBUtil::checkBool($var); + $this->user_defined = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Type.php b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Type.php new file mode 100644 index 0000000..c7eb4f1 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/TrainingPhrase/Type.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type + */ +class Type +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Examples do not contain @-prefixed entity type names, but example parts + * can be annotated with entity types. + * + * Generated from protobuf enum EXAMPLE = 1; + */ + const EXAMPLE = 1; + /** + * Templates are not annotated with entity types, but they can contain + * @-prefixed entity type names as substrings. + * Template mode has been deprecated. Example mode is the only supported + * way to create new training phrases. If you have existing training + * phrases that you've created in template mode, those will continue to + * work. + * + * Generated from protobuf enum TEMPLATE = 2 [deprecated = true]; + */ + const TEMPLATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::EXAMPLE => 'EXAMPLE', + self::TEMPLATE => 'TEMPLATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/Intent/WebhookState.php b/vendor/google/cloud-dialogflow/src/V2/Intent/WebhookState.php new file mode 100644 index 0000000..f1bdda2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Intent/WebhookState.php @@ -0,0 +1,63 @@ +google.cloud.dialogflow.v2.Intent.WebhookState + */ +class WebhookState +{ + /** + * Webhook is disabled in the agent and in the intent. + * + * Generated from protobuf enum WEBHOOK_STATE_UNSPECIFIED = 0; + */ + const WEBHOOK_STATE_UNSPECIFIED = 0; + /** + * Webhook is enabled in the agent and in the intent. + * + * Generated from protobuf enum WEBHOOK_STATE_ENABLED = 1; + */ + const WEBHOOK_STATE_ENABLED = 1; + /** + * Webhook is enabled in the agent and in the intent. Also, each slot + * filling prompt is forwarded to the webhook. + * + * Generated from protobuf enum WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + */ + const WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + + private static $valueToName = [ + self::WEBHOOK_STATE_UNSPECIFIED => 'WEBHOOK_STATE_UNSPECIFIED', + self::WEBHOOK_STATE_ENABLED => 'WEBHOOK_STATE_ENABLED', + self::WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING => 'WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/IntentBatch.php b/vendor/google/cloud-dialogflow/src/V2/IntentBatch.php new file mode 100644 index 0000000..87fcc6a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/IntentBatch.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.IntentBatch + */ +class IntentBatch extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $intents + * A collection of intents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntents() + { + return $this->intents; + } + + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/IntentSuggestion.php b/vendor/google/cloud-dialogflow/src/V2/IntentSuggestion.php new file mode 100644 index 0000000..87f1941 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/IntentSuggestion.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.IntentSuggestion + */ +class IntentSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + */ + protected $description = ''; + protected $intent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the intent. + * @type string $intent_v2 + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * @type string $description + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @return string + */ + public function getIntentV2() + { + return $this->readOneof(2); + } + + public function hasIntentV2() + { + return $this->hasOneof(2); + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @param string $var + * @return $this + */ + public function setIntentV2($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * @return string + */ + public function getIntent() + { + return $this->whichOneof("intent"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/IntentView.php b/vendor/google/cloud-dialogflow/src/V2/IntentView.php new file mode 100644 index 0000000..916e50e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/IntentView.php @@ -0,0 +1,56 @@ +google.cloud.dialogflow.v2.IntentView + */ +class IntentView +{ + /** + * Training phrases field is not populated in the response. + * + * Generated from protobuf enum INTENT_VIEW_UNSPECIFIED = 0; + */ + const INTENT_VIEW_UNSPECIFIED = 0; + /** + * All fields are populated. + * + * Generated from protobuf enum INTENT_VIEW_FULL = 1; + */ + const INTENT_VIEW_FULL = 1; + + private static $valueToName = [ + self::INTENT_VIEW_UNSPECIFIED => 'INTENT_VIEW_UNSPECIFIED', + self::INTENT_VIEW_FULL => 'INTENT_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer.php new file mode 100644 index 0000000..4b76d02 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer.php @@ -0,0 +1,171 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer + */ +class KnowledgeAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + */ + protected $suggested_query = null; + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + */ + protected $suggested_query_answer = null; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $suggested_query + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $suggested_query_answer + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery|null + */ + public function getSuggestedQuery() + { + return $this->suggested_query; + } + + public function hasSuggestedQuery() + { + return isset($this->suggested_query); + } + + public function clearSuggestedQuery() + { + unset($this->suggested_query); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $var + * @return $this + */ + public function setSuggestedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery::class); + $this->suggested_query = $var; + + return $this; + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer|null + */ + public function getSuggestedQueryAnswer() + { + return $this->suggested_query_answer; + } + + public function hasSuggestedQueryAnswer() + { + return isset($this->suggested_query_answer); + } + + public function clearSuggestedQueryAnswer() + { + unset($this->suggested_query_answer); + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $var + * @return $this + */ + public function setSuggestedQueryAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer::class); + $this->suggested_query_answer = $var; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php new file mode 100644 index 0000000..3ac5050 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php @@ -0,0 +1,144 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer + */ +class KnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + */ + protected $answer_text = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_text + * The piece of text from the `source` that answers this suggested query. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $faq_source + * Populated if the prediction came from FAQ. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $generative_source + * Populated if the prediction was Generative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @return string + */ + public function getAnswerText() + { + return $this->answer_text; + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @param string $var + * @return $this + */ + public function setAnswerText($var) + { + GPBUtil::checkString($var, True); + $this->answer_text = $var; + + return $this; + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource|null + */ + public function getFaqSource() + { + return $this->readOneof(3); + } + + public function hasFaqSource() + { + return $this->hasOneof(3); + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $var + * @return $this + */ + public function setFaqSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null + */ + public function getGenerativeSource() + { + return $this->readOneof(4); + } + + public function hasGenerativeSource() + { + return $this->hasOneof(4); + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var + * @return $this + */ + public function setGenerativeSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php new file mode 100644 index 0000000..bedf2b5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource + */ +class FaqSource extends \Google\Protobuf\Internal\Message +{ + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + */ + protected $question = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * The corresponding FAQ question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php new file mode 100644 index 0000000..a96d616 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource + */ +class GenerativeSource extends \Google\Protobuf\Internal\Message +{ + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + */ + private $snippets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $snippets + * All snippets used for this Generative Prediction, with their source URI + * and data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @param array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnippets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet::class); + $this->snippets = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php new file mode 100644 index 0000000..6ecb1dc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php @@ -0,0 +1,180 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet + */ +class Snippet extends \Google\Protobuf\Internal\Message +{ + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + */ + protected $text = ''; + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + */ + protected $title = ''; + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * URI the data is sourced from. + * @type string $text + * Text taken from that URI. + * @type string $title + * Title of the document. + * @type \Google\Protobuf\Struct $metadata + * Metadata of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/SuggestedQuery.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/SuggestedQuery.php new file mode 100644 index 0000000..c36f865 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeAssistAnswer/SuggestedQuery.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery + */ +class SuggestedQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * Suggested query text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @return string + */ + public function getQueryText() + { + return $this->query_text; + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @param string $var + * @return $this + */ + public function setQueryText($var) + { + GPBUtil::checkString($var, True); + $this->query_text = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeBase.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeBase.php new file mode 100644 index 0000000..d3753cd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeBase.php @@ -0,0 +1,166 @@ +google.cloud.dialogflow.v2.KnowledgeBase + */ +class KnowledgeBase extends \Google\Protobuf\Internal\Message +{ + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * @type string $display_name + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * @type string $language_code + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata.php new file mode 100644 index 0000000..609ea56 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata.php @@ -0,0 +1,143 @@ +google.cloud.dialogflow.v2.KnowledgeOperationMetadata + */ +class KnowledgeOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + */ + protected $knowledge_base = ''; + protected $operation_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The current state of this operation. + * @type string $knowledge_base + * The name of the knowledge base interacted with during the operation. + * @type \Google\Cloud\Dialogflow\V2\ExportOperationMetadata $export_operation_metadata + * Metadata for the Export Data Operation such as the destination of export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + * @return string + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + * @param string $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkString($var, True); + $this->knowledge_base = $var; + + return $this; + } + + /** + * Metadata for the Export Data Operation such as the destination of export. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ExportOperationMetadata export_operation_metadata = 4; + * @return \Google\Cloud\Dialogflow\V2\ExportOperationMetadata|null + */ + public function getExportOperationMetadata() + { + return $this->readOneof(4); + } + + public function hasExportOperationMetadata() + { + return $this->hasOneof(4); + } + + /** + * Metadata for the Export Data Operation such as the destination of export. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ExportOperationMetadata export_operation_metadata = 4; + * @param \Google\Cloud\Dialogflow\V2\ExportOperationMetadata $var + * @return $this + */ + public function setExportOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ExportOperationMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getOperationMetadata() + { + return $this->whichOneof("operation_metadata"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata/State.php b/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata/State.php new file mode 100644 index 0000000..c145eec --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/KnowledgeOperationMetadata/State.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State + */ +class State +{ + /** + * State unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The operation has been created. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The operation is currently running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The operation is done, either cancelled or completed. + * + * Generated from protobuf enum DONE = 3; + */ + const DONE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::DONE => 'DONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsRequest.php new file mode 100644 index 0000000..e1a185b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsRequest.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.ListAnswerRecordsRequest + */ +class ListAnswerRecordsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. Please see + * {@see AnswerRecordsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListAnswerRecordsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @type string $filter + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type int $page_size + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * @type string $page_token + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsResponse.php new file mode 100644 index 0000000..f15328a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListAnswerRecordsResponse.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.ListAnswerRecordsResponse + */ +class ListAnswerRecordsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + */ + private $answer_records; + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $answer_records + * The list of answer records. + * @type string $next_page_token + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerRecords() + { + return $this->answer_records; + } + + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + * @param array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AnswerRecord::class); + $this->answer_records = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListContextsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListContextsRequest.php new file mode 100644 index 0000000..3b9d788 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListContextsRequest.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.ListContextsRequest + */ +class ListContextsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListContextsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListContextsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListContextsResponse.php new file mode 100644 index 0000000..4441573 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListContextsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListContextsResponse + */ +class ListContextsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + */ + private $contexts; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $contexts + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContexts() + { + return $this->contexts; + } + + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->contexts = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsRequest.php new file mode 100644 index 0000000..7647f1d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.ListConversationDatasetsRequest + */ +class ListConversationDatasetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * Please see {@see ConversationDatasetsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationDatasetsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsResponse.php new file mode 100644 index 0000000..5e09181 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationDatasetsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationDatasetsResponse + */ +class ListConversationDatasetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + */ + private $conversation_datasets; + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $conversation_datasets + * The list of datasets to return. + * @type string $next_page_token + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConversationDatasets() + { + return $this->conversation_datasets; + } + + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConversationDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationDataset::class); + $this->conversation_datasets = $arr; + + return $this; + } + + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsRequest.php new file mode 100644 index 0000000..759979e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest + */ +class ListConversationModelEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationModelEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * @type int $page_size + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsResponse.php new file mode 100644 index 0000000..f974266 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelEvaluationsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse + */ +class ListConversationModelEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + */ + private $conversation_model_evaluations; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $conversation_model_evaluations + * The list of evaluations to return. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConversationModelEvaluations() + { + return $this->conversation_model_evaluations; + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConversationModelEvaluations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation::class); + $this->conversation_model_evaluations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsRequest.php new file mode 100644 index 0000000..286fcf7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListConversationModelsRequest + */ +class ListConversationModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all conversation models for. + * Format: `projects/` + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationModelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all conversation models for. + * Format: `projects/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsResponse.php new file mode 100644 index 0000000..1aa84fb --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationModelsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationModelsResponse + */ +class ListConversationModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + */ + private $conversation_models; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $conversation_models + * The list of models to return. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConversationModels() + { + return $this->conversation_models; + } + + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConversationModels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationModel::class); + $this->conversation_models = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesRequest.php new file mode 100644 index 0000000..71d9fdd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.ListConversationProfilesRequest + */ +class ListConversationProfilesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationProfilesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesResponse.php new file mode 100644 index 0000000..b0a8719 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationProfilesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListConversationProfilesResponse + */ +class ListConversationProfilesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + */ + private $conversation_profiles; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $conversation_profiles + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConversationProfiles() + { + return $this->conversation_profiles; + } + + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConversationProfiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profiles = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationsRequest.php new file mode 100644 index 0000000..0c10778 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationsRequest.php @@ -0,0 +1,213 @@ +google.cloud.dialogflow.v2.ListConversationsRequest + */ +class ListConversationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project from which to list all conversation. + * Format: `projects//locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * @type string $filter + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListConversationsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListConversationsResponse.php new file mode 100644 index 0000000..f4a0679 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListConversationsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListConversationsResponse + */ +class ListConversationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + */ + private $conversations; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $conversations + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConversations() + { + return $this->conversations; + } + + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConversations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation::class); + $this->conversations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListDocumentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListDocumentsRequest.php new file mode 100644 index 0000000..ca75b93 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListDocumentsRequest.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.ListDocumentsRequest + */ +class ListDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListDocumentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * @type string $filter + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListDocumentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListDocumentsResponse.php new file mode 100644 index 0000000..101cf40 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListDocumentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListDocumentsResponse + */ +class ListDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + */ + private $documents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $documents + * The list of documents. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Document::class); + $this->documents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesRequest.php new file mode 100644 index 0000000..a24d189 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesRequest.php @@ -0,0 +1,230 @@ +google.cloud.dialogflow.v2.ListEntityTypesRequest + */ +class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all entity types from. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * @param string $parent Required. The agent to list all entity types from. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\ListEntityTypesRequest + * + * @experimental + */ + public static function buildFromParentLanguageCode(string $parent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesResponse.php new file mode 100644 index 0000000..766d026 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListEntityTypesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListEntityTypesResponse + */ +class ListEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $entity_types + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsRequest.php new file mode 100644 index 0000000..9cb3ad8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsRequest.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.ListEnvironmentsRequest + */ +class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all environments from. + * Format: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListEnvironmentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsResponse.php new file mode 100644 index 0000000..c5fe88b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListEnvironmentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListEnvironmentsResponse + */ +class ListEnvironmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + */ + private $environments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $environments + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnvironments() + { + return $this->environments; + } + + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnvironments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsRequest.php new file mode 100644 index 0000000..84a6973 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListGeneratorsRequest + */ +class ListGeneratorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project/location to list generators for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListGeneratorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsResponse.php new file mode 100644 index 0000000..e498897 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListGeneratorsResponse.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ListGeneratorsResponse + */ +class ListGeneratorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + */ + private $generators; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $generators + * List of generators retrieved. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generators = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListIntentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListIntentsRequest.php new file mode 100644 index 0000000..67abb03 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListIntentsRequest.php @@ -0,0 +1,308 @@ +google.cloud.dialogflow.v2.ListIntentsRequest + */ +class ListIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListIntentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * @param string $parent Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\ListIntentsRequest + * + * @experimental + */ + public static function buildFromParentLanguageCode(string $parent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListIntentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListIntentsResponse.php new file mode 100644 index 0000000..8d1fe4c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListIntentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListIntentsResponse + */ +class ListIntentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $intents + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntents() + { + return $this->intents; + } + + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesRequest.php new file mode 100644 index 0000000..5fba54a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesRequest.php @@ -0,0 +1,265 @@ +google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + */ +class ListKnowledgeBasesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListKnowledgeBasesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * @type string $filter + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesResponse.php new file mode 100644 index 0000000..89838ab --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListKnowledgeBasesResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + */ +class ListKnowledgeBasesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + */ + private $knowledge_bases; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $knowledge_bases + * The list of knowledge bases. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKnowledgeBases() + { + return $this->knowledge_bases; + } + + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + * @param array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKnowledgeBases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_bases = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListMessagesRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListMessagesRequest.php new file mode 100644 index 0000000..bb73b25 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListMessagesRequest.php @@ -0,0 +1,222 @@ +google.cloud.dialogflow.v2.ListMessagesRequest + */ +class ListMessagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * Please see {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListMessagesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @type string $filter + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListMessagesResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListMessagesResponse.php new file mode 100644 index 0000000..694488d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListMessagesResponse.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.ListMessagesResponse + */ +class ListMessagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + */ + private $messages; + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListParticipantsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListParticipantsRequest.php new file mode 100644 index 0000000..ac01cf2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListParticipantsRequest.php @@ -0,0 +1,164 @@ +google.cloud.dialogflow.v2.ListParticipantsRequest + */ +class ListParticipantsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListParticipantsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListParticipantsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListParticipantsResponse.php new file mode 100644 index 0000000..800b88a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListParticipantsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListParticipantsResponse + */ +class ListParticipantsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + */ + private $participants; + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $participants + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParticipants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participants = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesRequest.php new file mode 100644 index 0000000..e178b68 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesRequest.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.ListSessionEntityTypesRequest + */ +class ListSessionEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListSessionEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesResponse.php new file mode 100644 index 0000000..87ea45c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListSessionEntityTypesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListSessionEntityTypesResponse + */ +class ListSessionEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + */ + private $session_entity_types; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $session_entity_types + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + * @param array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListVersionsRequest.php b/vendor/google/cloud-dialogflow/src/V2/ListVersionsRequest.php new file mode 100644 index 0000000..be9c319 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListVersionsRequest.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.ListVersionsRequest + */ +class ListVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all versions from. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListVersionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ListVersionsResponse.php b/vendor/google/cloud-dialogflow/src/V2/ListVersionsResponse.php new file mode 100644 index 0000000..653aa7d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ListVersionsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListVersionsResponse + */ +class ListVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + */ + private $versions; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $versions + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersions() + { + return $this->versions; + } + + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Version::class); + $this->versions = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/LoggingConfig.php b/vendor/google/cloud-dialogflow/src/V2/LoggingConfig.php new file mode 100644 index 0000000..31121f0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/LoggingConfig.php @@ -0,0 +1,79 @@ +google.cloud.dialogflow.v2.LoggingConfig + */ +class LoggingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + */ + protected $enable_stackdriver_logging = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_stackdriver_logging + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + * @return bool + */ + public function getEnableStackdriverLogging() + { + return $this->enable_stackdriver_logging; + } + + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + * @param bool $var + * @return $this + */ + public function setEnableStackdriverLogging($var) + { + GPBUtil::checkBool($var); + $this->enable_stackdriver_logging = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Message.php b/vendor/google/cloud-dialogflow/src/V2/Message.php new file mode 100644 index 0000000..94eeee3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Message.php @@ -0,0 +1,399 @@ +google.cloud.dialogflow.v2.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content = ''; + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $participant = ''; + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $participant_role = 0; + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $send_time = null; + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $message_annotation = null; + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sentiment_analysis = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * @type string $content + * Required. The message content. + * @type string $language_code + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type string $participant + * Output only. The participant that sends this message. + * @type int $participant_role + * Output only. The role of the participant. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the message was created in Contact Center AI. + * @type \Google\Protobuf\Timestamp $send_time + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * @type \Google\Cloud\Dialogflow\V2\MessageAnnotation $message_annotation + * Output only. The annotation for the message. + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $sentiment_analysis + * Output only. The sentiment analysis result for the message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSendTime() + { + return $this->send_time; + } + + public function hasSendTime() + { + return isset($this->send_time); + } + + public function clearSendTime() + { + unset($this->send_time); + } + + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSendTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->send_time = $var; + + return $this; + } + + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\MessageAnnotation|null + */ + public function getMessageAnnotation() + { + return $this->message_annotation; + } + + public function hasMessageAnnotation() + { + return isset($this->message_annotation); + } + + public function clearMessageAnnotation() + { + unset($this->message_annotation); + } + + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\MessageAnnotation $var + * @return $this + */ + public function setMessageAnnotation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\MessageAnnotation::class); + $this->message_annotation = $var; + + return $this; + } + + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult|null + */ + public function getSentimentAnalysis() + { + return $this->sentiment_analysis; + } + + public function hasSentimentAnalysis() + { + return isset($this->sentiment_analysis); + } + + public function clearSentimentAnalysis() + { + unset($this->sentiment_analysis); + } + + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $var + * @return $this + */ + public function setSentimentAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult::class); + $this->sentiment_analysis = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/MessageAnnotation.php b/vendor/google/cloud-dialogflow/src/V2/MessageAnnotation.php new file mode 100644 index 0000000..d1860e5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/MessageAnnotation.php @@ -0,0 +1,109 @@ +google.cloud.dialogflow.v2.MessageAnnotation + */ +class MessageAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + */ + private $parts; + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + */ + protected $contain_entities = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $parts + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * @type bool $contain_entities + * Indicates whether the text message contains entities. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParts() + { + return $this->parts; + } + + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + * @param array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AnnotatedMessagePart::class); + $this->parts = $arr; + + return $this; + } + + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + * @return bool + */ + public function getContainEntities() + { + return $this->contain_entities; + } + + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + * @param bool $var + * @return $this + */ + public function setContainEntities($var) + { + GPBUtil::checkBool($var); + $this->contain_entities = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/MessageEntry.php b/vendor/google/cloud-dialogflow/src/V2/MessageEntry.php new file mode 100644 index 0000000..53c6cdd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/MessageEntry.php @@ -0,0 +1,187 @@ +google.cloud.dialogflow.v2.MessageEntry + */ +class MessageEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $role = 0; + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $role + * Optional. Participant role of the message. + * @type string $text + * Optional. Transcript content of the message. + * @type string $language_code + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Create time of the message entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\MessageEntry\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/MessageEntry/Role.php b/vendor/google/cloud-dialogflow/src/V2/MessageEntry/Role.php new file mode 100644 index 0000000..541c39a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/MessageEntry/Role.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.MessageEntry.Role + */ +class Role +{ + /** + * Participant role not set. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Participant is a human agent. + * + * Generated from protobuf enum HUMAN_AGENT = 1; + */ + const HUMAN_AGENT = 1; + /** + * Participant is an automated agent, such as a Dialogflow agent. + * + * Generated from protobuf enum AUTOMATED_AGENT = 2; + */ + const AUTOMATED_AGENT = 2; + /** + * Participant is an end user that has called or chatted with + * Dialogflow services. + * + * Generated from protobuf enum END_USER = 3; + */ + const END_USER = 3; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::HUMAN_AGENT => 'HUMAN_AGENT', + self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', + self::END_USER => 'END_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/NotificationConfig.php b/vendor/google/cloud-dialogflow/src/V2/NotificationConfig.php new file mode 100644 index 0000000..f096ff3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/NotificationConfig.php @@ -0,0 +1,149 @@ +google.cloud.dialogflow.v2.NotificationConfig + */ +class NotificationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + */ + protected $topic = ''; + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + */ + protected $message_format = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * @type int $message_format + * Format of message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + * @return int + */ + public function getMessageFormat() + { + return $this->message_format; + } + + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + * @param int $var + * @return $this + */ + public function setMessageFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\NotificationConfig\MessageFormat::class); + $this->message_format = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/NotificationConfig/MessageFormat.php b/vendor/google/cloud-dialogflow/src/V2/NotificationConfig/MessageFormat.php new file mode 100644 index 0000000..07a77e2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/NotificationConfig/MessageFormat.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.NotificationConfig.MessageFormat + */ +class MessageFormat +{ + /** + * If it is unspecified, PROTO will be used. + * + * Generated from protobuf enum MESSAGE_FORMAT_UNSPECIFIED = 0; + */ + const MESSAGE_FORMAT_UNSPECIFIED = 0; + /** + * Pub/Sub message will be serialized proto. + * + * Generated from protobuf enum PROTO = 1; + */ + const PROTO = 1; + /** + * Pub/Sub message will be json. + * + * Generated from protobuf enum JSON = 2; + */ + const JSON = 2; + + private static $valueToName = [ + self::MESSAGE_FORMAT_UNSPECIFIED => 'MESSAGE_FORMAT_UNSPECIFIED', + self::PROTO => 'PROTO', + self::JSON => 'JSON', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/OriginalDetectIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/OriginalDetectIntentRequest.php new file mode 100644 index 0000000..3522f20 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/OriginalDetectIntentRequest.php @@ -0,0 +1,202 @@ +google.cloud.dialogflow.v2.OriginalDetectIntentRequest + */ +class OriginalDetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + */ + protected $source = ''; + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + */ + protected $payload = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * @type string $version + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * @type \Google\Protobuf\Struct $payload + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *            "telephony": {
+     *              "caller_id": "+18558363987"
+     *            }
+     *           }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/OutputAudio.php b/vendor/google/cloud-dialogflow/src/V2/OutputAudio.php new file mode 100644 index 0000000..33828b7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/OutputAudio.php @@ -0,0 +1,115 @@ +google.cloud.dialogflow.v2.OutputAudio + */ +class OutputAudio extends \Google\Protobuf\Internal\Message +{ + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + */ + protected $config = null; + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + */ + protected $audio = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $config + * Instructs the speech synthesizer how to generate the speech + * audio. + * @type string $audio + * The natural language speech audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->config = $var; + + return $this; + } + + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + * @return string + */ + public function getAudio() + { + return $this->audio; + } + + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + * @param string $var + * @return $this + */ + public function setAudio($var) + { + GPBUtil::checkString($var, False); + $this->audio = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/OutputAudioConfig.php b/vendor/google/cloud-dialogflow/src/V2/OutputAudioConfig.php new file mode 100644 index 0000000..0380436 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/OutputAudioConfig.php @@ -0,0 +1,163 @@ +google.cloud.dialogflow.v2.OutputAudioConfig + */ +class OutputAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + */ + protected $sample_rate_hertz = 0; + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + */ + protected $synthesize_speech_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. Audio encoding of the synthesized audio content. + * @type int $sample_rate_hertz + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * @type \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $synthesize_speech_config + * Configuration of how speech should be synthesized. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\OutputAudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + * @return \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig|null + */ + public function getSynthesizeSpeechConfig() + { + return $this->synthesize_speech_config; + } + + public function hasSynthesizeSpeechConfig() + { + return isset($this->synthesize_speech_config); + } + + public function clearSynthesizeSpeechConfig() + { + unset($this->synthesize_speech_config); + } + + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + * @param \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $var + * @return $this + */ + public function setSynthesizeSpeechConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->synthesize_speech_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/OutputAudioEncoding.php b/vendor/google/cloud-dialogflow/src/V2/OutputAudioEncoding.php new file mode 100644 index 0000000..5ddca3f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/OutputAudioEncoding.php @@ -0,0 +1,93 @@ +google.cloud.dialogflow.v2.OutputAudioEncoding + */ +class OutputAudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + */ + const OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + /** + * MP3 audio at 32kbps. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3 = 2; + */ + const OUTPUT_AUDIO_ENCODING_MP3 = 2; + /** + * MP3 audio at 64kbps. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + */ + const OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + /** + * Opus encoded audio wrapped in an ogg container. The result will be a + * file which can be played natively on Android, and in browsers (at least + * Chrome and Firefox). The quality of the encoding is considerably higher + * than MP3 while using approximately the same bitrate. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + */ + const OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MULAW = 5; + */ + const OUTPUT_AUDIO_ENCODING_MULAW = 5; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_ALAW = 6; + */ + const OUTPUT_AUDIO_ENCODING_ALAW = 6; + + private static $valueToName = [ + self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED', + self::OUTPUT_AUDIO_ENCODING_LINEAR_16 => 'OUTPUT_AUDIO_ENCODING_LINEAR_16', + self::OUTPUT_AUDIO_ENCODING_MP3 => 'OUTPUT_AUDIO_ENCODING_MP3', + self::OUTPUT_AUDIO_ENCODING_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS', + self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS', + self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW', + self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Participant.php b/vendor/google/cloud-dialogflow/src/V2/Participant.php new file mode 100644 index 0000000..1deb96d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Participant.php @@ -0,0 +1,387 @@ +google.cloud.dialogflow.v2.Participant + */ +class Participant extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $role = 0; + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sip_recording_media_label = ''; + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.participant] + * or + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $obfuscated_external_user_id = ''; + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $documents_metadata_filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * @type int $role + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * @type string $sip_recording_media_label + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * @type string $obfuscated_external_user_id + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.participant] + * or + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * @type array|\Google\Protobuf\Internal\MapField $documents_metadata_filters + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSipRecordingMediaLabel() + { + return $this->sip_recording_media_label; + } + + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSipRecordingMediaLabel($var) + { + GPBUtil::checkString($var, True); + $this->sip_recording_media_label = $var; + + return $this; + } + + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.participant] + * or + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getObfuscatedExternalUserId() + { + return $this->obfuscated_external_user_id; + } + + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.participant] + * or + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setObfuscatedExternalUserId($var) + { + GPBUtil::checkString($var, True); + $this->obfuscated_external_user_id = $var; + + return $this; + } + + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDocumentsMetadataFilters() + { + return $this->documents_metadata_filters; + } + + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDocumentsMetadataFilters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents_metadata_filters = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Participant/Role.php b/vendor/google/cloud-dialogflow/src/V2/Participant/Role.php new file mode 100644 index 0000000..a5f726e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Participant/Role.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.Participant.Role + */ +class Role +{ + /** + * Participant role not set. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Participant is a human agent. + * + * Generated from protobuf enum HUMAN_AGENT = 1; + */ + const HUMAN_AGENT = 1; + /** + * Participant is an automated agent, such as a Dialogflow agent. + * + * Generated from protobuf enum AUTOMATED_AGENT = 2; + */ + const AUTOMATED_AGENT = 2; + /** + * Participant is an end user that has called or chatted with + * Dialogflow services. + * + * Generated from protobuf enum END_USER = 3; + */ + const END_USER = 3; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::HUMAN_AGENT => 'HUMAN_AGENT', + self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', + self::END_USER => 'END_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/QueryInput.php b/vendor/google/cloud-dialogflow/src/V2/QueryInput.php new file mode 100644 index 0000000..d3a9a29 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/QueryInput.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.QueryInput + */ +class QueryInput extends \Google\Protobuf\Internal\Message +{ + protected $input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $audio_config + * Instructs the speech recognizer how to process the speech audio. + * @type \Google\Cloud\Dialogflow\V2\TextInput $text + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * @type \Google\Cloud\Dialogflow\V2\EventInput $event + * The event to be processed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 1; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getAudioConfig() + { + return $this->readOneof(1); + } + + public function hasAudioConfig() + { + return $this->hasOneof(1); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 1; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text = 2; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getText() + { + return $this->readOneof(2); + } + + public function hasText() + { + return $this->hasOneof(2); + } + + /** + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text = 2; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The event to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event = 3; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getEvent() + { + return $this->readOneof(3); + } + + public function hasEvent() + { + return $this->hasOneof(3); + } + + /** + * The event to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event = 3; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/QueryParameters.php b/vendor/google/cloud-dialogflow/src/V2/QueryParameters.php new file mode 100644 index 0000000..bed9ba9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/QueryParameters.php @@ -0,0 +1,461 @@ +google.cloud.dialogflow.v2.QueryParameters + */ +class QueryParameters extends \Google\Protobuf\Internal\Message +{ + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + */ + protected $time_zone = ''; + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + */ + protected $geo_location = null; + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + */ + private $contexts; + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + */ + protected $reset_contexts = false; + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + */ + private $session_entity_types; + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + */ + protected $payload = null; + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + */ + protected $sentiment_analysis_request_config = null; + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + */ + private $webhook_headers; + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + */ + protected $platform = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $time_zone + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * @type \Google\Type\LatLng $geo_location + * The geo location of this conversational query. + * @type array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $contexts + * The collection of contexts to be activated before this query is + * executed. + * @type bool $reset_contexts + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * @type array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $session_entity_types + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * @type \Google\Protobuf\Struct $payload + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig $sentiment_analysis_request_config + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * @type array|\Google\Protobuf\Internal\MapField $webhook_headers + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * @type string $platform + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @return \Google\Type\LatLng|null + */ + public function getGeoLocation() + { + return $this->geo_location; + } + + public function hasGeoLocation() + { + return isset($this->geo_location); + } + + public function clearGeoLocation() + { + unset($this->geo_location); + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setGeoLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->geo_location = $var; + + return $this; + } + + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContexts() + { + return $this->contexts; + } + + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + * @param array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->contexts = $arr; + + return $this; + } + + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + * @return bool + */ + public function getResetContexts() + { + return $this->reset_contexts; + } + + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + * @param bool $var + * @return $this + */ + public function setResetContexts($var) + { + GPBUtil::checkBool($var); + $this->reset_contexts = $var; + + return $this; + } + + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + * @param array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig|null + */ + public function getSentimentAnalysisRequestConfig() + { + return $this->sentiment_analysis_request_config; + } + + public function hasSentimentAnalysisRequestConfig() + { + return isset($this->sentiment_analysis_request_config); + } + + public function clearSentimentAnalysisRequestConfig() + { + unset($this->sentiment_analysis_request_config); + } + + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig $var + * @return $this + */ + public function setSentimentAnalysisRequestConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig::class); + $this->sentiment_analysis_request_config = $var; + + return $this; + } + + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getWebhookHeaders() + { + return $this->webhook_headers; + } + + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setWebhookHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->webhook_headers = $arr; + + return $this; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @return string + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @param string $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkString($var, True); + $this->platform = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/QueryResult.php b/vendor/google/cloud-dialogflow/src/V2/QueryResult.php new file mode 100644 index 0000000..395fd85 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/QueryResult.php @@ -0,0 +1,847 @@ +google.cloud.dialogflow.v2.QueryResult + */ +class QueryResult extends \Google\Protobuf\Internal\Message +{ + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + */ + protected $language_code = ''; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + */ + protected $speech_recognition_confidence = 0.0; + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + */ + protected $action = ''; + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + */ + protected $parameters = null; + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + */ + protected $all_required_params_present = false; + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + */ + protected $cancels_slot_filling = false; + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + */ + protected $fulfillment_text = ''; + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + */ + private $fulfillment_messages; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + */ + protected $webhook_source = ''; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + */ + protected $webhook_payload = null; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + */ + private $output_contexts; + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + */ + protected $intent = null; + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + */ + protected $intent_detection_confidence = 0.0; + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + */ + protected $diagnostic_info = null; + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + */ + protected $sentiment_analysis_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * @type string $language_code + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * @type float $speech_recognition_confidence + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * @type string $action + * The action name from the matched intent. + * @type \Google\Protobuf\Struct $parameters + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type bool $all_required_params_present + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * @type bool $cancels_slot_filling + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * @type string $fulfillment_text + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $fulfillment_messages + * The collection of rich messages to present to the user. + * @type string $webhook_source + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * @type \Google\Protobuf\Struct $webhook_payload + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * @type array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $output_contexts + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * @type float $intent_detection_confidence + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * @type \Google\Protobuf\Struct $diagnostic_info + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $sentiment_analysis_result + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + * @return string + */ + public function getQueryText() + { + return $this->query_text; + } + + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + * @param string $var + * @return $this + */ + public function setQueryText($var) + { + GPBUtil::checkString($var, True); + $this->query_text = $var; + + return $this; + } + + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + * @return float + */ + public function getSpeechRecognitionConfidence() + { + return $this->speech_recognition_confidence; + } + + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + * @param float $var + * @return $this + */ + public function setSpeechRecognitionConfidence($var) + { + GPBUtil::checkFloat($var); + $this->speech_recognition_confidence = $var; + + return $this; + } + + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @return bool + */ + public function getAllRequiredParamsPresent() + { + return $this->all_required_params_present; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @param bool $var + * @return $this + */ + public function setAllRequiredParamsPresent($var) + { + GPBUtil::checkBool($var); + $this->all_required_params_present = $var; + + return $this; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @return bool + */ + public function getCancelsSlotFilling() + { + return $this->cancels_slot_filling; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @param bool $var + * @return $this + */ + public function setCancelsSlotFilling($var) + { + GPBUtil::checkBool($var); + $this->cancels_slot_filling = $var; + + return $this; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @return string + */ + public function getFulfillmentText() + { + return $this->fulfillment_text; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @param string $var + * @return $this + */ + public function setFulfillmentText($var) + { + GPBUtil::checkString($var, True); + $this->fulfillment_text = $var; + + return $this; + } + + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFulfillmentMessages() + { + return $this->fulfillment_messages; + } + + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFulfillmentMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->fulfillment_messages = $arr; + + return $this; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + * @return string + */ + public function getWebhookSource() + { + return $this->webhook_source; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + * @param string $var + * @return $this + */ + public function setWebhookSource($var) + { + GPBUtil::checkString($var, True); + $this->webhook_source = $var; + + return $this; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + * @return \Google\Protobuf\Struct|null + */ + public function getWebhookPayload() + { + return $this->webhook_payload; + } + + public function hasWebhookPayload() + { + return isset($this->webhook_payload); + } + + public function clearWebhookPayload() + { + unset($this->webhook_payload); + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setWebhookPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->webhook_payload = $var; + + return $this; + } + + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + * @param array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + * @return float + */ + public function getIntentDetectionConfidence() + { + return $this->intent_detection_confidence; + } + + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + * @param float $var + * @return $this + */ + public function setIntentDetectionConfidence($var) + { + GPBUtil::checkFloat($var); + $this->intent_detection_confidence = $var; + + return $this; + } + + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + * @return \Google\Protobuf\Struct|null + */ + public function getDiagnosticInfo() + { + return $this->diagnostic_info; + } + + public function hasDiagnosticInfo() + { + return isset($this->diagnostic_info); + } + + public function clearDiagnosticInfo() + { + unset($this->diagnostic_info); + } + + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDiagnosticInfo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->diagnostic_info = $var; + + return $this; + } + + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult|null + */ + public function getSentimentAnalysisResult() + { + return $this->sentiment_analysis_result; + } + + public function hasSentimentAnalysisResult() + { + return isset($this->sentiment_analysis_result); + } + + public function clearSentimentAnalysisResult() + { + unset($this->sentiment_analysis_result); + } + + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $var + * @return $this + */ + public function setSentimentAnalysisResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult::class); + $this->sentiment_analysis_result = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ReloadDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/ReloadDocumentRequest.php new file mode 100644 index 0000000..ea0bbfe --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ReloadDocumentRequest.php @@ -0,0 +1,225 @@ +google.cloud.dialogflow.v2.ReloadDocumentRequest + */ +class ReloadDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $import_gcs_custom_metadata = false; + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $smart_messaging_partial_update = false; + protected $source; + + /** + * @param string $name Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * Please see {@see DocumentsClient::documentName()} for help formatting this field. + * @param string $contentUri Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * @return \Google\Cloud\Dialogflow\V2\ReloadDocumentRequest + * + * @experimental + */ + public static function build(string $name, string $contentUri): self + { + return (new self()) + ->setName($name) + ->setContentUri($contentUri); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * @type string $content_uri + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * @type bool $import_gcs_custom_metadata + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @type bool $smart_messaging_partial_update + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * Generated from protobuf field string content_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getContentUri() + { + return $this->readOneof(3); + } + + public function hasContentUri() + { + return $this->hasOneof(3); + } + + /** + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * Generated from protobuf field string content_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getImportGcsCustomMetadata() + { + return $this->import_gcs_custom_metadata; + } + + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setImportGcsCustomMetadata($var) + { + GPBUtil::checkBool($var); + $this->import_gcs_custom_metadata = $var; + + return $this; + } + + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSmartMessagingPartialUpdate() + { + return $this->smart_messaging_partial_update; + } + + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSmartMessagingPartialUpdate($var) + { + GPBUtil::checkBool($var); + $this->smart_messaging_partial_update = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/RestoreAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/RestoreAgentRequest.php new file mode 100644 index 0000000..19fa986 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/RestoreAgentRequest.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.RestoreAgentRequest + */ +class RestoreAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * @type string $agent_uri + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(2); + } + + public function hasAgentUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(3); + } + + public function hasAgentContent() + { + return $this->hasOneof(3); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchAgentsRequest.php b/vendor/google/cloud-dialogflow/src/V2/SearchAgentsRequest.php new file mode 100644 index 0000000..07a8523 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchAgentsRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.SearchAgentsRequest + */ +class SearchAgentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list agents from. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SearchAgentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list agents from. + * Format: `projects/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchAgentsResponse.php b/vendor/google/cloud-dialogflow/src/V2/SearchAgentsResponse.php new file mode 100644 index 0000000..65b5493 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchAgentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.SearchAgentsResponse + */ +class SearchAgentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + */ + private $agents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $agents + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAgents() + { + return $this->agents; + } + + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAgents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Agent::class); + $this->agents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer.php new file mode 100644 index 0000000..3321918 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer + */ +class SearchKnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + */ + protected $answer = ''; + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + */ + protected $answer_type = 0; + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + */ + private $answer_sources; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer + * The piece of text from the knowledge base documents that answers + * the search query + * @type int $answer_type + * The type of the answer. + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $answer_sources + * All sources used to generate the answer. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @return int + */ + public function getAnswerType() + { + return $this->answer_type; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @param int $var + * @return $this + */ + public function setAnswerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerType::class); + $this->answer_type = $var; + + return $this; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerSources() + { + return $this->answer_sources; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource::class); + $this->answer_sources = $arr; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerSource.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerSource.php new file mode 100644 index 0000000..ffcf639 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerSource.php @@ -0,0 +1,180 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource + */ +class AnswerSource extends \Google\Protobuf\Internal\Message +{ + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + */ + protected $snippet = ''; + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The title of the article. + * @type string $uri + * The URI of the article. + * @type string $snippet + * The relevant snippet of the article. + * @type \Google\Protobuf\Struct $metadata + * Metadata associated with the article. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @return string + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @param string $var + * @return $this + */ + public function setSnippet($var) + { + GPBUtil::checkString($var, True); + $this->snippet = $var; + + return $this; + } + + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerType.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerType.php new file mode 100644 index 0000000..6d5be83 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeAnswer/AnswerType.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType + */ +class AnswerType +{ + /** + * The answer has a unspecified type. + * + * Generated from protobuf enum ANSWER_TYPE_UNSPECIFIED = 0; + */ + const ANSWER_TYPE_UNSPECIFIED = 0; + /** + * The answer is from FAQ documents. + * + * Generated from protobuf enum FAQ = 1; + */ + const FAQ = 1; + /** + * The answer is from generative model. + * + * Generated from protobuf enum GENERATIVE = 2; + */ + const GENERATIVE = 2; + /** + * The answer is from intent matching. + * + * Generated from protobuf enum INTENT = 3; + */ + const INTENT = 3; + + private static $valueToName = [ + self::ANSWER_TYPE_UNSPECIFIED => 'ANSWER_TYPE_UNSPECIFIED', + self::FAQ => 'FAQ', + self::GENERATIVE => 'GENERATIVE', + self::INTENT => 'INTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest.php new file mode 100644 index 0000000..9e61f86 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest.php @@ -0,0 +1,516 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest + */ +class SearchKnowledgeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = null; + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_id = ''; + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query_source = 0; + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_user_metadata = null; + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $search_config = null; + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $exact_search = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $query + * Required. The natural language text query for knowledge search. + * @type string $conversation_profile + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * @type string $session_id + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * @type string $conversation + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * @type int $query_source + * Optional. The source of the query in the request. + * @type \Google\Protobuf\Struct $end_user_metadata + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig $search_config + * Optional. Configuration specific to search queries with data stores. + * @type bool $exact_search + * Optional. Whether to search the query exactly without query rewrite. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->query = $var; + + return $this; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSessionId() + { + return $this->session_id; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSessionId($var) + { + GPBUtil::checkString($var, True); + $this->session_id = $var; + + return $this; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getQuerySource() + { + return $this->query_source; + } + + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setQuerySource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\QuerySource::class); + $this->query_source = $var; + + return $this; + } + + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getEndUserMetadata() + { + return $this->end_user_metadata; + } + + public function hasEndUserMetadata() + { + return isset($this->end_user_metadata); + } + + public function clearEndUserMetadata() + { + unset($this->end_user_metadata); + } + + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setEndUserMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->end_user_metadata = $var; + + return $this; + } + + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig|null + */ + public function getSearchConfig() + { + return $this->search_config; + } + + public function hasSearchConfig() + { + return isset($this->search_config); + } + + public function clearSearchConfig() + { + unset($this->search_config); + } + + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig $var + * @return $this + */ + public function setSearchConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig::class); + $this->search_config = $var; + + return $this; + } + + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExactSearch() + { + return $this->exact_search; + } + + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExactSearch($var) + { + GPBUtil::checkBool($var); + $this->exact_search = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/QuerySource.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/QuerySource.php new file mode 100644 index 0000000..4470341 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/QuerySource.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource + */ +class QuerySource +{ + /** + * Unknown query source. + * + * Generated from protobuf enum QUERY_SOURCE_UNSPECIFIED = 0; + */ + const QUERY_SOURCE_UNSPECIFIED = 0; + /** + * The query is from agents. + * + * Generated from protobuf enum AGENT_QUERY = 1; + */ + const AGENT_QUERY = 1; + /** + * The query is a suggested query from + * [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist]. + * + * Generated from protobuf enum SUGGESTED_QUERY = 2; + */ + const SUGGESTED_QUERY = 2; + + private static $valueToName = [ + self::QUERY_SOURCE_UNSPECIFIED => 'QUERY_SOURCE_UNSPECIFIED', + self::AGENT_QUERY => 'AGENT_QUERY', + self::SUGGESTED_QUERY => 'SUGGESTED_QUERY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig.php new file mode 100644 index 0000000..368aeba --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig + */ +class SearchConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $boost_specs; + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter_specs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs>|\Google\Protobuf\Internal\RepeatedField $boost_specs + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs>|\Google\Protobuf\Internal\RepeatedField $filter_specs + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBoostSpecs() + { + return $this->boost_specs; + } + + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs::class); + $this->boost_specs = $arr; + + return $this; + } + + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilterSpecs() + { + return $this->filter_specs; + } + + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilterSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs::class); + $this->filter_specs = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php new file mode 100644 index 0000000..0a70436 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs + */ +class BoostSpecs extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $data_stores; + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $spec; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $data_stores + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec>|\Google\Protobuf\Internal\RepeatedField $spec + * Optional. A list of boosting specifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataStores() + { + return $this->data_stores; + } + + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataStores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_stores = $arr; + + return $this; + } + + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpec() + { + return $this->spec; + } + + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpec($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec::class); + $this->spec = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php new file mode 100644 index 0000000..899cd95 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + */ +class BoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $condition_boost_specs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $condition_boost_specs + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditionBoostSpecs() + { + return $this->condition_boost_specs; + } + + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditionBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec::class); + $this->condition_boost_specs = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php new file mode 100644 index 0000000..7cd65fc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php @@ -0,0 +1,230 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + */ +class ConditionBoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition = ''; + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost = 0.0; + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost_control_spec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $condition + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * @type float $boost + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec $boost_control_spec + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec|null + */ + public function getBoostControlSpec() + { + return $this->boost_control_spec; + } + + public function hasBoostControlSpec() + { + return isset($this->boost_control_spec); + } + + public function clearBoostControlSpec() + { + unset($this->boost_control_spec); + } + + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec $var + * @return $this + */ + public function setBoostControlSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec::class); + $this->boost_control_spec = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php new file mode 100644 index 0000000..c1af15f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + */ +class BoostControlSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $field_name = ''; + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attribute_type = 0; + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $interpolation_type = 0; + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $control_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_name + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * @type int $attribute_type + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * @type int $interpolation_type + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint>|\Google\Protobuf\Internal\RepeatedField $control_points + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFieldName() + { + return $this->field_name; + } + + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkString($var, True); + $this->field_name = $var; + + return $this; + } + + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAttributeType() + { + return $this->attribute_type; + } + + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAttributeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\AttributeType::class); + $this->attribute_type = $var; + + return $this; + } + + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInterpolationType() + { + return $this->interpolation_type; + } + + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInterpolationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\InterpolationType::class); + $this->interpolation_type = $var; + + return $this; + } + + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControlPoints() + { + return $this->control_points; + } + + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControlPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint::class); + $this->control_points = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php new file mode 100644 index 0000000..aa07719 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + */ +class AttributeType +{ + /** + * Unspecified AttributeType. + * + * Generated from protobuf enum ATTRIBUTE_TYPE_UNSPECIFIED = 0; + */ + const ATTRIBUTE_TYPE_UNSPECIFIED = 0; + /** + * The value of the numerical field will be used to dynamically + * update the boost amount. In this case, the attribute_value (the + * x value) of the control point will be the actual value of the + * numerical field for which the boost_amount is specified. + * + * Generated from protobuf enum NUMERICAL = 1; + */ + const NUMERICAL = 1; + /** + * For the freshness use case the attribute value will be the + * duration between the current time and the date in the datetime + * field specified. The value must be formatted as an XSD + * `dayTimeDuration` value (a restricted subset of an ISO 8601 + * duration value). The pattern for this is: + * `[nD][T[nH][nM][nS]]`. E.g. `5D`, `3DT12H30M`, `T24H`. + * + * Generated from protobuf enum FRESHNESS = 2; + */ + const FRESHNESS = 2; + + private static $valueToName = [ + self::ATTRIBUTE_TYPE_UNSPECIFIED => 'ATTRIBUTE_TYPE_UNSPECIFIED', + self::NUMERICAL => 'NUMERICAL', + self::FRESHNESS => 'FRESHNESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php new file mode 100644 index 0000000..ed22f21 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php @@ -0,0 +1,128 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + */ +class ControlPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attribute_value = ''; + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost_amount = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute_value + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * @type float $boost_amount + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAttributeValue() + { + return $this->attribute_value; + } + + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAttributeValue($var) + { + GPBUtil::checkString($var, True); + $this->attribute_value = $var; + + return $this; + } + + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoostAmount() + { + return $this->boost_amount; + } + + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoostAmount($var) + { + GPBUtil::checkFloat($var); + $this->boost_amount = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php new file mode 100644 index 0000000..58ef4f0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php @@ -0,0 +1,57 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + */ +class InterpolationType +{ + /** + * Interpolation type is unspecified. In this case, it defaults to + * Linear. + * + * Generated from protobuf enum INTERPOLATION_TYPE_UNSPECIFIED = 0; + */ + const INTERPOLATION_TYPE_UNSPECIFIED = 0; + /** + * Piecewise linear interpolation will be applied. + * + * Generated from protobuf enum LINEAR = 1; + */ + const LINEAR = 1; + + private static $valueToName = [ + self::INTERPOLATION_TYPE_UNSPECIFIED => 'INTERPOLATION_TYPE_UNSPECIFIED', + self::LINEAR => 'LINEAR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php new file mode 100644 index 0000000..6703c5c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs + */ +class FilterSpecs extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $data_stores; + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $data_stores + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * @type string $filter + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataStores() + { + return $this->data_stores; + } + + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataStores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_stores = $arr; + + return $this; + } + + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeResponse.php b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeResponse.php new file mode 100644 index 0000000..8e15b61 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SearchKnowledgeResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.SearchKnowledgeResponse + */ +class SearchKnowledgeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + */ + private $answers; + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + */ + protected $rewritten_query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $answers + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * @type string $rewritten_query + * The rewritten query used to search knowledge. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswers() + { + return $this->answers; + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer::class); + $this->answers = $arr; + + return $this; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @return string + */ + public function getRewrittenQuery() + { + return $this->rewritten_query; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @param string $var + * @return $this + */ + public function setRewrittenQuery($var) + { + GPBUtil::checkString($var, True); + $this->rewritten_query = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Sentiment.php b/vendor/google/cloud-dialogflow/src/V2/Sentiment.php new file mode 100644 index 0000000..2fb6df4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Sentiment.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.Sentiment + */ +class Sentiment extends \Google\Protobuf\Internal\Message +{ + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + */ + protected $magnitude = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $score + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * @type float $magnitude + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + * @return float + */ + public function getMagnitude() + { + return $this->magnitude; + } + + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + * @param float $var + * @return $this + */ + public function setMagnitude($var) + { + GPBUtil::checkFloat($var); + $this->magnitude = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisRequestConfig.php b/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisRequestConfig.php new file mode 100644 index 0000000..996d88c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisRequestConfig.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + */ +class SentimentAnalysisRequestConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + */ + protected $analyze_query_text_sentiment = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $analyze_query_text_sentiment + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + * @return bool + */ + public function getAnalyzeQueryTextSentiment() + { + return $this->analyze_query_text_sentiment; + } + + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + * @param bool $var + * @return $this + */ + public function setAnalyzeQueryTextSentiment($var) + { + GPBUtil::checkBool($var); + $this->analyze_query_text_sentiment = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisResult.php b/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisResult.php new file mode 100644 index 0000000..fc2bcf7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SentimentAnalysisResult.php @@ -0,0 +1,89 @@ +google.cloud.dialogflow.v2.SentimentAnalysisResult + */ +class SentimentAnalysisResult extends \Google\Protobuf\Internal\Message +{ + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + */ + protected $query_text_sentiment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Sentiment $query_text_sentiment + * The sentiment analysis result for `query_text`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + * @return \Google\Cloud\Dialogflow\V2\Sentiment|null + */ + public function getQueryTextSentiment() + { + return $this->query_text_sentiment; + } + + public function hasQueryTextSentiment() + { + return isset($this->query_text_sentiment); + } + + public function clearQueryTextSentiment() + { + unset($this->query_text_sentiment); + } + + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + * @param \Google\Cloud\Dialogflow\V2\Sentiment $var + * @return $this + */ + public function setQueryTextSentiment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Sentiment::class); + $this->query_text_sentiment = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SessionEntityType.php b/vendor/google/cloud-dialogflow/src/V2/SessionEntityType.php new file mode 100644 index 0000000..2e6fedf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SessionEntityType.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.SessionEntityType + */ +class SessionEntityType extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_override_mode = 0; + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @type int $entity_override_mode + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @type array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $entities + * Required. The collection of entities associated with this session entity + * type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEntityOverrideMode() + { + return $this->entity_override_mode; + } + + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEntityOverrideMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SessionEntityType\EntityOverrideMode::class); + $this->entity_override_mode = $var; + + return $this; + } + + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php b/vendor/google/cloud-dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php new file mode 100644 index 0000000..6c47ba2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode + */ +class EntityOverrideMode +{ + /** + * Not specified. This value should be never used. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + */ + const ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + /** + * The collection of session entities overrides the collection of entities + * in the corresponding custom entity type. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + */ + const ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + /** + * The collection of session entities extends the collection of entities in + * the corresponding custom entity type. + * Note: Even in this override mode calls to `ListSessionEntityTypes`, + * `GetSessionEntityType`, `CreateSessionEntityType` and + * `UpdateSessionEntityType` only return the additional entities added in + * this session entity type. If you want to get the supplemented list, + * please call + * [EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType] + * on the custom entity type and merge. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + */ + const ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + + private static $valueToName = [ + self::ENTITY_OVERRIDE_MODE_UNSPECIFIED => 'ENTITY_OVERRIDE_MODE_UNSPECIFIED', + self::ENTITY_OVERRIDE_MODE_OVERRIDE => 'ENTITY_OVERRIDE_MODE_OVERRIDE', + self::ENTITY_OVERRIDE_MODE_SUPPLEMENT => 'ENTITY_OVERRIDE_MODE_SUPPLEMENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SetAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/SetAgentRequest.php new file mode 100644 index 0000000..89ce4e6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SetAgentRequest.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.SetAgentRequest + */ +class SetAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $agent = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Agent $agent Required. The agent to update. + * + * @return \Google\Cloud\Dialogflow\V2\SetAgentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Agent $agent): self + { + return (new self()) + ->setAgent($agent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Agent $agent + * Required. The agent to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Agent|null + */ + public function getAgent() + { + return $this->agent; + } + + public function hasAgent() + { + return isset($this->agent); + } + + public function clearAgent() + { + unset($this->agent); + } + + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Agent $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Agent::class); + $this->agent = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigOperationMetadata.php new file mode 100644 index 0000000..bea2c37 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata + */ +class SetSuggestionFeatureConfigOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * @type int $participant_role + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to add or update. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp whe the request was created. The time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigRequest.php b/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigRequest.php new file mode 100644 index 0000000..ec3c749 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SetSuggestionFeatureConfigRequest.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest + */ +class SetSuggestionFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_config = null; + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * @return \Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function build(string $conversationProfile): self + { + return (new self()) + ->setConversationProfile($conversationProfile); + } + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @param int $participantRole Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\Participant\Role} + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestionFeatureConfig Required. The suggestion feature config to add or update. + * + * @return \Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function buildFromConversationProfileParticipantRoleSuggestionFeatureConfig(string $conversationProfile, int $participantRole, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestionFeatureConfig): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @type int $participant_role + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestion_feature_config + * Required. The suggestion feature config to add or update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig|null + */ + public function getSuggestionFeatureConfig() + { + return $this->suggestion_feature_config; + } + + public function hasSuggestionFeatureConfig() + { + return isset($this->suggestion_feature_config); + } + + public function clearSuggestionFeatureConfig() + { + unset($this->suggestion_feature_config); + } + + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $var + * @return $this + */ + public function setSuggestionFeatureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig::class); + $this->suggestion_feature_config = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SmartReplyAnswer.php b/vendor/google/cloud-dialogflow/src/V2/SmartReplyAnswer.php new file mode 100644 index 0000000..3a2493d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SmartReplyAnswer.php @@ -0,0 +1,155 @@ +google.cloud.dialogflow.v2.SmartReplyAnswer + */ +class SmartReplyAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + */ + protected $reply = ''; + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reply + * The content of the reply. + * @type float $confidence + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + * @return string + */ + public function getReply() + { + return $this->reply; + } + + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + * @param string $var + * @return $this + */ + public function setReply($var) + { + GPBUtil::checkString($var, True); + $this->reply = $var; + + return $this; + } + + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics.php b/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics.php new file mode 100644 index 0000000..b191f64 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics.php @@ -0,0 +1,143 @@ +google.cloud.dialogflow.v2.SmartReplyMetrics + */ +class SmartReplyMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + */ + protected $allowlist_coverage = 0.0; + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + */ + private $top_n_metrics; + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + */ + protected $conversation_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $allowlist_coverage + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * @type array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $top_n_metrics + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * @type int|string $conversation_count + * Total number of conversations used to generate this metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + * @return float + */ + public function getAllowlistCoverage() + { + return $this->allowlist_coverage; + } + + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + * @param float $var + * @return $this + */ + public function setAllowlistCoverage($var) + { + GPBUtil::checkFloat($var); + $this->allowlist_coverage = $var; + + return $this; + } + + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTopNMetrics() + { + return $this->top_n_metrics; + } + + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + * @param array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTopNMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics::class); + $this->top_n_metrics = $arr; + + return $this; + } + + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + * @return int|string + */ + public function getConversationCount() + { + return $this->conversation_count; + } + + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + * @param int|string $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt64($var); + $this->conversation_count = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics/TopNMetrics.php b/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics/TopNMetrics.php new file mode 100644 index 0000000..d2e1025 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SmartReplyMetrics/TopNMetrics.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics + */ +class TopNMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + */ + protected $n = 0; + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $n + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * @type float $recall + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + * @return int + */ + public function getN() + { + return $this->n; + } + + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + * @param int $var + * @return $this + */ + public function setN($var) + { + GPBUtil::checkInt32($var); + $this->n = $var; + + return $this; + } + + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SmartReplyModelMetadata.php b/vendor/google/cloud-dialogflow/src/V2/SmartReplyModelMetadata.php new file mode 100644 index 0000000..5de4374 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SmartReplyModelMetadata.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.SmartReplyModelMetadata + */ +class SmartReplyModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $training_model_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $training_model_type + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainingModelType() + { + return $this->training_model_type; + } + + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainingModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\ModelType::class); + $this->training_model_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SpeechContext.php b/vendor/google/cloud-dialogflow/src/V2/SpeechContext.php new file mode 100644 index 0000000..2f9398e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SpeechContext.php @@ -0,0 +1,162 @@ +google.cloud.dialogflow.v2.SpeechContext + */ +class SpeechContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $phrases; + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $phrases + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * @type float $boost + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPhrases() + { + return $this->phrases; + } + + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPhrases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrases = $arr; + + return $this; + } + + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SpeechModelVariant.php b/vendor/google/cloud-dialogflow/src/V2/SpeechModelVariant.php new file mode 100644 index 0000000..46aefc3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SpeechModelVariant.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.SpeechModelVariant + */ +class SpeechModelVariant +{ + /** + * No model variant specified. In this case Dialogflow defaults to + * USE_BEST_AVAILABLE. + * + * Generated from protobuf enum SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + */ + const SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + /** + * Use the best available variant of the [Speech model][model] that the caller + * is eligible for. + * Please see the [Dialogflow + * docs](https://cloud.google.com/dialogflow/docs/data-logging) for + * how to make your project eligible for enhanced models. + * + * Generated from protobuf enum USE_BEST_AVAILABLE = 1; + */ + const USE_BEST_AVAILABLE = 1; + /** + * Use standard model variant even if an enhanced model is available. See the + * [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + * for details about enhanced models. + * + * Generated from protobuf enum USE_STANDARD = 2; + */ + const USE_STANDARD = 2; + /** + * Use an enhanced model variant: + * * If an enhanced variant does not exist for the given + * [model][google.cloud.dialogflow.v2.InputAudioConfig.model] and request + * language, Dialogflow falls back to the standard variant. + * The [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + * describes which models have enhanced variants. + * * If the API caller isn't eligible for enhanced models, Dialogflow returns + * an error. Please see the [Dialogflow + * docs](https://cloud.google.com/dialogflow/docs/data-logging) + * for how to make your project eligible. + * + * Generated from protobuf enum USE_ENHANCED = 3; + */ + const USE_ENHANCED = 3; + + private static $valueToName = [ + self::SPEECH_MODEL_VARIANT_UNSPECIFIED => 'SPEECH_MODEL_VARIANT_UNSPECIFIED', + self::USE_BEST_AVAILABLE => 'USE_BEST_AVAILABLE', + self::USE_STANDARD => 'USE_STANDARD', + self::USE_ENHANCED => 'USE_ENHANCED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SpeechToTextConfig.php b/vendor/google/cloud-dialogflow/src/V2/SpeechToTextConfig.php new file mode 100644 index 0000000..8f7bcc8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SpeechToTextConfig.php @@ -0,0 +1,474 @@ +google.cloud.dialogflow.v2.SpeechToTextConfig + */ +class SpeechToTextConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + */ + protected $speech_model_variant = 0; + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + */ + private $phrase_sets; + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + */ + protected $audio_encoding = 0; + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + */ + protected $sample_rate_hertz = 0; + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + */ + protected $enable_word_info = false; + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + */ + protected $use_timeout_based_endpointing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $speech_model_variant + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * @type string $model + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * @type array|\Google\Protobuf\Internal\RepeatedField $phrase_sets + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * @type int $audio_encoding + * Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * @type bool $enable_word_info + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * @type bool $use_timeout_based_endpointing + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @return int + */ + public function getSpeechModelVariant() + { + return $this->speech_model_variant; + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @param int $var + * @return $this + */ + public function setSpeechModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->speech_model_variant = $var; + + return $this; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPhraseSets() + { + return $this->phrase_sets; + } + + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPhraseSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrase_sets = $arr; + + return $this; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @return bool + */ + public function getUseTimeoutBasedEndpointing() + { + return $this->use_timeout_based_endpointing; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @param bool $var + * @return $this + */ + public function setUseTimeoutBasedEndpointing($var) + { + GPBUtil::checkBool($var); + $this->use_timeout_based_endpointing = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SpeechWordInfo.php b/vendor/google/cloud-dialogflow/src/V2/SpeechWordInfo.php new file mode 100644 index 0000000..6070b60 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SpeechWordInfo.php @@ -0,0 +1,225 @@ +google.cloud.dialogflow.v2.SpeechWordInfo + */ +class SpeechWordInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + */ + protected $word = ''; + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + */ + protected $start_offset = null; + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + */ + protected $end_offset = null; + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $word + * The word this info is for. + * @type \Google\Protobuf\Duration $start_offset + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * @type \Google\Protobuf\Duration $end_offset + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * @type float $confidence + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + * @return string + */ + public function getWord() + { + return $this->word; + } + + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + * @param string $var + * @return $this + */ + public function setWord($var) + { + GPBUtil::checkString($var, True); + $this->word = $var; + + return $this; + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getStartOffset() + { + return $this->start_offset; + } + + public function hasStartOffset() + { + return isset($this->start_offset); + } + + public function clearStartOffset() + { + unset($this->start_offset); + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setStartOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->start_offset = $var; + + return $this; + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getEndOffset() + { + return $this->end_offset; + } + + public function hasEndOffset() + { + return isset($this->end_offset); + } + + public function clearEndOffset() + { + unset($this->end_offset); + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->end_offset = $var; + + return $this; + } + + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SsmlVoiceGender.php b/vendor/google/cloud-dialogflow/src/V2/SsmlVoiceGender.php new file mode 100644 index 0000000..2508c1b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SsmlVoiceGender.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.SsmlVoiceGender + */ +class SsmlVoiceGender +{ + /** + * An unspecified gender, which means that the client doesn't care which + * gender the selected voice will have. + * + * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + const SSML_VOICE_GENDER_UNSPECIFIED = 0; + /** + * A male voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_MALE = 1; + */ + const SSML_VOICE_GENDER_MALE = 1; + /** + * A female voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_FEMALE = 2; + */ + const SSML_VOICE_GENDER_FEMALE = 2; + /** + * A gender-neutral voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_NEUTRAL = 3; + */ + const SSML_VOICE_GENDER_NEUTRAL = 3; + + private static $valueToName = [ + self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', + self::SSML_VOICE_GENDER_MALE => 'SSML_VOICE_GENDER_MALE', + self::SSML_VOICE_GENDER_FEMALE => 'SSML_VOICE_GENDER_FEMALE', + self::SSML_VOICE_GENDER_NEUTRAL => 'SSML_VOICE_GENDER_NEUTRAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentRequest.php b/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentRequest.php new file mode 100644 index 0000000..8096f68 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentRequest.php @@ -0,0 +1,697 @@ +google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + */ +class StreamingAnalyzeContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $participant = ''; + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + protected $reply_audio_config = null; + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + protected $query_params = null; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + protected $assist_query_params = null; + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + */ + protected $cx_parameters = null; + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_extended_streaming = false; + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_partial_automated_agent_reply = false; + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + */ + protected $enable_debugging_info = false; + protected $config; + protected $input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $audio_config + * Instructs the speech recognizer how to process the speech audio. + * @type \Google\Cloud\Dialogflow\V2\InputTextConfig $text_config + * The natural language text to be processed. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * @type string $input_audio + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * @type string $input_text + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * @type \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $input_dtmf + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type bool $enable_extended_streaming + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * @type bool $enable_partial_automated_agent_reply + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * @type bool $enable_debugging_info + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getAudioConfig() + { + return $this->readOneof(2); + } + + public function hasAudioConfig() + { + return $this->hasOneof(2); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * @return \Google\Cloud\Dialogflow\V2\InputTextConfig|null + */ + public function getTextConfig() + { + return $this->readOneof(3); + } + + public function hasTextConfig() + { + return $this->hasOneof(3); + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * @param \Google\Cloud\Dialogflow\V2\InputTextConfig $var + * @return $this + */ + public function setTextConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputTextConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getReplyAudioConfig() + { + return $this->reply_audio_config; + } + + public function hasReplyAudioConfig() + { + return isset($this->reply_audio_config); + } + + public function clearReplyAudioConfig() + { + unset($this->reply_audio_config); + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setReplyAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->reply_audio_config = $var; + + return $this; + } + + /** + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 5; + * @return string + */ + public function getInputAudio() + { + return $this->readOneof(5); + } + + public function hasInputAudio() + { + return $this->hasOneof(5); + } + + /** + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 5; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @return string + */ + public function getInputText() + { + return $this->readOneof(6); + } + + public function hasInputText() + { + return $this->hasOneof(6); + } + + /** + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @param string $var + * @return $this + */ + public function setInputText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @return \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents|null + */ + public function getInputDtmf() + { + return $this->readOneof(9); + } + + public function hasInputDtmf() + { + return $this->hasOneof(9); + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @param \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $var + * @return $this + */ + public function setInputDtmf($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableExtendedStreaming() + { + return $this->enable_extended_streaming; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableExtendedStreaming($var) + { + GPBUtil::checkBool($var); + $this->enable_extended_streaming = $var; + + return $this; + } + + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnablePartialAutomatedAgentReply() + { + return $this->enable_partial_automated_agent_reply; + } + + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnablePartialAutomatedAgentReply($var) + { + GPBUtil::checkBool($var); + $this->enable_partial_automated_agent_reply = $var; + + return $this; + } + + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + * @return bool + */ + public function getEnableDebuggingInfo() + { + return $this->enable_debugging_info; + } + + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + * @param bool $var + * @return $this + */ + public function setEnableDebuggingInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_debugging_info = $var; + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentResponse.php b/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentResponse.php new file mode 100644 index 0000000..59c3aa8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingAnalyzeContentResponse.php @@ -0,0 +1,534 @@ += 1) messages contain + * `human_agent_suggestion_results`, `end_user_suggestion_results` or + * `message`. + * + * Generated from protobuf message google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + */ +class StreamingAnalyzeContentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + protected $recognition_result = null; + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + */ + protected $reply_text = ''; + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + protected $reply_audio = null; + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + protected $automated_agent_reply = null; + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + */ + protected $message = null; + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + */ + private $human_agent_suggestion_results; + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + */ + private $end_user_suggestion_results; + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + protected $dtmf_parameters = null; + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + */ + protected $debugging_info = null; + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + */ + protected $speech_model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $recognition_result + * The result of speech recognition. + * @type string $reply_text + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * @type \Google\Cloud\Dialogflow\V2\OutputAudio $reply_audio + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $automated_agent_reply + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * @type \Google\Cloud\Dialogflow\V2\Message $message + * Message analyzed by CCAI. + * @type array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $human_agent_suggestion_results + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * @type array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $end_user_suggestion_results + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * @type \Google\Cloud\Dialogflow\V2\DtmfParameters $dtmf_parameters + * Indicates the parameters of DTMF. + * @type \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $debugging_info + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * @type string $speech_model + * The name of the actual Cloud speech model used for speech recognition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getRecognitionResult() + { + return $this->recognition_result; + } + + public function hasRecognitionResult() + { + return isset($this->recognition_result); + } + + public function clearRecognitionResult() + { + unset($this->recognition_result); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setRecognitionResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->recognition_result = $var; + + return $this; + } + + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + * @return string + */ + public function getReplyText() + { + return $this->reply_text; + } + + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + * @param string $var + * @return $this + */ + public function setReplyText($var) + { + GPBUtil::checkString($var, True); + $this->reply_text = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * @return \Google\Cloud\Dialogflow\V2\OutputAudio|null + */ + public function getReplyAudio() + { + return $this->reply_audio; + } + + public function hasReplyAudio() + { + return isset($this->reply_audio); + } + + public function clearReplyAudio() + { + unset($this->reply_audio); + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * @param \Google\Cloud\Dialogflow\V2\OutputAudio $var + * @return $this + */ + public function setReplyAudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudio::class); + $this->reply_audio = $var; + + return $this; + } + + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentReply|null + */ + public function getAutomatedAgentReply() + { + return $this->automated_agent_reply; + } + + public function hasAutomatedAgentReply() + { + return isset($this->automated_agent_reply); + } + + public function clearAutomatedAgentReply() + { + unset($this->automated_agent_reply); + } + + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $var + * @return $this + */ + public function setAutomatedAgentReply($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply::class); + $this->automated_agent_reply = $var; + + return $this; + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->message = $var; + + return $this; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHumanAgentSuggestionResults() + { + return $this->human_agent_suggestion_results; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * @param array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHumanAgentSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->human_agent_suggestion_results = $arr; + + return $this; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndUserSuggestionResults() + { + return $this->end_user_suggestion_results; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * @param array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndUserSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->end_user_suggestion_results = $arr; + + return $this; + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * @return \Google\Cloud\Dialogflow\V2\DtmfParameters|null + */ + public function getDtmfParameters() + { + return $this->dtmf_parameters; + } + + public function hasDtmfParameters() + { + return isset($this->dtmf_parameters); + } + + public function clearDtmfParameters() + { + unset($this->dtmf_parameters); + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * @param \Google\Cloud\Dialogflow\V2\DtmfParameters $var + * @return $this + */ + public function setDtmfParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DtmfParameters::class); + $this->dtmf_parameters = $var; + + return $this; + } + + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + * @return \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo|null + */ + public function getDebuggingInfo() + { + return $this->debugging_info; + } + + public function hasDebuggingInfo() + { + return isset($this->debugging_info); + } + + public function clearDebuggingInfo() + { + unset($this->debugging_info); + } + + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + * @param \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $var + * @return $this + */ + public function setDebuggingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo::class); + $this->debugging_info = $var; + + return $this; + } + + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + * @return string + */ + public function getSpeechModel() + { + return $this->speech_model; + } + + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + * @param string $var + * @return $this + */ + public function setSpeechModel($var) + { + GPBUtil::checkString($var, True); + $this->speech_model = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentRequest.php new file mode 100644 index 0000000..ab8b801 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentRequest.php @@ -0,0 +1,523 @@ +google.cloud.dialogflow.v2.StreamingDetectIntentRequest + */ +class StreamingDetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $session = ''; + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + */ + protected $query_params = null; + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_input = null; + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @deprecated + */ + protected $single_utterance = false; + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + */ + protected $output_audio_config = null; + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + */ + protected $output_audio_config_mask = null; + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + */ + protected $input_audio = ''; + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + */ + protected $enable_debugging_info = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * The parameters of this query. + * @type \Google\Cloud\Dialogflow\V2\QueryInput $query_input + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * @type bool $single_utterance + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * @type \Google\Protobuf\FieldMask $output_audio_config_mask + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * @type string $input_audio + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * @type bool $enable_debugging_info + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\QueryInput|null + */ + public function getQueryInput() + { + return $this->query_input; + } + + public function hasQueryInput() + { + return isset($this->query_input); + } + + public function clearQueryInput() + { + unset($this->query_input); + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\QueryInput $var + * @return $this + */ + public function setQueryInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryInput::class); + $this->query_input = $var; + + return $this; + } + + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getSingleUtterance() + { + if ($this->single_utterance !== false) { + @trigger_error('single_utterance is deprecated.', E_USER_DEPRECATED); + } + return $this->single_utterance; + } + + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setSingleUtterance($var) + { + @trigger_error('single_utterance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @return \Google\Protobuf\FieldMask|null + */ + public function getOutputAudioConfigMask() + { + return $this->output_audio_config_mask; + } + + public function hasOutputAudioConfigMask() + { + return isset($this->output_audio_config_mask); + } + + public function clearOutputAudioConfigMask() + { + unset($this->output_audio_config_mask); + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setOutputAudioConfigMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->output_audio_config_mask = $var; + + return $this; + } + + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + * @return string + */ + public function getInputAudio() + { + return $this->input_audio; + } + + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->input_audio = $var; + + return $this; + } + + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + * @return bool + */ + public function getEnableDebuggingInfo() + { + return $this->enable_debugging_info; + } + + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + * @param bool $var + * @return $this + */ + public function setEnableDebuggingInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_debugging_info = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentResponse.php b/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentResponse.php new file mode 100644 index 0000000..29d710b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingDetectIntentResponse.php @@ -0,0 +1,377 @@ +google.cloud.dialogflow.v2.StreamingDetectIntentResponse + */ +class StreamingDetectIntentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + */ + protected $recognition_result = null; + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + */ + protected $query_result = null; + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + */ + protected $webhook_status = null; + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + */ + protected $output_audio = ''; + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + */ + protected $output_audio_config = null; + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + */ + protected $debugging_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_id + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $recognition_result + * The result of speech recognition. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The result of the conversational query or event processing. + * @type \Google\Rpc\Status $webhook_status + * Specifies the status of the webhook request. + * @type string $output_audio + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * The config used by the speech synthesizer to generate the output audio. + * @type \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $debugging_info + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getRecognitionResult() + { + return $this->recognition_result; + } + + public function hasRecognitionResult() + { + return isset($this->recognition_result); + } + + public function clearRecognitionResult() + { + unset($this->recognition_result); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setRecognitionResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->recognition_result = $var; + + return $this; + } + + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + * @return \Google\Rpc\Status|null + */ + public function getWebhookStatus() + { + return $this->webhook_status; + } + + public function hasWebhookStatus() + { + return isset($this->webhook_status); + } + + public function clearWebhookStatus() + { + unset($this->webhook_status); + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setWebhookStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->webhook_status = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + * @return string + */ + public function getOutputAudio() + { + return $this->output_audio; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + * @param string $var + * @return $this + */ + public function setOutputAudio($var) + { + GPBUtil::checkString($var, False); + $this->output_audio = $var; + + return $this; + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + * @return \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo|null + */ + public function getDebuggingInfo() + { + return $this->debugging_info; + } + + public function hasDebuggingInfo() + { + return isset($this->debugging_info); + } + + public function clearDebuggingInfo() + { + unset($this->debugging_info); + } + + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + * @param \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $var + * @return $this + */ + public function setDebuggingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo::class); + $this->debugging_info = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult.php b/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult.php new file mode 100644 index 0000000..705e93e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult.php @@ -0,0 +1,363 @@ +google.cloud.dialogflow.v2.StreamingRecognitionResult + */ +class StreamingRecognitionResult extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + */ + protected $message_type = 0; + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + */ + protected $transcript = ''; + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + */ + protected $is_final = false; + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + */ + private $speech_word_info; + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + */ + protected $speech_end_offset = null; + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $message_type + * Type of the result message. + * @type string $transcript + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * @type bool $is_final + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * @type float $confidence + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * @type array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $speech_word_info + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * @type \Google\Protobuf\Duration $speech_end_offset + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * @type string $language_code + * Detected language code for the transcript. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + * @return int + */ + public function getMessageType() + { + return $this->message_type; + } + + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + * @param int $var + * @return $this + */ + public function setMessageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult\MessageType::class); + $this->message_type = $var; + + return $this; + } + + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + * @return string + */ + public function getTranscript() + { + return $this->transcript; + } + + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + * @param string $var + * @return $this + */ + public function setTranscript($var) + { + GPBUtil::checkString($var, True); + $this->transcript = $var; + + return $this; + } + + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + * @return bool + */ + public function getIsFinal() + { + return $this->is_final; + } + + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + * @param bool $var + * @return $this + */ + public function setIsFinal($var) + { + GPBUtil::checkBool($var); + $this->is_final = $var; + + return $this; + } + + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechWordInfo() + { + return $this->speech_word_info; + } + + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + * @param array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechWordInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SpeechWordInfo::class); + $this->speech_word_info = $arr; + + return $this; + } + + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getSpeechEndOffset() + { + return $this->speech_end_offset; + } + + public function hasSpeechEndOffset() + { + return isset($this->speech_end_offset); + } + + public function clearSpeechEndOffset() + { + unset($this->speech_end_offset); + } + + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSpeechEndOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->speech_end_offset = $var; + + return $this; + } + + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult/MessageType.php b/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult/MessageType.php new file mode 100644 index 0000000..67985a3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/StreamingRecognitionResult/MessageType.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType + */ +class MessageType +{ + /** + * Not specified. Should never be used. + * + * Generated from protobuf enum MESSAGE_TYPE_UNSPECIFIED = 0; + */ + const MESSAGE_TYPE_UNSPECIFIED = 0; + /** + * Message contains a (possibly partial) transcript. + * + * Generated from protobuf enum TRANSCRIPT = 1; + */ + const TRANSCRIPT = 1; + /** + * This event indicates that the server has detected the end of the user's + * speech utterance and expects no additional inputs. + * Therefore, the server will not process additional audio (although it may + * subsequently return additional results). The client should stop sending + * additional audio data, half-close the gRPC connection, and wait for any + * additional results until the server closes the gRPC connection. This + * message is only sent if `single_utterance` was set to `true`, and is not + * used otherwise. + * + * Generated from protobuf enum END_OF_SINGLE_UTTERANCE = 2; + */ + const END_OF_SINGLE_UTTERANCE = 2; + + private static $valueToName = [ + self::MESSAGE_TYPE_UNSPECIFIED => 'MESSAGE_TYPE_UNSPECIFIED', + self::TRANSCRIPT => 'TRANSCRIPT', + self::END_OF_SINGLE_UTTERANCE => 'END_OF_SINGLE_UTTERANCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesRequest.php b/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesRequest.php new file mode 100644 index 0000000..aa503b5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesRequest.php @@ -0,0 +1,228 @@ +google.cloud.dialogflow.v2.SuggestArticlesRequest + */ +class SuggestArticlesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + */ + protected $assist_query_params = null; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesResponse.php b/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesResponse.php new file mode 100644 index 0000000..3d93722 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestArticlesResponse.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.SuggestArticlesResponse + */ +class SuggestArticlesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + */ + private $article_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $article_answers + * Articles ordered by score in descending order. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArticleAnswers() + { + return $this->article_answers; + } + + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArticleAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ArticleAnswer::class); + $this->article_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryRequest.php b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryRequest.php new file mode 100644 index 0000000..e648058 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryRequest.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryRequest + */ +class SuggestConversationSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $assist_query_params = null; + + /** + * @param string $conversation Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryRequest + * + * @experimental + */ + public static function build(string $conversation): self + { + return (new self()) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse.php b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse.php new file mode 100644 index 0000000..448a7f5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse.php @@ -0,0 +1,178 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryResponse + */ +class SuggestConversationSummaryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + */ + protected $summary = null; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary $summary + * Generated summary. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary|null + */ + public function getSummary() + { + return $this->summary; + } + + public function hasSummary() + { + return isset($this->summary); + } + + public function clearSummary() + { + unset($this->summary); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + * @param \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary::class); + $this->summary = $var; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse/Summary.php b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse/Summary.php new file mode 100644 index 0000000..fa38bfa --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestConversationSummaryResponse/Summary.php @@ -0,0 +1,186 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + */ + private $text_sections; + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type string $answer_record + * The name of the answer record. Format: + * "projects//answerRecords/" + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersRequest.php b/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersRequest.php new file mode 100644 index 0000000..7858270 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersRequest.php @@ -0,0 +1,224 @@ +google.cloud.dialogflow.v2.SuggestFaqAnswersRequest + */ +class SuggestFaqAnswersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + */ + protected $assist_query_params = null; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersResponse.php b/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersResponse.php new file mode 100644 index 0000000..2dc230a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestFaqAnswersResponse.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.SuggestFaqAnswersResponse + */ +class SuggestFaqAnswersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + */ + private $faq_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $faq_answers + * Answers extracted from FAQ documents. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFaqAnswers() + { + return $this->faq_answers; + } + + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + * @param array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFaqAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FaqAnswer::class); + $this->faq_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistRequest.php b/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistRequest.php new file mode 100644 index 0000000..65d133f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistRequest.php @@ -0,0 +1,214 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest + */ +class SuggestKnowledgeAssistRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $previous_suggested_query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * @type string $previous_suggested_query + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPreviousSuggestedQuery() + { + return $this->previous_suggested_query; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPreviousSuggestedQuery($var) + { + GPBUtil::checkString($var, True); + $this->previous_suggested_query = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistResponse.php b/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistResponse.php new file mode 100644 index 0000000..c153303 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestKnowledgeAssistResponse.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse + */ +class SuggestKnowledgeAssistResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $knowledge_assist_answer = null; + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $knowledge_assist_answer + * Output only. Knowledge Assist suggestion. + * @type string $latest_message + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer|null + */ + public function getKnowledgeAssistAnswer() + { + return $this->knowledge_assist_answer; + } + + public function hasKnowledgeAssistAnswer() + { + return isset($this->knowledge_assist_answer); + } + + public function clearKnowledgeAssistAnswer() + { + unset($this->knowledge_assist_answer); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $var + * @return $this + */ + public function setKnowledgeAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer::class); + $this->knowledge_assist_answer = $var; + + return $this; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesRequest.php b/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesRequest.php new file mode 100644 index 0000000..3849f06 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesRequest.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.SuggestSmartRepliesRequest + */ +class SuggestSmartRepliesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + */ + protected $current_text_input = null; + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $current_text_input + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * @type string $latest_message + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getCurrentTextInput() + { + return $this->current_text_input; + } + + public function hasCurrentTextInput() + { + return isset($this->current_text_input); + } + + public function clearCurrentTextInput() + { + unset($this->current_text_input); + } + + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setCurrentTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->current_text_input = $var; + + return $this; + } + + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesResponse.php b/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesResponse.php new file mode 100644 index 0000000..0938283 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestSmartRepliesResponse.php @@ -0,0 +1,176 @@ +google.cloud.dialogflow.v2.SuggestSmartRepliesResponse + */ +class SuggestSmartRepliesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $smart_reply_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $smart_reply_answers + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSmartReplyAnswers() + { + return $this->smart_reply_answers; + } + + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSmartReplyAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SmartReplyAnswer::class); + $this->smart_reply_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature.php b/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature.php new file mode 100644 index 0000000..f04dab6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.SuggestionFeature + */ +class SuggestionFeature extends \Google\Protobuf\Internal\Message +{ + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Type of Human Agent Assistant API feature to request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature/Type.php b/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature/Type.php new file mode 100644 index 0000000..d02c31b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestionFeature/Type.php @@ -0,0 +1,90 @@ +google.cloud.dialogflow.v2.SuggestionFeature.Type + */ +class Type +{ + /** + * Unspecified feature type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Run article suggestion model for chat. + * + * Generated from protobuf enum ARTICLE_SUGGESTION = 1; + */ + const ARTICLE_SUGGESTION = 1; + /** + * Run FAQ model for chat. + * + * Generated from protobuf enum FAQ = 2; + */ + const FAQ = 2; + /** + * Run smart reply model for chat. + * + * Generated from protobuf enum SMART_REPLY = 3; + */ + const SMART_REPLY = 3; + /** + * Run conversation summarization model for chat. + * + * Generated from protobuf enum CONVERSATION_SUMMARIZATION = 8; + */ + const CONVERSATION_SUMMARIZATION = 8; + /** + * Run knowledge search with text input from agent or text generated query. + * + * Generated from protobuf enum KNOWLEDGE_SEARCH = 14; + */ + const KNOWLEDGE_SEARCH = 14; + /** + * Run knowledge assist with automatic query generation. + * + * Generated from protobuf enum KNOWLEDGE_ASSIST = 15; + */ + const KNOWLEDGE_ASSIST = 15; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::FAQ => 'FAQ', + self::SMART_REPLY => 'SMART_REPLY', + self::CONVERSATION_SUMMARIZATION => 'CONVERSATION_SUMMARIZATION', + self::KNOWLEDGE_SEARCH => 'KNOWLEDGE_SEARCH', + self::KNOWLEDGE_ASSIST => 'KNOWLEDGE_ASSIST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestionInput.php b/vendor/google/cloud-dialogflow/src/V2/SuggestionInput.php new file mode 100644 index 0000000..bd6a714 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestionInput.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.SuggestionInput + */ +class SuggestionInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_record + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SuggestionResult.php b/vendor/google/cloud-dialogflow/src/V2/SuggestionResult.php new file mode 100644 index 0000000..9a42ba1 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SuggestionResult.php @@ -0,0 +1,249 @@ +google.cloud.dialogflow.v2.SuggestionResult + */ +class SuggestionResult extends \Google\Protobuf\Internal\Message +{ + protected $suggestion_response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $error + * Error status if the request failed. + * @type \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $suggest_articles_response + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * @type \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $suggest_knowledge_assist_response + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * @type \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $suggest_faq_answers_response + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * @type \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $suggest_smart_replies_response + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * @type \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse $generate_suggestions_response + * Suggestions generated using generators triggered by customer or agent + * messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(1); + } + + public function hasError() + { + return $this->hasOneof(1); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse|null + */ + public function getSuggestArticlesResponse() + { + return $this->readOneof(2); + } + + public function hasSuggestArticlesResponse() + { + return $this->hasOneof(2); + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @param \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $var + * @return $this + */ + public function setSuggestArticlesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @return \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse|null + */ + public function getSuggestKnowledgeAssistResponse() + { + return $this->readOneof(8); + } + + public function hasSuggestKnowledgeAssistResponse() + { + return $this->hasOneof(8); + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @param \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $var + * @return $this + */ + public function setSuggestKnowledgeAssistResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse|null + */ + public function getSuggestFaqAnswersResponse() + { + return $this->readOneof(3); + } + + public function hasSuggestFaqAnswersResponse() + { + return $this->hasOneof(3); + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @param \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $var + * @return $this + */ + public function setSuggestFaqAnswersResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse|null + */ + public function getSuggestSmartRepliesResponse() + { + return $this->readOneof(4); + } + + public function hasSuggestSmartRepliesResponse() + { + return $this->hasOneof(4); + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @param \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $var + * @return $this + */ + public function setSuggestSmartRepliesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Suggestions generated using generators triggered by customer or agent + * messages. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateSuggestionsResponse generate_suggestions_response = 9; + * @return \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse|null + */ + public function getGenerateSuggestionsResponse() + { + return $this->readOneof(9); + } + + public function hasGenerateSuggestionsResponse() + { + return $this->hasOneof(9); + } + + /** + * Suggestions generated using generators triggered by customer or agent + * messages. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateSuggestionsResponse generate_suggestions_response = 9; + * @param \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse $var + * @return $this + */ + public function setGenerateSuggestionsResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getSuggestionResponse() + { + return $this->whichOneof("suggestion_response"); + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarizationContext.php b/vendor/google/cloud-dialogflow/src/V2/SummarizationContext.php new file mode 100644 index 0000000..3b8dacc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarizationContext.php @@ -0,0 +1,185 @@ +google.cloud.dialogflow.v2.SummarizationContext + */ +class SummarizationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $few_shot_examples; + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version = ''; + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * @type array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $few_shot_examples + * Optional. List of few shot examples. + * @type string $version + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * @type string $output_language_code + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFewShotExamples() + { + return $this->few_shot_examples; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFewShotExamples($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FewShotExample::class); + $this->few_shot_examples = $arr; + + return $this; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputLanguageCode() + { + return $this->output_language_code; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->output_language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarizationSection.php b/vendor/google/cloud-dialogflow/src/V2/SummarizationSection.php new file mode 100644 index 0000000..c1ffe61 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarizationSection.php @@ -0,0 +1,139 @@ +google.cloud.dialogflow.v2.SummarizationSection + */ +class SummarizationSection extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = ''; + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $definition = ''; + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Name of the section, for example, "situation". + * @type string $definition + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * @type int $type + * Optional. Type of the summarization section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefinition($var) + { + GPBUtil::checkString($var, True); + $this->definition = $var; + + return $this; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SummarizationSection\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarizationSection/Type.php b/vendor/google/cloud-dialogflow/src/V2/SummarizationSection/Type.php new file mode 100644 index 0000000..9aecaac --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarizationSection/Type.php @@ -0,0 +1,123 @@ +google.cloud.dialogflow.v2.SummarizationSection.Type + */ +class Type +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + /** + * Customer defined sections. + * + * Generated from protobuf enum CUSTOMER_DEFINED = 7; + */ + const CUSTOMER_DEFINED = 7; + /** + * Concise version of the situation section. This type is only available if + * type SITUATION is not selected. + * + * Generated from protobuf enum SITUATION_CONCISE = 9; + */ + const SITUATION_CONCISE = 9; + /** + * Concise version of the action section. This type is only available if + * type ACTION is not selected. + * + * Generated from protobuf enum ACTION_CONCISE = 10; + */ + const ACTION_CONCISE = 10; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + self::CUSTOMER_DEFINED => 'CUSTOMER_DEFINED', + self::SITUATION_CONCISE => 'SITUATION_CONCISE', + self::ACTION_CONCISE => 'ACTION_CONCISE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarizationSectionList.php b/vendor/google/cloud-dialogflow/src/V2/SummarizationSectionList.php new file mode 100644 index 0000000..d565c6b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarizationSectionList.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarizationSectionList + */ +class SummarizationSectionList extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections + * Optional. Summarization sections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion.php b/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion.php new file mode 100644 index 0000000..5928401 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarySuggestion + */ +class SummarySuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $summary_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $summary_sections + * Required. All the parts of generated summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarySections() + { + return $this->summary_sections; + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarySections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection::class); + $this->summary_sections = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion/SummarySection.php b/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion/SummarySection.php new file mode 100644 index 0000000..bd5f9b2 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SummarySuggestion/SummarySection.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.SummarySuggestion.SummarySection + */ +class SummarySection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $section = ''; + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $summary = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Required. Name of the section. + * @type string $summary + * Required. Summary text for the section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkString($var, True); + $this->summary = $var; + + return $this; + } + +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/SynthesizeSpeechConfig.php b/vendor/google/cloud-dialogflow/src/V2/SynthesizeSpeechConfig.php new file mode 100644 index 0000000..d0507cc --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/SynthesizeSpeechConfig.php @@ -0,0 +1,269 @@ +google.cloud.dialogflow.v2.SynthesizeSpeechConfig + */ +class SynthesizeSpeechConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $speaking_rate + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * @type float $pitch + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * @type float $volume_gain_db + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * @type array|\Google\Protobuf\Internal\RepeatedField $effects_profile_id + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * @type \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $voice + * Optional. The desired voice of the synthesized audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectsProfileId() + { + return $this->effects_profile_id; + } + + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectsProfileId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effects_profile_id = $arr; + + return $this; + } + + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmf.php b/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmf.php new file mode 100644 index 0000000..c647551 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmf.php @@ -0,0 +1,160 @@ +google.cloud.dialogflow.v2.TelephonyDtmf + */ +class TelephonyDtmf +{ + /** + * Not specified. This value may be used to indicate an absent digit. + * + * Generated from protobuf enum TELEPHONY_DTMF_UNSPECIFIED = 0; + */ + const TELEPHONY_DTMF_UNSPECIFIED = 0; + /** + * Number: '1'. + * + * Generated from protobuf enum DTMF_ONE = 1; + */ + const DTMF_ONE = 1; + /** + * Number: '2'. + * + * Generated from protobuf enum DTMF_TWO = 2; + */ + const DTMF_TWO = 2; + /** + * Number: '3'. + * + * Generated from protobuf enum DTMF_THREE = 3; + */ + const DTMF_THREE = 3; + /** + * Number: '4'. + * + * Generated from protobuf enum DTMF_FOUR = 4; + */ + const DTMF_FOUR = 4; + /** + * Number: '5'. + * + * Generated from protobuf enum DTMF_FIVE = 5; + */ + const DTMF_FIVE = 5; + /** + * Number: '6'. + * + * Generated from protobuf enum DTMF_SIX = 6; + */ + const DTMF_SIX = 6; + /** + * Number: '7'. + * + * Generated from protobuf enum DTMF_SEVEN = 7; + */ + const DTMF_SEVEN = 7; + /** + * Number: '8'. + * + * Generated from protobuf enum DTMF_EIGHT = 8; + */ + const DTMF_EIGHT = 8; + /** + * Number: '9'. + * + * Generated from protobuf enum DTMF_NINE = 9; + */ + const DTMF_NINE = 9; + /** + * Number: '0'. + * + * Generated from protobuf enum DTMF_ZERO = 10; + */ + const DTMF_ZERO = 10; + /** + * Letter: 'A'. + * + * Generated from protobuf enum DTMF_A = 11; + */ + const DTMF_A = 11; + /** + * Letter: 'B'. + * + * Generated from protobuf enum DTMF_B = 12; + */ + const DTMF_B = 12; + /** + * Letter: 'C'. + * + * Generated from protobuf enum DTMF_C = 13; + */ + const DTMF_C = 13; + /** + * Letter: 'D'. + * + * Generated from protobuf enum DTMF_D = 14; + */ + const DTMF_D = 14; + /** + * Asterisk/star: '*'. + * + * Generated from protobuf enum DTMF_STAR = 15; + */ + const DTMF_STAR = 15; + /** + * Pound/diamond/hash/square/gate/octothorpe: '#'. + * + * Generated from protobuf enum DTMF_POUND = 16; + */ + const DTMF_POUND = 16; + + private static $valueToName = [ + self::TELEPHONY_DTMF_UNSPECIFIED => 'TELEPHONY_DTMF_UNSPECIFIED', + self::DTMF_ONE => 'DTMF_ONE', + self::DTMF_TWO => 'DTMF_TWO', + self::DTMF_THREE => 'DTMF_THREE', + self::DTMF_FOUR => 'DTMF_FOUR', + self::DTMF_FIVE => 'DTMF_FIVE', + self::DTMF_SIX => 'DTMF_SIX', + self::DTMF_SEVEN => 'DTMF_SEVEN', + self::DTMF_EIGHT => 'DTMF_EIGHT', + self::DTMF_NINE => 'DTMF_NINE', + self::DTMF_ZERO => 'DTMF_ZERO', + self::DTMF_A => 'DTMF_A', + self::DTMF_B => 'DTMF_B', + self::DTMF_C => 'DTMF_C', + self::DTMF_D => 'DTMF_D', + self::DTMF_STAR => 'DTMF_STAR', + self::DTMF_POUND => 'DTMF_POUND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmfEvents.php b/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmfEvents.php new file mode 100644 index 0000000..ad3a6c6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TelephonyDtmfEvents.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.TelephonyDtmfEvents + */ +class TelephonyDtmfEvents extends \Google\Protobuf\Internal\Message +{ + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + */ + private $dtmf_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $dtmf_events + * A sequence of TelephonyDtmf digits. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDtmfEvents() + { + return $this->dtmf_events; + } + + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDtmfEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TelephonyDtmf::class); + $this->dtmf_events = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TextInput.php b/vendor/google/cloud-dialogflow/src/V2/TextInput.php new file mode 100644 index 0000000..601c894 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TextInput.php @@ -0,0 +1,118 @@ +google.cloud.dialogflow.v2.TextInput + */ +class TextInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * @type string $language_code + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TextToSpeechSettings.php b/vendor/google/cloud-dialogflow/src/V2/TextToSpeechSettings.php new file mode 100644 index 0000000..ab020b9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TextToSpeechSettings.php @@ -0,0 +1,197 @@ +google.cloud.dialogflow.v2.TextToSpeechSettings + */ +class TextToSpeechSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_text_to_speech = false; + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_audio_encoding = 0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synthesize_speech_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_text_to_speech + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * @type int $output_audio_encoding + * Required. Audio encoding of the synthesized audio content. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * @type array|\Google\Protobuf\Internal\MapField $synthesize_speech_configs + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextToSpeech() + { + return $this->enable_text_to_speech; + } + + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextToSpeech($var) + { + GPBUtil::checkBool($var); + $this->enable_text_to_speech = $var; + + return $this; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOutputAudioEncoding() + { + return $this->output_audio_encoding; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOutputAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\OutputAudioEncoding::class); + $this->output_audio_encoding = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSynthesizeSpeechConfigs() + { + return $this->synthesize_speech_configs; + } + + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSynthesizeSpeechConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->synthesize_speech_configs = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TrainAgentRequest.php b/vendor/google/cloud-dialogflow/src/V2/TrainAgentRequest.php new file mode 100644 index 0000000..0f5f6c5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TrainAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.TrainAgentRequest + */ +class TrainAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to train is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\TrainAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/TriggerEvent.php b/vendor/google/cloud-dialogflow/src/V2/TriggerEvent.php new file mode 100644 index 0000000..08b1a5a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/TriggerEvent.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.TriggerEvent + */ +class TriggerEvent +{ + /** + * Default value for TriggerEvent. + * + * Generated from protobuf enum TRIGGER_EVENT_UNSPECIFIED = 0; + */ + const TRIGGER_EVENT_UNSPECIFIED = 0; + /** + * Triggers when each chat message or voice utterance ends. + * + * Generated from protobuf enum END_OF_UTTERANCE = 1; + */ + const END_OF_UTTERANCE = 1; + /** + * Triggers on the conversation manually by API calls, such as + * Conversations.GenerateStatelessSuggestion and + * Conversations.GenerateSuggestions. + * + * Generated from protobuf enum MANUAL_CALL = 2; + */ + const MANUAL_CALL = 2; + /** + * Triggers after each customer message only. + * + * Generated from protobuf enum CUSTOMER_MESSAGE = 3; + */ + const CUSTOMER_MESSAGE = 3; + /** + * Triggers after each agent message only. + * + * Generated from protobuf enum AGENT_MESSAGE = 4; + */ + const AGENT_MESSAGE = 4; + + private static $valueToName = [ + self::TRIGGER_EVENT_UNSPECIFIED => 'TRIGGER_EVENT_UNSPECIFIED', + self::END_OF_UTTERANCE => 'END_OF_UTTERANCE', + self::MANUAL_CALL => 'MANUAL_CALL', + self::CUSTOMER_MESSAGE => 'CUSTOMER_MESSAGE', + self::AGENT_MESSAGE => 'AGENT_MESSAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelOperationMetadata.php b/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelOperationMetadata.php new file mode 100644 index 0000000..95fe6f8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata + */ +class UndeployConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelRequest.php b/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelRequest.php new file mode 100644 index 0000000..fcc391d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UndeployConversationModelRequest.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.UndeployConversationModelRequest + */ +class UndeployConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateAnswerRecordRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateAnswerRecordRequest.php new file mode 100644 index 0000000..a70cc65 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateAnswerRecordRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateAnswerRecordRequest + */ +class UpdateAnswerRecordRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_record = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\AnswerRecord $answerRecord Required. Answer record to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateAnswerRecordRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\AnswerRecord $answerRecord, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AnswerRecord $answer_record + * Required. Answer record to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\AnswerRecord|null + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + public function hasAnswerRecord() + { + return isset($this->answer_record); + } + + public function clearAnswerRecord() + { + unset($this->answer_record); + } + + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\AnswerRecord $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AnswerRecord::class); + $this->answer_record = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateContextRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateContextRequest.php new file mode 100644 index 0000000..e8e4bb8 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateContextRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateContextRequest + */ +class UpdateContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $context = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Context $context Required. The context to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateContextRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Context $context, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setContext($context) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Context $context + * Required. The context to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Context|null + */ + public function getContext() + { + return $this->context; + } + + public function hasContext() + { + return isset($this->context); + } + + public function clearContext() + { + unset($this->context); + } + + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Context $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Context::class); + $this->context = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateConversationProfileRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateConversationProfileRequest.php new file mode 100644 index 0000000..3d1cf19 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateConversationProfileRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateConversationProfileRequest + */ +class UpdateConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile Required. The conversation profile to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateConversationProfileRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. The conversation profile to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateDocumentRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateDocumentRequest.php new file mode 100644 index 0000000..a7ed1d6 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateDocumentRequest.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.UpdateDocumentRequest + */ +class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Document $document Required. The document to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateDocumentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Document $document, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDocument($document) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Document $document + * Required. The document to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document::class); + $this->document = $var; + + return $this; + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateEntityTypeRequest.php new file mode 100644 index 0000000..0af3206 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateEntityTypeRequest.php @@ -0,0 +1,204 @@ +google.cloud.dialogflow.v2.UpdateEntityTypeRequest + */ +class UpdateEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_type = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateEntityTypeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\EntityType $entityType): self + { + return (new self()) + ->setEntityType($entityType); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\UpdateEntityTypeRequest + * + * @experimental + */ + public static function buildFromEntityTypeLanguageCode(\Google\Cloud\Dialogflow\V2\EntityType $entityType, string $languageCode): self + { + return (new self()) + ->setEntityType($entityType) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EntityType $entity_type + * Required. The entity type to update. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EntityType|null + */ + public function getEntityType() + { + return $this->entity_type; + } + + public function hasEntityType() + { + return isset($this->entity_type); + } + + public function clearEntityType() + { + unset($this->entity_type); + } + + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateEnvironmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateEnvironmentRequest.php new file mode 100644 index 0000000..de77205 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateEnvironmentRequest.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.UpdateEnvironmentRequest + */ +class UpdateEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_load_to_draft_and_discard_changes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Environment $environment + * Required. The environment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * @type bool $allow_load_to_draft_and_discard_changes + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowLoadToDraftAndDiscardChanges() + { + return $this->allow_load_to_draft_and_discard_changes; + } + + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowLoadToDraftAndDiscardChanges($var) + { + GPBUtil::checkBool($var); + $this->allow_load_to_draft_and_discard_changes = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateFulfillmentRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateFulfillmentRequest.php new file mode 100644 index 0000000..3688f9f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateFulfillmentRequest.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.UpdateFulfillmentRequest + */ +class UpdateFulfillmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fulfillment = null; + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment Required. The fulfillment to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateFulfillmentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment + * Required. The fulfillment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment|null + */ + public function getFulfillment() + { + return $this->fulfillment; + } + + public function hasFulfillment() + { + return isset($this->fulfillment); + } + + public function clearFulfillment() + { + unset($this->fulfillment); + } + + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $var + * @return $this + */ + public function setFulfillment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment::class); + $this->fulfillment = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateGeneratorRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateGeneratorRequest.php new file mode 100644 index 0000000..583853e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateGeneratorRequest.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.UpdateGeneratorRequest + */ +class UpdateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateGeneratorRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Generator $generator, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerator($generator) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateIntentRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateIntentRequest.php new file mode 100644 index 0000000..0d2f04d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateIntentRequest.php @@ -0,0 +1,246 @@ +google.cloud.dialogflow.v2.UpdateIntentRequest + */ +class UpdateIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $intent = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\UpdateIntentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode): self + { + return (new self()) + ->setIntent($intent) + ->setLanguageCode($languageCode); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateIntentRequest + * + * @experimental + */ + public static function buildFromIntentLanguageCodeUpdateMask(\Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setIntent($intent) + ->setLanguageCode($languageCode) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * Required. The intent to update. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateKnowledgeBaseRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateKnowledgeBaseRequest.php new file mode 100644 index 0000000..827f8ac --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateKnowledgeBaseRequest.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + */ +class UpdateKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $knowledge_base = null; + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase Required. The knowledge base to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateKnowledgeBaseRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setKnowledgeBase($knowledgeBase) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledge_base + * Required. The knowledge base to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeBase|null + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + public function hasKnowledgeBase() + { + return isset($this->knowledge_base); + } + + public function clearKnowledgeBase() + { + unset($this->knowledge_base); + } + + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_base = $var; + + return $this; + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateParticipantRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateParticipantRequest.php new file mode 100644 index 0000000..75d3294 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateParticipantRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateParticipantRequest + */ +class UpdateParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant = null; + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Participant $participant Required. The participant to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to specify which fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateParticipantRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Participant $participant, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Participant $participant + * Required. The participant to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to specify which fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Participant|null + */ + public function getParticipant() + { + return $this->participant; + } + + public function hasParticipant() + { + return isset($this->participant); + } + + public function clearParticipant() + { + unset($this->participant); + } + + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Participant $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participant = $var; + + return $this; + } + + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateSessionEntityTypeRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateSessionEntityTypeRequest.php new file mode 100644 index 0000000..27308cf --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateSessionEntityTypeRequest.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest + */ +class UpdateSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_entity_type = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateSessionEntityTypeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType): self + { + return (new self()) + ->setSessionEntityType($sessionEntityType); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateSessionEntityTypeRequest + * + * @experimental + */ + public static function buildFromSessionEntityTypeUpdateMask(\Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSessionEntityType($sessionEntityType) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType $session_entity_type + * Required. The session entity type to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SessionEntityType|null + */ + public function getSessionEntityType() + { + return $this->session_entity_type; + } + + public function hasSessionEntityType() + { + return isset($this->session_entity_type); + } + + public function clearSessionEntityType() + { + unset($this->session_entity_type); + } + + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $var + * @return $this + */ + public function setSessionEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_type = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/UpdateVersionRequest.php b/vendor/google/cloud-dialogflow/src/V2/UpdateVersionRequest.php new file mode 100644 index 0000000..a5327be --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/UpdateVersionRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.UpdateVersionRequest + */ +class UpdateVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $version = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Version $version Required. The version to update. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateVersionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Version $version, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setVersion($version) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Version $version + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Version|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Version $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Version::class); + $this->version = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ValidationError.php b/vendor/google/cloud-dialogflow/src/V2/ValidationError.php new file mode 100644 index 0000000..77f102d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ValidationError.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.ValidationError + */ +class ValidationError extends \Google\Protobuf\Internal\Message +{ + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + */ + protected $severity = 0; + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + */ + private $entries; + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $severity + * The severity of the error. + * @type array|\Google\Protobuf\Internal\RepeatedField $entries + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * @type string $error_message + * The detailed error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ValidationResult::initOnce(); + parent::__construct($data); + } + + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ValidationError\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entries = $arr; + + return $this; + } + + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/ValidationError/Severity.php b/vendor/google/cloud-dialogflow/src/V2/ValidationError/Severity.php new file mode 100644 index 0000000..cb39693 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ValidationError/Severity.php @@ -0,0 +1,76 @@ +google.cloud.dialogflow.v2.ValidationError.Severity + */ +class Severity +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * The agent doesn't follow Dialogflow best practices. + * + * Generated from protobuf enum INFO = 1; + */ + const INFO = 1; + /** + * The agent may not behave as expected. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * The agent may experience partial failures. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + /** + * The agent may completely fail. + * + * Generated from protobuf enum CRITICAL = 4; + */ + const CRITICAL = 4; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + self::CRITICAL => 'CRITICAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/ValidationResult.php b/vendor/google/cloud-dialogflow/src/V2/ValidationResult.php new file mode 100644 index 0000000..2ccd637 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/ValidationResult.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ValidationResult + */ +class ValidationResult extends \Google\Protobuf\Internal\Message +{ + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + */ + private $validation_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $validation_errors + * Contains all validation errors. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ValidationResult::initOnce(); + parent::__construct($data); + } + + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValidationErrors() + { + return $this->validation_errors; + } + + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + * @param array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValidationErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ValidationError::class); + $this->validation_errors = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Version.php b/vendor/google/cloud-dialogflow/src/V2/Version.php new file mode 100644 index 0000000..8e7a86f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Version.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.Version + */ +class Version extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $version_number = 0; + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type string $description + * Optional. The developer-provided description of this version. + * @type int $version_number + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * @type int $status + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getVersionNumber() + { + return $this->version_number; + } + + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setVersionNumber($var) + { + GPBUtil::checkInt32($var); + $this->version_number = $var; + + return $this; + } + + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Version\VersionStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/Version/VersionStatus.php b/vendor/google/cloud-dialogflow/src/V2/Version/VersionStatus.php new file mode 100644 index 0000000..1a44423 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/Version/VersionStatus.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Version.VersionStatus + */ +class VersionStatus +{ + /** + * Not specified. This value is not used. + * + * Generated from protobuf enum VERSION_STATUS_UNSPECIFIED = 0; + */ + const VERSION_STATUS_UNSPECIFIED = 0; + /** + * Version is not ready to serve (e.g. training is in progress). + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Version is ready to serve. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * Version training failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::VERSION_STATUS_UNSPECIFIED => 'VERSION_STATUS_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::READY => 'READY', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/cloud-dialogflow/src/V2/VoiceSelectionParams.php b/vendor/google/cloud-dialogflow/src/V2/VoiceSelectionParams.php new file mode 100644 index 0000000..cf03464 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/VoiceSelectionParams.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssml_gender = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * @type int $ssml_gender + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/WebhookRequest.php b/vendor/google/cloud-dialogflow/src/V2/WebhookRequest.php new file mode 100644 index 0000000..e00b19d --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/WebhookRequest.php @@ -0,0 +1,217 @@ +google.cloud.dialogflow.v2.WebhookRequest + */ +class WebhookRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + */ + protected $session = ''; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + */ + protected $query_result = null; + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + */ + protected $original_detect_intent_request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * @type string $response_id + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * @type \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest $original_detect_intent_request + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + * @return \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest|null + */ + public function getOriginalDetectIntentRequest() + { + return $this->original_detect_intent_request; + } + + public function hasOriginalDetectIntentRequest() + { + return isset($this->original_detect_intent_request); + } + + public function clearOriginalDetectIntentRequest() + { + unset($this->original_detect_intent_request); + } + + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + * @param \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest $var + * @return $this + */ + public function setOriginalDetectIntentRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest::class); + $this->original_detect_intent_request = $var; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/WebhookResponse.php b/vendor/google/cloud-dialogflow/src/V2/WebhookResponse.php new file mode 100644 index 0000000..df629dd --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/WebhookResponse.php @@ -0,0 +1,430 @@ +google.cloud.dialogflow.v2.WebhookResponse + */ +class WebhookResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + */ + protected $fulfillment_text = ''; + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + */ + private $fulfillment_messages; + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + */ + protected $source = ''; + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + */ + protected $payload = null; + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + */ + private $output_contexts; + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + */ + protected $followup_event_input = null; + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + */ + private $session_entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fulfillment_text + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $fulfillment_messages + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * @type string $source + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * @type \Google\Protobuf\Struct $payload + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * @type array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $output_contexts + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * @type \Google\Cloud\Dialogflow\V2\EventInput $followup_event_input + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * @type array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $session_entity_types + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + * @return string + */ + public function getFulfillmentText() + { + return $this->fulfillment_text; + } + + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + * @param string $var + * @return $this + */ + public function setFulfillmentText($var) + { + GPBUtil::checkString($var, True); + $this->fulfillment_text = $var; + + return $this; + } + + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFulfillmentMessages() + { + return $this->fulfillment_messages; + } + + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + * @param array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFulfillmentMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->fulfillment_messages = $arr; + + return $this; + } + + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + * @param array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getFollowupEventInput() + { + return $this->followup_event_input; + } + + public function hasFollowupEventInput() + { + return isset($this->followup_event_input); + } + + public function clearFollowupEventInput() + { + unset($this->followup_event_input); + } + + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setFollowupEventInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->followup_event_input = $var; + + return $this; + } + + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + * @param array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + +} + diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/agents_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/agents_client_config.json new file mode 100644 index 0000000..a03813a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/agents_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Agents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RestoreAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchAgents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TrainAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/agents_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/agents_descriptor_config.php new file mode 100644 index 0000000..defc3e4 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/agents_descriptor_config.php @@ -0,0 +1,214 @@ + [ + 'google.cloud.dialogflow.v2.Agents' => [ + 'ExportAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ExportAgentResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ImportAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'TrainAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Agent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetValidationResult' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ValidationResult', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAgents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAgents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchAgentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Agent', + 'headerParams' => [ + [ + 'keyName' => 'agent.parent', + 'fieldAccessors' => [ + 'getAgent', + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/agents_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/agents_rest_client_config.php new file mode 100644 index 0000000..5892818 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/agents_rest_client_config.php @@ -0,0 +1,270 @@ + [ + 'google.cloud.dialogflow.v2.Agents' => [ + 'DeleteAgent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ExportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetAgent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetValidationResult' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent/validationResult', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent/validationResult', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ImportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:restore', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:restore', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAgents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*}/agent', + 'body' => 'agent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*/locations/*}/agent', + 'body' => 'agent', + ], + ], + 'placeholders' => [ + 'agent.parent' => [ + 'getters' => [ + 'getAgent', + 'getParent', + ], + ], + ], + ], + 'TrainAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:train', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:train', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_client_config.json new file mode 100644 index 0000000..2114a79 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.AnswerRecords": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ListAnswerRecords": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_descriptor_config.php new file mode 100644 index 0000000..0643ed7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_descriptor_config.php @@ -0,0 +1,118 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAnswerRecords', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListAnswerRecordsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnswerRecord', + 'headerParams' => [ + [ + 'keyName' => 'answer_record.name', + 'fieldAccessors' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_rest_client_config.php new file mode 100644 index 0000000..7de0cd7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/answer_records_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/answerRecords', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/answerRecords', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/answerRecords/*}', + 'body' => 'answer_record', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}', + 'body' => 'answer_record', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'answer_record.name' => [ + 'getters' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/contexts_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_client_config.json new file mode 100644 index 0000000..4058247 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Contexts": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteAllContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/contexts_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_descriptor_config.php new file mode 100644 index 0000000..7721b42 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getContexts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListContextsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'context.name', + 'fieldAccessors' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/contexts_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_rest_client_config.php new file mode 100644 index 0000000..3bdd5f5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/contexts_rest_client_config.php @@ -0,0 +1,265 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'context.name' => [ + 'getters' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_client_config.json new file mode 100644 index 0000000..bbee4ea --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationDatasets": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportConversationData": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_descriptor_config.php new file mode 100644 index 0000000..8d3a733 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationDataset', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationDataset', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationDatasets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationDatasetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_rest_client_config.php new file mode 100644 index 0000000..dd33819 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_datasets_rest_client_config.php @@ -0,0 +1,182 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + 'body' => 'conversation_dataset', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationDatasets', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_client_config.json new file mode 100644 index 0000000..ecdf8c5 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationModels": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModelEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UndeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_descriptor_config.php new file mode 100644 index 0000000..0e27466 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_descriptor_config.php @@ -0,0 +1,233 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModel', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\UndeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModelEvaluations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationModelEvaluation' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_rest_client_config.php new file mode 100644 index 0000000..07221b0 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_models_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'body' => 'conversation_model', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + 'body' => 'conversation_model', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:deploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:deploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*/evaluations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversationModels/*}/evaluations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:undeploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_client_config.json new file mode 100644 index 0000000..2898ad3 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationProfiles": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ClearSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_descriptor_config.php new file mode 100644 index 0000000..3c85601 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile.name', + 'fieldAccessors' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'cXSecuritySettings' => 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_rest_client_config.php new file mode 100644 index 0000000..c94b53f --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversation_profiles_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + 'body' => 'conversation_profile', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'conversation_profile.name' => [ + 'getters' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversations_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_client_config.json new file mode 100644 index 0000000..a80f967 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Conversations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CompleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSuggestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateSuggestions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "IngestContextReferences": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMessages": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchKnowledge": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestConversationSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversations_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_descriptor_config.php new file mode 100644 index 0000000..bd1dd07 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_descriptor_config.php @@ -0,0 +1,248 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'stateless_conversation.parent', + 'fieldAccessors' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + 'GenerateSuggestions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'GetConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'IngestContextReferences' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\IngestContextReferencesResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'ListConversations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMessages', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListMessagesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchKnowledgeResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'cXSecuritySettings' => 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + 'conversation' => 'projects/{project}/conversations/{conversation}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'dataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectConversation' => 'projects/{project}/conversations/{conversation}', + 'projectConversationMessage' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'projectLocationConversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', + 'projectLocationConversationMessage' => 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/conversations_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_rest_client_config.php new file mode 100644 index 0000000..3f04379 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/conversations_rest_client_config.php @@ -0,0 +1,311 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}:complete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}:complete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversations', + 'body' => 'conversation', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversations', + 'body' => 'conversation', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'stateless_conversation.parent' => [ + 'getters' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + 'GenerateSuggestions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:generate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + 'GetConversation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'IngestContextReferences' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences', + 'body' => '*', + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + 'ListConversations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/messages', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/messages', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/suggestions:searchKnowledge', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/documents_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/documents_client_config.json new file mode 100644 index 0000000..aaddca9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/documents_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Documents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReloadDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/documents_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/documents_descriptor_config.php new file mode 100644 index 0000000..8e0d426 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/documents_descriptor_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'document.name', + 'fieldAccessors' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Document', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDocuments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDocuments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListDocumentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/documents_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/documents_rest_client_config.php new file mode 100644 index 0000000..bf1567c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/documents_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + 'body' => 'document', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDocuments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'document.name' => [ + 'getters' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_client_config.json new file mode 100644 index 0000000..ad9d113 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EncryptionSpecService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InitializeEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_descriptor_config.php new file mode 100644 index 0000000..c5e9e4a --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_descriptor_config.php @@ -0,0 +1,97 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'InitializeEncryptionSpec' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'encryption_spec.name', + 'fieldAccessors' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + 'GetEncryptionSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EncryptionSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_rest_client_config.php new file mode 100644 index 0000000..19e3f25 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/encryption_spec_service_rest_client_config.php @@ -0,0 +1,130 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'GetEncryptionSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/encryptionSpec}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InitializeEncryptionSpec' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize', + 'body' => '*', + 'placeholders' => [ + 'encryption_spec.name' => [ + 'getters' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_client_config.json new file mode 100644 index 0000000..0380bfe --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchCreateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_descriptor_config.php new file mode 100644 index 0000000..439d085 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_descriptor_config.php @@ -0,0 +1,234 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateEntityTypesResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'entity_type.name', + 'fieldAccessors' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'entityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEntityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEntityType' => 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_rest_client_config.php new file mode 100644 index 0000000..ab9710b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/entity_types_rest_client_config.php @@ -0,0 +1,291 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/agent/entityTypes/*}', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'entity_type.name' => [ + 'getters' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/environments_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/environments_client_config.json new file mode 100644 index 0000000..00d6f74 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/environments_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Environments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironmentHistory": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/environments_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/environments_descriptor_config.php new file mode 100644 index 0000000..a1b2fc7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/environments_descriptor_config.php @@ -0,0 +1,165 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EnvironmentHistory', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEnvironments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEnvironmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'environment.name', + 'fieldAccessors' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'environment' => 'projects/{project}/agent/environments/{environment}', + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironment' => 'projects/{project}/agent/environments/{environment}', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironment' => 'projects/{project}/locations/{location}/agent/environments/{environment}', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/environments_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/environments_rest_client_config.php new file mode 100644 index 0000000..5c67335 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/environments_rest_client_config.php @@ -0,0 +1,225 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + 'body' => 'environment', + 'queryParams' => [ + 'environment_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'environment_id', + ], + ], + 'DeleteEnvironment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/history', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/history', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/agent/environments/*}', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/locations/*/agent/environments/*}', + 'body' => 'environment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'environment.name' => [ + 'getters' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_client_config.json new file mode 100644 index 0000000..8e6cc14 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Fulfillments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_descriptor_config.php new file mode 100644 index 0000000..52aae4e --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_descriptor_config.php @@ -0,0 +1,92 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'fulfillment.name', + 'fieldAccessors' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_rest_client_config.php new file mode 100644 index 0000000..5969b7b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/fulfillments_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/fulfillment}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/fulfillment}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'fulfillment.name' => [ + 'getters' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/generators_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/generators_client_config.json new file mode 100644 index 0000000..d4ccea7 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/generators_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Generators": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGenerators": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/generators_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/generators_descriptor_config.php new file mode 100644 index 0000000..f1630ff --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/generators_descriptor_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGenerators', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListGeneratorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'generator.name', + 'fieldAccessors' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/generators_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/generators_rest_client_config.php new file mode 100644 index 0000000..701f901 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/generators_rest_client_config.php @@ -0,0 +1,177 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'body' => 'generator', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + 'body' => 'generator', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generator.name=projects/*/locations/*/generators/*}', + 'body' => 'generator', + 'placeholders' => [ + 'generator.name' => [ + 'getters' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/intents_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/intents_client_config.json new file mode 100644 index 0000000..f6d3f00 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/intents_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Intents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchDeleteIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/intents_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/intents_descriptor_config.php new file mode 100644 index 0000000..46fd848 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/intents_descriptor_config.php @@ -0,0 +1,187 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateIntentsResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIntents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListIntentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'intent.name', + 'fieldAccessors' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/intents_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/intents_rest_client_config.php new file mode 100644 index 0000000..cbf4e4b --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/intents_rest_client_config.php @@ -0,0 +1,242 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/intents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/agent/intents/*}', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/locations/*/agent/intents/*}', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'intent.name' => [ + 'getters' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_client_config.json new file mode 100644 index 0000000..8b18c4c --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.KnowledgeBases": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListKnowledgeBases": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_descriptor_config.php new file mode 100644 index 0000000..d46a454 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_descriptor_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getKnowledgeBases', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListKnowledgeBasesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'knowledge_base.name', + 'fieldAccessors' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_rest_client_config.php new file mode 100644 index 0000000..5261533 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/knowledge_bases_rest_client_config.php @@ -0,0 +1,218 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'knowledge_base.name' => [ + 'getters' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/participants_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/participants_client_config.json new file mode 100644 index 0000000..a96ad60 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/participants_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Participants": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + } + }, + "methods": { + "AnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "CreateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListParticipants": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamingAnalyzeContent": { + "timeout_millis": 220000 + }, + "SuggestArticles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestFaqAnswers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestKnowledgeAssist": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestSmartReplies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/participants_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/participants_descriptor_config.php new file mode 100644 index 0000000..f1e1da9 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/participants_descriptor_config.php @@ -0,0 +1,213 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnalyzeContentResponse', + 'headerParams' => [ + [ + 'keyName' => 'participant', + 'fieldAccessors' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getParticipants', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListParticipantsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'StreamingAnalyzeContent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\StreamingAnalyzeContentResponse', + ], + 'SuggestArticles' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestArticlesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'participant.name', + 'fieldAccessors' => [ + 'getParticipant', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'conversation' => 'projects/{project}/conversations/{conversation}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'participant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'projectConversation' => 'projects/{project}/conversations/{conversation}', + 'projectConversationMessage' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'projectConversationParticipant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationConversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', + 'projectLocationConversationMessage' => 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}', + 'projectLocationConversationParticipant' => 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/participants_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/participants_rest_client_config.php new file mode 100644 index 0000000..9d63307 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/participants_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'participant' => [ + 'getters' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + 'body' => 'participant', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*/participants/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*/participants/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestArticles' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/conversations/*/participants/*}', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}', + 'body' => 'participant', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'participant.name' => [ + 'getters' => [ + 'getParticipant', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_client_config.json new file mode 100644 index 0000000..521ba47 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.SessionEntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_descriptor_config.php new file mode 100644 index 0000000..a021087 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_descriptor_config.php @@ -0,0 +1,143 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSessionEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListSessionEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'session_entity_type.name', + 'fieldAccessors' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_rest_client_config.php new file mode 100644 index 0000000..e940467 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/session_entity_types_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'session_entity_type.name' => [ + 'getters' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/sessions_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_client_config.json new file mode 100644 index 0000000..4967706 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Sessions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + } + }, + "methods": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000 + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/sessions_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_descriptor_config.php new file mode 100644 index 0000000..259a3ce --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_descriptor_config.php @@ -0,0 +1,99 @@ + [ + 'google.cloud.dialogflow.v2.Sessions' => [ + 'DetectIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\DetectIntentResponse', + 'headerParams' => [ + [ + 'keyName' => 'session', + 'fieldAccessors' => [ + 'getSession', + ], + ], + ], + ], + 'StreamingDetectIntent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\StreamingDetectIntentResponse', + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/sessions_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_rest_client_config.php new file mode 100644 index 0000000..70c3620 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/sessions_rest_client_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.Sessions' => [ + 'DetectIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/sessions/*}:detectIntent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'session' => [ + 'getters' => [ + 'getSession', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/versions_client_config.json b/vendor/google/cloud-dialogflow/src/V2/resources/versions_client_config.json new file mode 100644 index 0000000..e4e6368 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/versions_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Versions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/versions_descriptor_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/versions_descriptor_config.php new file mode 100644 index 0000000..163ab35 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/versions_descriptor_config.php @@ -0,0 +1,139 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'version.name', + 'fieldAccessors' => [ + 'getVersion', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'projectAgent' => 'projects/{project}/agent', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/vendor/google/cloud-dialogflow/src/V2/resources/versions_rest_client_config.php b/vendor/google/cloud-dialogflow/src/V2/resources/versions_rest_client_config.php new file mode 100644 index 0000000..e1ce104 --- /dev/null +++ b/vendor/google/cloud-dialogflow/src/V2/resources/versions_rest_client_config.php @@ -0,0 +1,202 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + 'body' => 'version', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/agent/versions/*}', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/locations/*/agent/versions/*}', + 'body' => 'version', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'version.name' => [ + 'getters' => [ + 'getVersion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/vendor/google/common-protos/CHANGELOG.md b/vendor/google/common-protos/CHANGELOG.md new file mode 100644 index 0000000..f1d61e3 --- /dev/null +++ b/vendor/google/common-protos/CHANGELOG.md @@ -0,0 +1,87 @@ +# Changelog + +## [4.5.0](https://github.com/googleapis/common-protos-php/compare/v4.4.0...v4.5.0) (2023-11-29) + + +### Features + +* Add auto_populated_fields to google.api.MethodSettings ([#74](https://github.com/googleapis/common-protos-php/issues/74)) ([d739417](https://github.com/googleapis/common-protos-php/commit/d7394176eb95f0e92af4e93746dba8f515ba9bc2)) + +## [4.4.0](https://github.com/googleapis/common-protos-php/compare/v4.3.0...v4.4.0) (2023-10-02) + + +### Features + +* Public google.api.FieldInfo type and extension ([#71](https://github.com/googleapis/common-protos-php/issues/71)) ([4002074](https://github.com/googleapis/common-protos-php/commit/40020744c65e7561dec08e1cd2994afcc51ec771)) + +## [4.3.0](https://github.com/googleapis/common-protos-php/compare/v4.2.0...v4.3.0) (2023-08-22) + + +### Features + +* Add new FieldBehavior value IDENTIFIER ([#67](https://github.com/googleapis/common-protos-php/issues/67)) ([6c6c21f](https://github.com/googleapis/common-protos-php/commit/6c6c21fc4a2f4711aeddad11082ed17acaf4733c)) + +## [4.2.0](https://github.com/googleapis/common-protos-php/compare/v4.1.0...v4.2.0) (2023-07-25) + + +### Features + +* Add a proto message to describe the `resource_type` and `resource_permission` for an API method ([#64](https://github.com/googleapis/common-protos-php/issues/64)) ([8a0ff5f](https://github.com/googleapis/common-protos-php/commit/8a0ff5f9ffcf3683fc4718e85e97f45a001a1925)) + +## [4.1.0](https://github.com/googleapis/common-protos-php/compare/v4.0.0...v4.1.0) (2023-05-06) + + +### Features + +* Add ConfigServiceV2.CreateBucketAsync method for creating Log Buckets asynchronously ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add ConfigServiceV2.CreateLink method for creating linked datasets for Log Analytics Buckets ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add ConfigServiceV2.DeleteLink method for deleting linked datasets ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add ConfigServiceV2.GetLink methods for describing linked datasets ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add ConfigServiceV2.ListLinks method for listing linked datasets ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add ConfigServiceV2.UpdateBucketAsync method for creating Log Buckets asynchronously ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add LogBucket.analytics_enabled field that specifies whether Log Bucket's Analytics features are enabled ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Add LogBucket.index_configs field that contains a list of Log Bucket's indexed fields and related configuration data ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) +* Log Analytics features of the Cloud Logging API ([#60](https://github.com/googleapis/common-protos-php/issues/60)) ([b18d554](https://github.com/googleapis/common-protos-php/commit/b18d55421cbe1e55d62b5d149e56be23db8c4286)) + +## [4.0.0](https://github.com/googleapis/common-protos-php/compare/v3.2.0...v4.0.0) (2023-05-01) + + +### ⚠ BREAKING CHANGES + +* remove files unknown to owlbot ([#59](https://github.com/googleapis/common-protos-php/issues/59)) +* add owlbot automated updates ([#54](https://github.com/googleapis/common-protos-php/issues/54)) + +### Features + +* Add owlbot automated updates ([#54](https://github.com/googleapis/common-protos-php/issues/54)) ([6d9134d](https://github.com/googleapis/common-protos-php/commit/6d9134d2f927e9c4aa3165e823477e25ef8ff38f)) +* Regenerate all common protos from new owlbot config ([#58](https://github.com/googleapis/common-protos-php/issues/58)) ([5dac653](https://github.com/googleapis/common-protos-php/commit/5dac653bdd60c4dbaec45e73e0ec487e5aeac9b1)) + + +### Miscellaneous Chores + +* Remove files unknown to owlbot ([#59](https://github.com/googleapis/common-protos-php/issues/59)) ([f541342](https://github.com/googleapis/common-protos-php/commit/f54134263a142e278c56f5e03e5a3d8c6f72aac3)) + +## [3.2.0](https://github.com/googleapis/common-protos-php/compare/v3.1.0...v3.2.0) (2023-01-12) + + +### Features + +* Refresh types ([#49](https://github.com/googleapis/common-protos-php/issues/49)) ([bd71fc0](https://github.com/googleapis/common-protos-php/commit/bd71fc05cbca1ccd94b71a42c227f0d69c688f07)) + +## [3.1.0](https://github.com/googleapis/common-protos-php/compare/v3.0.0...v3.1.0) (2022-10-05) + + +### Features + +* Make autoloader more efficient ([#45](https://github.com/googleapis/common-protos-php/issues/45)) ([cdff58a](https://github.com/googleapis/common-protos-php/commit/cdff58a3ff6c42e461f18f14c0bbd8e171456924)) + +## [3.0.0](https://github.com/googleapis/common-protos-php/compare/2.1.0...v3.0.0) (2022-07-29) + + +### ⚠ BREAKING CHANGES + +* remove longrunning classes from common protos (#41) + +### Miscellaneous Chores + +* remove longrunning classes from common protos ([#41](https://github.com/googleapis/common-protos-php/issues/41)) ([e88dd1d](https://github.com/googleapis/common-protos-php/commit/e88dd1d5dfef93358dc0bd7f3d62d09bbfd750b6)) diff --git a/vendor/google/common-protos/CODE_OF_CONDUCT.md b/vendor/google/common-protos/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..46b2a08 --- /dev/null +++ b/vendor/google/common-protos/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/vendor/google/common-protos/CONTRIBUTING.md b/vendor/google/common-protos/CONTRIBUTING.md new file mode 100644 index 0000000..23c9455 --- /dev/null +++ b/vendor/google/common-protos/CONTRIBUTING.md @@ -0,0 +1,45 @@ +## Contributing + +We are pleased that you are interested in contributing to our work. + +### Generated Protocol Buffer Classes + +The classes in this repository are generated by the protocol buffer +compiler, as known as protoc. As such, we can not accept contributions +directly to these generated classes. Instead, changes should be +suggested upstream in the [API Common Protos][api-common-protos] +repository. + + +### Documentation + +We want for both protocol buffers and the types that we have provided here +to be understandable to everyone, including to those who may be unfamiliar +with the ecosystem or concepts. + +That means we want our documentation to be better, and welcome anyone +willing to help with this. For documentation in the generated classes, please +open a pull request against the [API Common Protos][api-common-protos] +repository. + +Any improvements to READMEs or other non-generated documentation or +development scripts in this repository would be greatly appreciated - please +open a pull request. + + +## Contributor License Agreement + +Before we can accept your pull requests, you will need to sign a Contributor +License Agreement (CLA): + + - **If you are an individual writing original source code** and **you own the + intellectual property**, then you need to sign an [individual CLA][]. + - **If you work for a company that wants to allow you to contribute your + work**, then you need to sign a [corporate CLA][]. + +You can sign these electronically (just scroll to the bottom). After that, +we'll be able to accept your pull requests. + + [individual CLA]: https://developers.google.com/open-source/cla/individual + [corporate CLA]: https://developers.google.com/open-source/cla/corporate + [api-common-protos]: https://github.com/googleapis/api-common-protos \ No newline at end of file diff --git a/vendor/google/common-protos/LICENSE b/vendor/google/common-protos/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/vendor/google/common-protos/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/vendor/google/common-protos/README.md b/vendor/google/common-protos/README.md new file mode 100644 index 0000000..6dd98ef --- /dev/null +++ b/vendor/google/common-protos/README.md @@ -0,0 +1,41 @@ +## Common Protos PHP + +[![Latest Stable Version](https://poser.pugx.org/google/common-protos/v/stable)](https://packagist.org/packages/google/common-protos) [![Packagist](https://img.shields.io/packagist/dm/google/common-protos.svg)](https://packagist.org/packages/google/common-protos) + +* [API documentation](https://cloud.google.com/php/docs/reference/common-protos/latest) + +This repository is a home for the [protocol buffer][protobuf] types which are +common dependencies throughout the Google API ecosystem, generated for PHP. +The protobuf definitions for these generated PHP classes are provided by the +[Common Components AIP][common-components-aip] repository. + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +## Using these generated classes + +These classes are made available under an Apache license (see `LICENSE`) and +you are free to depend on them within your applications. They are +considered stable and will not change in backwards-incompaible ways. + +They are distributed as the [google/common-protos][packagist-common-protos] +composer package, available on [Packagist][packagist]. + +In order to depend on these classes, use composer from the command line in order +to add this package to your `composer.json` file in the `requires` section: + +```bash +composer require google/common-protos +``` + +## License + +These classes are licensed using the Apache 2.0 software license, a +permissive, copyfree license. You are free to use them in your applications +provided the license terms are honored. + +[protobuf]: https://developers.google.com/protocol-buffers/ +[common-components-aip]: https://google.aip.dev/213 +[packagist-common-protos]: https://packagist.org/packages/google/common-protos/ +[packagist]: https://packagist.org/ diff --git a/vendor/google/common-protos/SECURITY.md b/vendor/google/common-protos/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/vendor/google/common-protos/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/common-protos/VERSION b/vendor/google/common-protos/VERSION new file mode 100644 index 0000000..23297c3 --- /dev/null +++ b/vendor/google/common-protos/VERSION @@ -0,0 +1 @@ +4.12.4 diff --git a/vendor/google/common-protos/composer.json b/vendor/google/common-protos/composer.json new file mode 100644 index 0000000..a69cf25 --- /dev/null +++ b/vendor/google/common-protos/composer.json @@ -0,0 +1,41 @@ +{ + "name": "google/common-protos", + "type": "library", + "description": "Google API Common Protos for PHP", + "version": "4.12.4", + "keywords": [ + "google" + ], + "homepage": "https://github.com/googleapis/common-protos-php", + "license": "Apache-2.0", + "require": { + "php": "^8.1", + "google/protobuf": "^4.31" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "autoload": { + "psr-4": { + "Google\\Api\\": "src/Api", + "Google\\Cloud\\": "src/Cloud", + "Google\\Iam\\": "src/Iam", + "Google\\Rpc\\": "src/Rpc", + "Google\\Type\\": "src/Type", + "GPBMetadata\\Google\\Api\\": "metadata/Api", + "GPBMetadata\\Google\\Cloud\\": "metadata/Cloud", + "GPBMetadata\\Google\\Iam\\": "metadata/Iam", + "GPBMetadata\\Google\\Logging\\": "metadata/Logging", + "GPBMetadata\\Google\\Rpc\\": "metadata/Rpc", + "GPBMetadata\\Google\\Type\\": "metadata/Type" + } + }, + "extra": { + "component": { + "id": "common-protos", + "target": "googleapis/common-protos-php.git", + "path": "CommonProtos", + "entry": "README.md" + } + } +} diff --git a/vendor/google/common-protos/metadata/Api/Annotations.php b/vendor/google/common-protos/metadata/Api/Annotations.php new file mode 100644 index 0000000..7bec22e --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Annotations.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' + +google/api/annotations.proto +google.api google/protobuf/descriptor.protoBn +com.google.apiBAnnotationsProtoPZAgoogle.golang.org/genproto/googleapis/api/annotations;annotationsGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Auth.php b/vendor/google/common-protos/metadata/Api/Auth.php new file mode 100644 index 0000000..7240db8 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Auth.php differ diff --git a/vendor/google/common-protos/metadata/Api/Backend.php b/vendor/google/common-protos/metadata/Api/Backend.php new file mode 100644 index 0000000..6d50482 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Backend.php differ diff --git a/vendor/google/common-protos/metadata/Api/Billing.php b/vendor/google/common-protos/metadata/Api/Billing.php new file mode 100644 index 0000000..818aac1 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Billing.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +google/api/billing.proto +google.api" +BillingE +consumer_destinations ( 2&.google.api.Billing.BillingDestinationA +BillingDestination +monitored_resource (  +metrics ( Bn +com.google.apiB BillingProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Client.php b/vendor/google/common-protos/metadata/Api/Client.php new file mode 100644 index 0000000..28f8463 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Client.php differ diff --git a/vendor/google/common-protos/metadata/Api/ConfigChange.php b/vendor/google/common-protos/metadata/Api/ConfigChange.php new file mode 100644 index 0000000..b0444eb Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/ConfigChange.php differ diff --git a/vendor/google/common-protos/metadata/Api/Consumer.php b/vendor/google/common-protos/metadata/Api/Consumer.php new file mode 100644 index 0000000..a62c598 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Consumer.php differ diff --git a/vendor/google/common-protos/metadata/Api/Context.php b/vendor/google/common-protos/metadata/Api/Context.php new file mode 100644 index 0000000..74ffd87 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Context.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + ' + +google/api/context.proto +google.api"1 +Context& +rules ( 2.google.api.ContextRule" + ContextRule +selector (  + requested (  +provided ( " +allowed_request_extensions ( # +allowed_response_extensions ( Bn +com.google.apiB ContextProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Control.php b/vendor/google/common-protos/metadata/Api/Control.php new file mode 100644 index 0000000..ead6700 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Control.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +google/api/control.proto +google.api"Q +Control + environment ( 1 +method_policies ( 2.google.api.MethodPolicyBn +com.google.apiB ControlProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Distribution.php b/vendor/google/common-protos/metadata/Api/Distribution.php new file mode 100644 index 0000000..052aa6c Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Distribution.php differ diff --git a/vendor/google/common-protos/metadata/Api/Documentation.php b/vendor/google/common-protos/metadata/Api/Documentation.php new file mode 100644 index 0000000..2c80046 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Documentation.php @@ -0,0 +1,43 @@ +internalAddGeneratedFile( + ' + +google/api/documentation.proto +google.api" + Documentation +summary (  +pages ( 2.google.api.Page, +rules ( 2.google.api.DocumentationRule +documentation_root_url (  +service_root_url (  +overview ( "[ +DocumentationRule +selector (  + description (  +deprecation_description ( "I +Page +name (  +content ( " +subpages ( 2.google.api.PageBt +com.google.apiBDocumentationProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Endpoint.php b/vendor/google/common-protos/metadata/Api/Endpoint.php new file mode 100644 index 0000000..a51aa07 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Endpoint.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/api/endpoint.proto +google.api"M +Endpoint +name (  +aliases (  +targete (  + +allow_cors (Bo +com.google.apiB EndpointProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/ErrorReason.php b/vendor/google/common-protos/metadata/Api/ErrorReason.php new file mode 100644 index 0000000..49f233a Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/ErrorReason.php differ diff --git a/vendor/google/common-protos/metadata/Api/FieldBehavior.php b/vendor/google/common-protos/metadata/Api/FieldBehavior.php new file mode 100644 index 0000000..b8a8d26 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/FieldBehavior.php differ diff --git a/vendor/google/common-protos/metadata/Api/FieldInfo.php b/vendor/google/common-protos/metadata/Api/FieldInfo.php new file mode 100644 index 0000000..7daa960 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/FieldInfo.php differ diff --git a/vendor/google/common-protos/metadata/Api/Http.php b/vendor/google/common-protos/metadata/Api/Http.php new file mode 100644 index 0000000..d0b9c68 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Http.php differ diff --git a/vendor/google/common-protos/metadata/Api/Httpbody.php b/vendor/google/common-protos/metadata/Api/Httpbody.php new file mode 100644 index 0000000..88417c2 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Httpbody.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/api/httpbody.proto +google.api"X +HttpBody + content_type (  +data ( ( + +extensions ( 2.google.protobuf.AnyBe +com.google.apiB HttpBodyProtoPZ;google.golang.org/genproto/googleapis/api/httpbody;httpbodyGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Label.php b/vendor/google/common-protos/metadata/Api/Label.php new file mode 100644 index 0000000..3dd6ebb Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Label.php differ diff --git a/vendor/google/common-protos/metadata/Api/LaunchStage.php b/vendor/google/common-protos/metadata/Api/LaunchStage.php new file mode 100644 index 0000000..3f19c3c Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/LaunchStage.php differ diff --git a/vendor/google/common-protos/metadata/Api/Log.php b/vendor/google/common-protos/metadata/Api/Log.php new file mode 100644 index 0000000..6fe86a6 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Log.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/api/log.proto +google.api"u + LogDescriptor +name ( + +labels ( 2.google.api.LabelDescriptor + description (  + display_name ( Bj +com.google.apiBLogProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Logging.php b/vendor/google/common-protos/metadata/Api/Logging.php new file mode 100644 index 0000000..179277d --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Logging.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/api/logging.proto +google.api" +LoggingE +producer_destinations ( 2&.google.api.Logging.LoggingDestinationE +consumer_destinations ( 2&.google.api.Logging.LoggingDestination> +LoggingDestination +monitored_resource (  +logs ( Bn +com.google.apiB LoggingProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Metric.php b/vendor/google/common-protos/metadata/Api/Metric.php new file mode 100644 index 0000000..93c3824 Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Metric.php differ diff --git a/vendor/google/common-protos/metadata/Api/MonitoredResource.php b/vendor/google/common-protos/metadata/Api/MonitoredResource.php new file mode 100644 index 0000000..311dfb2 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/MonitoredResource.php @@ -0,0 +1,50 @@ +internalAddGeneratedFile( + ' + +#google/api/monitored_resource.proto +google.apigoogle/api/launch_stage.protogoogle/protobuf/struct.proto" +MonitoredResourceDescriptor +name (  +type (  + display_name (  + description ( + +labels ( 2.google.api.LabelDescriptor- + launch_stage (2.google.api.LaunchStage" +MonitoredResource +type ( 9 +labels ( 2).google.api.MonitoredResource.LabelsEntry- + LabelsEntry +key (  +value ( :8" +MonitoredResourceMetadata. + system_labels ( 2.google.protobuf.StructJ + user_labels ( 25.google.api.MonitoredResourceMetadata.UserLabelsEntry1 +UserLabelsEntry +key (  +value ( :8Bv +com.google.apiBMonitoredResourceProtoPZCgoogle.golang.org/genproto/googleapis/api/monitoredres;monitoredresGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Monitoring.php b/vendor/google/common-protos/metadata/Api/Monitoring.php new file mode 100644 index 0000000..2b13194 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Monitoring.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + ' + +google/api/monitoring.proto +google.api" + +MonitoringK +producer_destinations ( 2,.google.api.Monitoring.MonitoringDestinationK +consumer_destinations ( 2,.google.api.Monitoring.MonitoringDestinationD +MonitoringDestination +monitored_resource (  +metrics ( Bq +com.google.apiBMonitoringProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Policy.php b/vendor/google/common-protos/metadata/Api/Policy.php new file mode 100644 index 0000000..c7d3fee --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Policy.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + ' + +google/api/policy.proto +google.api google/protobuf/descriptor.proto"S + FieldPolicy +selector (  +resource_permission (  + resource_type ( "S + MethodPolicy +selector ( 1 +request_policies ( 2.google.api.FieldPolicyBm +com.google.apiB PolicyProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Quota.php b/vendor/google/common-protos/metadata/Api/Quota.php new file mode 100644 index 0000000..4226383 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Quota.php @@ -0,0 +1,55 @@ +internalAddGeneratedFile( + ' + +google/api/quota.proto +google.api"] +Quota& +limits ( 2.google.api.QuotaLimit, + metric_rules ( 2.google.api.MetricRule" + +MetricRule +selector ( = + metric_costs ( 2\'.google.api.MetricRule.MetricCostsEntry2 +MetricCostsEntry +key (  +value (:8" + +QuotaLimit +name (  + description (  + default_limit ( + max_limit ( + free_tier ( +duration (  +metric (  +unit ( 2 +values + ( 2".google.api.QuotaLimit.ValuesEntry + display_name ( - + ValuesEntry +key (  +value (:8Bl +com.google.apiB +QuotaProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Resource.php b/vendor/google/common-protos/metadata/Api/Resource.php new file mode 100644 index 0000000..3e175ea Binary files /dev/null and b/vendor/google/common-protos/metadata/Api/Resource.php differ diff --git a/vendor/google/common-protos/metadata/Api/Routing.php b/vendor/google/common-protos/metadata/Api/Routing.php new file mode 100644 index 0000000..6139d25 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Routing.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +google/api/routing.proto +google.api google/protobuf/descriptor.proto"G + RoutingRule8 +routing_parameters ( 2.google.api.RoutingParameter"8 +RoutingParameter +field (  + path_template ( Bj +com.google.apiB RoutingProtoPZAgoogle.golang.org/genproto/googleapis/api/annotations;annotationsGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Service.php b/vendor/google/common-protos/metadata/Api/Service.php new file mode 100644 index 0000000..109365a --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Service.php @@ -0,0 +1,80 @@ +internalAddGeneratedFile( + ' + +google/api/service.proto +google.apigoogle/api/backend.protogoogle/api/billing.protogoogle/api/client.protogoogle/api/context.protogoogle/api/control.protogoogle/api/documentation.protogoogle/api/endpoint.protogoogle/api/http.protogoogle/api/log.protogoogle/api/logging.protogoogle/api/metric.proto#google/api/monitored_resource.protogoogle/api/monitoring.protogoogle/api/quota.protogoogle/api/source_info.proto!google/api/system_parameter.protogoogle/api/usage.protogoogle/protobuf/api.protogoogle/protobuf/type.protogoogle/protobuf/wrappers.proto" +Service +name (  +title (  +producer_project_id (  + +id! ( " +apis ( 2.google.protobuf.Api$ +types ( 2.google.protobuf.Type$ +enums ( 2.google.protobuf.Enum0 + documentation ( 2.google.api.Documentation$ +backend ( 2.google.api.Backend +http ( 2.google.api.Http +quota + ( 2.google.api.Quota2 +authentication ( 2.google.api.Authentication$ +context ( 2.google.api.Context +usage ( 2.google.api.Usage\' + endpoints ( 2.google.api.Endpoint$ +control ( 2.google.api.Control\' +logs ( 2.google.api.LogDescriptor- +metrics ( 2.google.api.MetricDescriptorD +monitored_resources ( 2\'.google.api.MonitoredResourceDescriptor$ +billing ( 2.google.api.Billing$ +logging ( 2.google.api.Logging* + +monitoring ( 2.google.api.Monitoring7 +system_parameters ( 2.google.api.SystemParameters+ + source_info% ( 2.google.api.SourceInfo* + +publishing- ( 2.google.api.Publishing4 +config_version ( 2.google.protobuf.UInt32ValueBn +com.google.apiB ServiceProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/SourceInfo.php b/vendor/google/common-protos/metadata/Api/SourceInfo.php new file mode 100644 index 0000000..9e3a180 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/SourceInfo.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +google/api/source_info.proto +google.api"8 + +SourceInfo* + source_files ( 2.google.protobuf.AnyBq +com.google.apiBSourceInfoProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/SystemParameter.php b/vendor/google/common-protos/metadata/Api/SystemParameter.php new file mode 100644 index 0000000..d341405 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/SystemParameter.php @@ -0,0 +1,38 @@ +internalAddGeneratedFile( + ' + +!google/api/system_parameter.proto +google.api"B +SystemParameters. +rules ( 2.google.api.SystemParameterRule"X +SystemParameterRule +selector ( / + +parameters ( 2.google.api.SystemParameter"Q +SystemParameter +name (  + http_header (  +url_query_parameter ( Bv +com.google.apiBSystemParameterProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Usage.php b/vendor/google/common-protos/metadata/Api/Usage.php new file mode 100644 index 0000000..3d7a644 --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Usage.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' + +google/api/usage.proto +google.api"j +Usage + requirements ( $ +rules ( 2.google.api.UsageRule% +producer_notification_channel ( "] + UsageRule +selector (  +allow_unregistered_calls ( +skip_service_control (Bl +com.google.apiB +UsageProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Api/Visibility.php b/vendor/google/common-protos/metadata/Api/Visibility.php new file mode 100644 index 0000000..e9dd98b --- /dev/null +++ b/vendor/google/common-protos/metadata/Api/Visibility.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/api/visibility.proto +google.api google/protobuf/descriptor.proto"7 + +Visibility) +rules ( 2.google.api.VisibilityRule"7 +VisibilityRule +selector (  + restriction ( Bk +com.google.apiBVisibilityProtoPZ?google.golang.org/genproto/googleapis/api/visibility;visibilityGAPIbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Cloud/ExtendedOperations.php b/vendor/google/common-protos/metadata/Cloud/ExtendedOperations.php new file mode 100644 index 0000000..08219cb Binary files /dev/null and b/vendor/google/common-protos/metadata/Cloud/ExtendedOperations.php differ diff --git a/vendor/google/common-protos/metadata/Cloud/Location/Locations.php b/vendor/google/common-protos/metadata/Cloud/Location/Locations.php new file mode 100644 index 0000000..ad572c2 --- /dev/null +++ b/vendor/google/common-protos/metadata/Cloud/Location/Locations.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +%google/cloud/location/locations.protogoogle.cloud.locationgoogle/protobuf/any.protogoogle/api/client.proto"[ +ListLocationsRequest +name (  +filter (  + page_size ( + +page_token ( "d +ListLocationsResponse2 + locations ( 2.google.cloud.location.Location +next_page_token ( "" +GetLocationRequest +name ( " +Location +name (  + location_id (  + display_name ( ; +labels ( 2+.google.cloud.location.Location.LabelsEntry& +metadata ( 2.google.protobuf.Any- + LabelsEntry +key (  +value ( :82 + Locations + ListLocations+.google.cloud.location.ListLocationsRequest,.google.cloud.location.ListLocationsResponse"?9/v1/{name=locations}Z!/v1/{name=projects/*}/locations + GetLocation).google.cloud.location.GetLocationRequest.google.cloud.location.Location"C=/v1/{name=locations/*}Z#!/v1/{name=projects/*/locations/*}HAcloud.googleapis.comA.https://www.googleapis.com/auth/cloud-platformBo +com.google.cloud.locationBLocationsProtoPZ=google.golang.org/genproto/googleapis/cloud/location;locationbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php b/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php new file mode 100644 index 0000000..05b9b12 --- /dev/null +++ b/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/iam_policy.proto google.iam.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/options.protogoogle/iam/v1/policy.proto google/protobuf/field_mask.proto" +SetIamPolicyRequest +resource ( B AA +** +policy ( 2.google.iam.v1.PolicyBA/ + update_mask ( 2.google.protobuf.FieldMask"d +GetIamPolicyRequest +resource ( B AA +*0 +options ( 2.google.iam.v1.GetPolicyOptions"R +TestIamPermissionsRequest +resource ( B AA +* + permissions ( BA"1 +TestIamPermissionsResponse + permissions ( 2 + IAMPolicyt + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:setIamPolicy:*t + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:getIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"/)"$/v1/{resource=**}:testIamPermissions:*Aiam-meta-api.googleapis.comB| +com.google.iam.v1BIamPolicyProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php b/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php new file mode 100644 index 0000000..3dcb651 --- /dev/null +++ b/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' + +&google/iam/v1/logging/audit_data.protogoogle.iam.v1.logging"= + AuditData0 + policy_delta ( 2.google.iam.v1.PolicyDeltaB +com.google.iam.v1.loggingBAuditDataProtoPZ9cloud.google.com/go/iam/apiv1/logging/loggingpb;loggingpbGoogle.Cloud.Iam.V1.Loggingbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php b/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php new file mode 100644 index 0000000..630ae5b --- /dev/null +++ b/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/options.proto google.iam.v1"4 +GetPolicyOptions +requested_policy_version (B} +com.google.iam.v1B OptionsProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php b/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php new file mode 100644 index 0000000..ed5ae81 Binary files /dev/null and b/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php differ diff --git a/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php b/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 0000000..aa0d561 --- /dev/null +++ b/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +*google/iam/v1/resource_policy_member.proto google.iam.v1"e +ResourcePolicyMember& +iam_policy_name_principal ( BA% +iam_policy_uid_principal ( BAB +com.google.iam.v1BResourcePolicyMemberProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php b/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php new file mode 100644 index 0000000..3c51368 --- /dev/null +++ b/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php @@ -0,0 +1,46 @@ +internalAddGeneratedFile( + ' + +&google/logging/type/http_request.protogoogle.logging.type" + HttpRequest +request_method (  + request_url (  + request_size ( +status ( + response_size ( + +user_agent (  + remote_ip (  + server_ip (  +referer ( * +latency ( 2.google.protobuf.Duration + cache_lookup ( + cache_hit (* +"cache_validated_with_origin_server + ( +cache_fill_bytes ( +protocol ( B +com.google.logging.typeBHttpRequestProtoPZ8google.golang.org/genproto/googleapis/logging/type;ltypeGoogle.Cloud.Logging.TypeGoogle\\Cloud\\Logging\\TypeGoogle::Cloud::Logging::Typebproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php b/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php new file mode 100644 index 0000000..6acaa69 Binary files /dev/null and b/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php differ diff --git a/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php b/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php new file mode 100644 index 0000000..05b9b12 --- /dev/null +++ b/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/iam_policy.proto google.iam.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/options.protogoogle/iam/v1/policy.proto google/protobuf/field_mask.proto" +SetIamPolicyRequest +resource ( B AA +** +policy ( 2.google.iam.v1.PolicyBA/ + update_mask ( 2.google.protobuf.FieldMask"d +GetIamPolicyRequest +resource ( B AA +*0 +options ( 2.google.iam.v1.GetPolicyOptions"R +TestIamPermissionsRequest +resource ( B AA +* + permissions ( BA"1 +TestIamPermissionsResponse + permissions ( 2 + IAMPolicyt + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:setIamPolicy:*t + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:getIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"/)"$/v1/{resource=**}:testIamPermissions:*Aiam-meta-api.googleapis.comB| +com.google.iam.v1BIamPolicyProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Iam/V1/Logging/AuditData.php b/vendor/google/common-protos/metadata/Iam/V1/Logging/AuditData.php new file mode 100644 index 0000000..3dcb651 --- /dev/null +++ b/vendor/google/common-protos/metadata/Iam/V1/Logging/AuditData.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' + +&google/iam/v1/logging/audit_data.protogoogle.iam.v1.logging"= + AuditData0 + policy_delta ( 2.google.iam.v1.PolicyDeltaB +com.google.iam.v1.loggingBAuditDataProtoPZ9cloud.google.com/go/iam/apiv1/logging/loggingpb;loggingpbGoogle.Cloud.Iam.V1.Loggingbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Iam/V1/Options.php b/vendor/google/common-protos/metadata/Iam/V1/Options.php new file mode 100644 index 0000000..630ae5b --- /dev/null +++ b/vendor/google/common-protos/metadata/Iam/V1/Options.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/options.proto google.iam.v1"4 +GetPolicyOptions +requested_policy_version (B} +com.google.iam.v1B OptionsProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Iam/V1/Policy.php b/vendor/google/common-protos/metadata/Iam/V1/Policy.php new file mode 100644 index 0000000..ed5ae81 Binary files /dev/null and b/vendor/google/common-protos/metadata/Iam/V1/Policy.php differ diff --git a/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php b/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 0000000..aa0d561 --- /dev/null +++ b/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +*google/iam/v1/resource_policy_member.proto google.iam.v1"e +ResourcePolicyMember& +iam_policy_name_principal ( BA% +iam_policy_uid_principal ( BAB +com.google.iam.v1BResourcePolicyMemberProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Logging/Type/HttpRequest.php b/vendor/google/common-protos/metadata/Logging/Type/HttpRequest.php new file mode 100644 index 0000000..3c51368 --- /dev/null +++ b/vendor/google/common-protos/metadata/Logging/Type/HttpRequest.php @@ -0,0 +1,46 @@ +internalAddGeneratedFile( + ' + +&google/logging/type/http_request.protogoogle.logging.type" + HttpRequest +request_method (  + request_url (  + request_size ( +status ( + response_size ( + +user_agent (  + remote_ip (  + server_ip (  +referer ( * +latency ( 2.google.protobuf.Duration + cache_lookup ( + cache_hit (* +"cache_validated_with_origin_server + ( +cache_fill_bytes ( +protocol ( B +com.google.logging.typeBHttpRequestProtoPZ8google.golang.org/genproto/googleapis/logging/type;ltypeGoogle.Cloud.Logging.TypeGoogle\\Cloud\\Logging\\TypeGoogle::Cloud::Logging::Typebproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Logging/Type/LogSeverity.php b/vendor/google/common-protos/metadata/Logging/Type/LogSeverity.php new file mode 100644 index 0000000..6acaa69 Binary files /dev/null and b/vendor/google/common-protos/metadata/Logging/Type/LogSeverity.php differ diff --git a/vendor/google/common-protos/metadata/Rpc/Code.php b/vendor/google/common-protos/metadata/Rpc/Code.php new file mode 100644 index 0000000..2a57a20 Binary files /dev/null and b/vendor/google/common-protos/metadata/Rpc/Code.php differ diff --git a/vendor/google/common-protos/metadata/Rpc/Context/AttributeContext.php b/vendor/google/common-protos/metadata/Rpc/Context/AttributeContext.php new file mode 100644 index 0000000..d7402e2 --- /dev/null +++ b/vendor/google/common-protos/metadata/Rpc/Context/AttributeContext.php @@ -0,0 +1,109 @@ +internalAddGeneratedFile( + ' + +*google/rpc/context/attribute_context.protogoogle.rpc.contextgoogle/protobuf/duration.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto" +AttributeContext9 +origin ( 2).google.rpc.context.AttributeContext.Peer9 +source ( 2).google.rpc.context.AttributeContext.Peer> + destination ( 2).google.rpc.context.AttributeContext.Peer= +request ( 2,.google.rpc.context.AttributeContext.Request? +response ( 2-.google.rpc.context.AttributeContext.Response? +resource ( 2-.google.rpc.context.AttributeContext.Resource5 +api ( 2(.google.rpc.context.AttributeContext.Api( + +extensions ( 2.google.protobuf.Any +Peer + +ip (  +port (E +labels ( 25.google.rpc.context.AttributeContext.Peer.LabelsEntry + principal (  + region_code ( - + LabelsEntry +key (  +value ( :8L +Api +service (  + operation (  +protocol (  +version (  +Auth + principal (  + audiences (  + presenter ( \' +claims ( 2.google.protobuf.Struct + access_levels (  +Request + +id (  +method ( J +headers ( 29.google.rpc.context.AttributeContext.Request.HeadersEntry +path (  +host (  +scheme (  +query ( ( +time ( 2.google.protobuf.Timestamp +size + ( +protocol (  +reason ( 7 +auth ( 2).google.rpc.context.AttributeContext.Auth. + HeadersEntry +key (  +value ( :8 +Response +code ( +size (K +headers ( 2:.google.rpc.context.AttributeContext.Response.HeadersEntry( +time ( 2.google.protobuf.Timestamp2 +backend_latency ( 2.google.protobuf.Duration. + HeadersEntry +key (  +value ( :8 +Resource +service (  +name (  +type ( I +labels ( 29.google.rpc.context.AttributeContext.Resource.LabelsEntry +uid ( S + annotations ( 2>.google.rpc.context.AttributeContext.Resource.AnnotationsEntry + display_name ( / + create_time ( 2.google.protobuf.Timestamp/ + update_time ( 2.google.protobuf.Timestamp/ + delete_time + ( 2.google.protobuf.Timestamp +etag (  +location ( - + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8B +com.google.rpc.contextBAttributeContextProtoPZUgoogle.golang.org/genproto/googleapis/rpc/context/attribute_context;attribute_contextbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php b/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php new file mode 100644 index 0000000..085e04b --- /dev/null +++ b/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +&google/rpc/context/audit_context.protogoogle.rpc.context" + AuditContext + audit_log ( 1 +scrubbed_request ( 2.google.protobuf.Struct2 +scrubbed_response ( 2.google.protobuf.Struct$ +scrubbed_response_item_count ( +target_resource ( Bh +com.google.rpc.contextBAuditContextProtoPZ9google.golang.org/genproto/googleapis/rpc/context;contextbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php b/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php new file mode 100644 index 0000000..c377e86 Binary files /dev/null and b/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php differ diff --git a/vendor/google/common-protos/metadata/Rpc/Status.php b/vendor/google/common-protos/metadata/Rpc/Status.php new file mode 100644 index 0000000..8560f42 --- /dev/null +++ b/vendor/google/common-protos/metadata/Rpc/Status.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +google/rpc/status.proto +google.rpc"N +Status +code ( +message ( % +details ( 2.google.protobuf.AnyBa +com.google.rpcB StatusProtoPZ7google.golang.org/genproto/googleapis/rpc/status;statusRPCbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/CalendarPeriod.php b/vendor/google/common-protos/metadata/Type/CalendarPeriod.php new file mode 100644 index 0000000..2f1368e Binary files /dev/null and b/vendor/google/common-protos/metadata/Type/CalendarPeriod.php differ diff --git a/vendor/google/common-protos/metadata/Type/Color.php b/vendor/google/common-protos/metadata/Type/Color.php new file mode 100644 index 0000000..cae1566 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Color.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +google/type/color.proto google.type"] +Color +red ( +green ( +blue (* +alpha ( 2.google.protobuf.FloatValueB` +com.google.typeB +ColorProtoPZ6google.golang.org/genproto/googleapis/type/color;colorGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Date.php b/vendor/google/common-protos/metadata/Type/Date.php new file mode 100644 index 0000000..8d754f8 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Date.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +google/type/date.proto google.type"0 +Date +year ( +month ( +day (B] +com.google.typeB DateProtoPZ4google.golang.org/genproto/googleapis/type/date;dateGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Datetime.php b/vendor/google/common-protos/metadata/Type/Datetime.php new file mode 100644 index 0000000..bb5fede Binary files /dev/null and b/vendor/google/common-protos/metadata/Type/Datetime.php differ diff --git a/vendor/google/common-protos/metadata/Type/Dayofweek.php b/vendor/google/common-protos/metadata/Type/Dayofweek.php new file mode 100644 index 0000000..b79adcd Binary files /dev/null and b/vendor/google/common-protos/metadata/Type/Dayofweek.php differ diff --git a/vendor/google/common-protos/metadata/Type/Decimal.php b/vendor/google/common-protos/metadata/Type/Decimal.php new file mode 100644 index 0000000..20ddcb6 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Decimal.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' + +google/type/decimal.proto google.type" +Decimal +value ( Bf +com.google.typeB DecimalProtoPZ:google.golang.org/genproto/googleapis/type/decimal;decimalGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Expr.php b/vendor/google/common-protos/metadata/Type/Expr.php new file mode 100644 index 0000000..db6f33b --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Expr.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +google/type/expr.proto google.type"P +Expr + +expression (  +title (  + description (  +location ( BZ +com.google.typeB ExprProtoPZ4google.golang.org/genproto/googleapis/type/expr;exprGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Fraction.php b/vendor/google/common-protos/metadata/Type/Fraction.php new file mode 100644 index 0000000..4c34bf8 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Fraction.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' + +google/type/fraction.proto google.type"2 +Fraction + numerator ( + denominator (Bf +com.google.typeB FractionProtoPZinternalAddGeneratedFile( + ' + +google/type/interval.proto google.type"h +Interval. + +start_time ( 2.google.protobuf.Timestamp, +end_time ( 2.google.protobuf.TimestampBi +com.google.typeB IntervalProtoPZinternalAddGeneratedFile( + ' + +google/type/latlng.proto google.type"- +LatLng +latitude ( + longitude (Bc +com.google.typeB LatLngProtoPZ8google.golang.org/genproto/googleapis/type/latlng;latlngGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/LocalizedText.php b/vendor/google/common-protos/metadata/Type/LocalizedText.php new file mode 100644 index 0000000..ab64343 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/LocalizedText.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' + + google/type/localized_text.proto google.type"4 + LocalizedText +text (  + language_code ( Bz +com.google.typeBLocalizedTextProtoPZHgoogle.golang.org/genproto/googleapis/type/localized_text;localized_textGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Money.php b/vendor/google/common-protos/metadata/Type/Money.php new file mode 100644 index 0000000..01395b8 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Money.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +google/type/money.proto google.type"< +Money + currency_code (  +units ( +nanos (B` +com.google.typeB +MoneyProtoPZ6google.golang.org/genproto/googleapis/type/money;moneyGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Month.php b/vendor/google/common-protos/metadata/Type/Month.php new file mode 100644 index 0000000..e0c5124 Binary files /dev/null and b/vendor/google/common-protos/metadata/Type/Month.php differ diff --git a/vendor/google/common-protos/metadata/Type/PhoneNumber.php b/vendor/google/common-protos/metadata/Type/PhoneNumber.php new file mode 100644 index 0000000..d70da1e Binary files /dev/null and b/vendor/google/common-protos/metadata/Type/PhoneNumber.php differ diff --git a/vendor/google/common-protos/metadata/Type/PostalAddress.php b/vendor/google/common-protos/metadata/Type/PostalAddress.php new file mode 100644 index 0000000..46425c7 --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/PostalAddress.php @@ -0,0 +1,41 @@ +internalAddGeneratedFile( + ' + + google/type/postal_address.proto google.type" + PostalAddress +revision ( + region_code (  + language_code (  + postal_code (  + sorting_code (  +administrative_area (  +locality (  + sublocality (  + address_lines (  + +recipients + (  + organization ( Bx +com.google.typeBPostalAddressProtoPZFgoogle.golang.org/genproto/googleapis/type/postaladdress;postaladdressGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Quaternion.php b/vendor/google/common-protos/metadata/Type/Quaternion.php new file mode 100644 index 0000000..117de8e --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Quaternion.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +google/type/quaternion.proto google.type"8 + +Quaternion +x ( +y ( +z ( +w (Bo +com.google.typeBQuaternionProtoPZ@google.golang.org/genproto/googleapis/type/quaternion;quaternionGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/metadata/Type/Timeofday.php b/vendor/google/common-protos/metadata/Type/Timeofday.php new file mode 100644 index 0000000..ae198be --- /dev/null +++ b/vendor/google/common-protos/metadata/Type/Timeofday.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +google/type/timeofday.proto google.type"K + TimeOfDay +hours ( +minutes ( +seconds ( +nanos (Bl +com.google.typeBTimeOfDayProtoPZ>google.golang.org/genproto/googleapis/type/timeofday;timeofdayGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/common-protos/renovate.json b/vendor/google/common-protos/renovate.json new file mode 100644 index 0000000..6d81213 --- /dev/null +++ b/vendor/google/common-protos/renovate.json @@ -0,0 +1,7 @@ +{ + "extends": [ + "config:base", + ":preserveSemverRanges", + ":disableDependencyDashboard" + ] +} diff --git a/vendor/google/common-protos/src/Api/Advice.php b/vendor/google/common-protos/src/Api/Advice.php new file mode 100644 index 0000000..e4a5378 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Advice.php @@ -0,0 +1,72 @@ +google.api.Advice + */ +class Advice extends \Google\Protobuf\Internal\Message +{ + /** + * Useful description for why this advice was applied and what actions should + * be taken to mitigate any implied risks. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Useful description for why this advice was applied and what actions should + * be taken to mitigate any implied risks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\ConfigChange::initOnce(); + parent::__construct($data); + } + + /** + * Useful description for why this advice was applied and what actions should + * be taken to mitigate any implied risks. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Useful description for why this advice was applied and what actions should + * be taken to mitigate any implied risks. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/AuthProvider.php b/vendor/google/common-protos/src/Api/AuthProvider.php new file mode 100644 index 0000000..3640d3a --- /dev/null +++ b/vendor/google/common-protos/src/Api/AuthProvider.php @@ -0,0 +1,419 @@ +google.api.AuthProvider + */ +class AuthProvider extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. + * Example: "bookstore_auth". + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. + * Example: https://securetoken.google.com + * Example: 1234567-compute@developer.gserviceaccount.com + * + * Generated from protobuf field string issuer = 2; + */ + protected $issuer = ''; + /** + * URL of the provider's public key set to validate signature of the JWT. See + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * Example: https://www.googleapis.com/oauth2/v1/certs + * + * Generated from protobuf field string jwks_uri = 3; + */ + protected $jwks_uri = ''; + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, JWTs with audiences: + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" + * will be accepted. + * For example, if no audiences are in the setting, LibraryService API will + * accept JWTs with the following audiences: + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 4; + */ + protected $audiences = ''; + /** + * Redirect URL if JWT token is required but not present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + * + * Generated from protobuf field string authorization_url = 5; + */ + protected $authorization_url = ''; + /** + * Defines the locations to extract the JWT. For now it is only used by the + * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * JWT locations can be one of HTTP headers, URL query parameters or + * cookies. The rule is that the first match wins. + * If not specified, default to use following 3 locations: + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * Default locations can be specified as followings: + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token + * + * Generated from protobuf field repeated .google.api.JwtLocation jwt_locations = 6; + */ + private $jwt_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. + * Example: "bookstore_auth". + * @type string $issuer + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. + * Example: https://securetoken.google.com + * Example: 1234567-compute@developer.gserviceaccount.com + * @type string $jwks_uri + * URL of the provider's public key set to validate signature of the JWT. See + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * Example: https://www.googleapis.com/oauth2/v1/certs + * @type string $audiences + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, JWTs with audiences: + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" + * will be accepted. + * For example, if no audiences are in the setting, LibraryService API will + * accept JWTs with the following audiences: + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * @type string $authorization_url + * Redirect URL if JWT token is required but not present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + * @type array<\Google\Api\JwtLocation>|\Google\Protobuf\Internal\RepeatedField $jwt_locations + * Defines the locations to extract the JWT. For now it is only used by the + * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * JWT locations can be one of HTTP headers, URL query parameters or + * cookies. The rule is that the first match wins. + * If not specified, default to use following 3 locations: + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * Default locations can be specified as followings: + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. + * Example: "bookstore_auth". + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. + * Example: "bookstore_auth". + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. + * Example: https://securetoken.google.com + * Example: 1234567-compute@developer.gserviceaccount.com + * + * Generated from protobuf field string issuer = 2; + * @return string + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. + * Example: https://securetoken.google.com + * Example: 1234567-compute@developer.gserviceaccount.com + * + * Generated from protobuf field string issuer = 2; + * @param string $var + * @return $this + */ + public function setIssuer($var) + { + GPBUtil::checkString($var, True); + $this->issuer = $var; + + return $this; + } + + /** + * URL of the provider's public key set to validate signature of the JWT. See + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * Example: https://www.googleapis.com/oauth2/v1/certs + * + * Generated from protobuf field string jwks_uri = 3; + * @return string + */ + public function getJwksUri() + { + return $this->jwks_uri; + } + + /** + * URL of the provider's public key set to validate signature of the JWT. See + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * Example: https://www.googleapis.com/oauth2/v1/certs + * + * Generated from protobuf field string jwks_uri = 3; + * @param string $var + * @return $this + */ + public function setJwksUri($var) + { + GPBUtil::checkString($var, True); + $this->jwks_uri = $var; + + return $this; + } + + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, JWTs with audiences: + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" + * will be accepted. + * For example, if no audiences are in the setting, LibraryService API will + * accept JWTs with the following audiences: + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 4; + * @return string + */ + public function getAudiences() + { + return $this->audiences; + } + + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, JWTs with audiences: + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" + * will be accepted. + * For example, if no audiences are in the setting, LibraryService API will + * accept JWTs with the following audiences: + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 4; + * @param string $var + * @return $this + */ + public function setAudiences($var) + { + GPBUtil::checkString($var, True); + $this->audiences = $var; + + return $this; + } + + /** + * Redirect URL if JWT token is required but not present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + * + * Generated from protobuf field string authorization_url = 5; + * @return string + */ + public function getAuthorizationUrl() + { + return $this->authorization_url; + } + + /** + * Redirect URL if JWT token is required but not present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + * + * Generated from protobuf field string authorization_url = 5; + * @param string $var + * @return $this + */ + public function setAuthorizationUrl($var) + { + GPBUtil::checkString($var, True); + $this->authorization_url = $var; + + return $this; + } + + /** + * Defines the locations to extract the JWT. For now it is only used by the + * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * JWT locations can be one of HTTP headers, URL query parameters or + * cookies. The rule is that the first match wins. + * If not specified, default to use following 3 locations: + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * Default locations can be specified as followings: + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token + * + * Generated from protobuf field repeated .google.api.JwtLocation jwt_locations = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJwtLocations() + { + return $this->jwt_locations; + } + + /** + * Defines the locations to extract the JWT. For now it is only used by the + * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * JWT locations can be one of HTTP headers, URL query parameters or + * cookies. The rule is that the first match wins. + * If not specified, default to use following 3 locations: + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * Default locations can be specified as followings: + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token + * + * Generated from protobuf field repeated .google.api.JwtLocation jwt_locations = 6; + * @param array<\Google\Api\JwtLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJwtLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\JwtLocation::class); + $this->jwt_locations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/AuthRequirement.php b/vendor/google/common-protos/src/Api/AuthRequirement.php new file mode 100644 index 0000000..287f2a7 --- /dev/null +++ b/vendor/google/common-protos/src/Api/AuthRequirement.php @@ -0,0 +1,159 @@ +google.api.AuthRequirement + */ +class AuthRequirement extends \Google\Protobuf\Internal\Message +{ + /** + * [id][google.api.AuthProvider.id] from authentication provider. + * Example: + * provider_id: bookstore_auth + * + * Generated from protobuf field string provider_id = 1; + */ + protected $provider_id = ''; + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + * will be accepted. For example, if no audiences are in the setting, + * LibraryService API will only accept JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 2; + */ + protected $audiences = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $provider_id + * [id][google.api.AuthProvider.id] from authentication provider. + * Example: + * provider_id: bookstore_auth + * @type string $audiences + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + * will be accepted. For example, if no audiences are in the setting, + * LibraryService API will only accept JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * [id][google.api.AuthProvider.id] from authentication provider. + * Example: + * provider_id: bookstore_auth + * + * Generated from protobuf field string provider_id = 1; + * @return string + */ + public function getProviderId() + { + return $this->provider_id; + } + + /** + * [id][google.api.AuthProvider.id] from authentication provider. + * Example: + * provider_id: bookstore_auth + * + * Generated from protobuf field string provider_id = 1; + * @param string $var + * @return $this + */ + public function setProviderId($var) + { + GPBUtil::checkString($var, True); + $this->provider_id = $var; + + return $this; + } + + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + * will be accepted. For example, if no audiences are in the setting, + * LibraryService API will only accept JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 2; + * @return string + */ + public function getAudiences() + { + return $this->audiences; + } + + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + * will be accepted. For example, if no audiences are in the setting, + * LibraryService API will only accept JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + * + * Generated from protobuf field string audiences = 2; + * @param string $var + * @return $this + */ + public function setAudiences($var) + { + GPBUtil::checkString($var, True); + $this->audiences = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Authentication.php b/vendor/google/common-protos/src/Api/Authentication.php new file mode 100644 index 0000000..9ee3ba6 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Authentication.php @@ -0,0 +1,120 @@ +google.api.Authentication + */ +class Authentication extends \Google\Protobuf\Internal\Message +{ + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.AuthenticationRule rules = 3; + */ + private $rules; + /** + * Defines a set of authentication providers that a service supports. + * + * Generated from protobuf field repeated .google.api.AuthProvider providers = 4; + */ + private $providers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\AuthenticationRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * @type array<\Google\Api\AuthProvider>|\Google\Protobuf\Internal\RepeatedField $providers + * Defines a set of authentication providers that a service supports. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.AuthenticationRule rules = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.AuthenticationRule rules = 3; + * @param array<\Google\Api\AuthenticationRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\AuthenticationRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * Defines a set of authentication providers that a service supports. + * + * Generated from protobuf field repeated .google.api.AuthProvider providers = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProviders() + { + return $this->providers; + } + + /** + * Defines a set of authentication providers that a service supports. + * + * Generated from protobuf field repeated .google.api.AuthProvider providers = 4; + * @param array<\Google\Api\AuthProvider>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProviders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\AuthProvider::class); + $this->providers = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/AuthenticationRule.php b/vendor/google/common-protos/src/Api/AuthenticationRule.php new file mode 100644 index 0000000..7606811 --- /dev/null +++ b/vendor/google/common-protos/src/Api/AuthenticationRule.php @@ -0,0 +1,197 @@ +google.api.AuthenticationRule + */ +class AuthenticationRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * The requirements for OAuth credentials. + * + * Generated from protobuf field .google.api.OAuthRequirements oauth = 2; + */ + protected $oauth = null; + /** + * If true, the service accepts API keys without any other credential. + * This flag only applies to HTTP and gRPC requests. + * + * Generated from protobuf field bool allow_without_credential = 5; + */ + protected $allow_without_credential = false; + /** + * Requirements for additional authentication providers. + * + * Generated from protobuf field repeated .google.api.AuthRequirement requirements = 7; + */ + private $requirements; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type \Google\Api\OAuthRequirements $oauth + * The requirements for OAuth credentials. + * @type bool $allow_without_credential + * If true, the service accepts API keys without any other credential. + * This flag only applies to HTTP and gRPC requests. + * @type array<\Google\Api\AuthRequirement>|\Google\Protobuf\Internal\RepeatedField $requirements + * Requirements for additional authentication providers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * The requirements for OAuth credentials. + * + * Generated from protobuf field .google.api.OAuthRequirements oauth = 2; + * @return \Google\Api\OAuthRequirements|null + */ + public function getOauth() + { + return $this->oauth; + } + + public function hasOauth() + { + return isset($this->oauth); + } + + public function clearOauth() + { + unset($this->oauth); + } + + /** + * The requirements for OAuth credentials. + * + * Generated from protobuf field .google.api.OAuthRequirements oauth = 2; + * @param \Google\Api\OAuthRequirements $var + * @return $this + */ + public function setOauth($var) + { + GPBUtil::checkMessage($var, \Google\Api\OAuthRequirements::class); + $this->oauth = $var; + + return $this; + } + + /** + * If true, the service accepts API keys without any other credential. + * This flag only applies to HTTP and gRPC requests. + * + * Generated from protobuf field bool allow_without_credential = 5; + * @return bool + */ + public function getAllowWithoutCredential() + { + return $this->allow_without_credential; + } + + /** + * If true, the service accepts API keys without any other credential. + * This flag only applies to HTTP and gRPC requests. + * + * Generated from protobuf field bool allow_without_credential = 5; + * @param bool $var + * @return $this + */ + public function setAllowWithoutCredential($var) + { + GPBUtil::checkBool($var); + $this->allow_without_credential = $var; + + return $this; + } + + /** + * Requirements for additional authentication providers. + * + * Generated from protobuf field repeated .google.api.AuthRequirement requirements = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequirements() + { + return $this->requirements; + } + + /** + * Requirements for additional authentication providers. + * + * Generated from protobuf field repeated .google.api.AuthRequirement requirements = 7; + * @param array<\Google\Api\AuthRequirement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequirements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\AuthRequirement::class); + $this->requirements = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Backend.php b/vendor/google/common-protos/src/Api/Backend.php new file mode 100644 index 0000000..28b6a07 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Backend.php @@ -0,0 +1,71 @@ +google.api.Backend + */ +class Backend extends \Google\Protobuf\Internal\Message +{ + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.BackendRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\BackendRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Backend::initOnce(); + parent::__construct($data); + } + + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.BackendRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.BackendRule rules = 1; + * @param array<\Google\Api\BackendRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\BackendRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/BackendRule.php b/vendor/google/common-protos/src/Api/BackendRule.php new file mode 100644 index 0000000..fa45353 --- /dev/null +++ b/vendor/google/common-protos/src/Api/BackendRule.php @@ -0,0 +1,527 @@ +google.api.BackendRule + */ +class BackendRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * The address of the API backend. + * The scheme is used to determine the backend protocol and security. + * The following schemes are accepted: + * SCHEME PROTOCOL SECURITY + * http:// HTTP None + * https:// HTTP TLS + * grpc:// gRPC None + * grpcs:// gRPC TLS + * It is recommended to explicitly include a scheme. Leaving out the scheme + * may cause constrasting behaviors across platforms. + * If the port is unspecified, the default is: + * - 80 for schemes without TLS + * - 443 for schemes with TLS + * For HTTP backends, use [protocol][google.api.BackendRule.protocol] + * to specify the protocol version. + * + * Generated from protobuf field string address = 2; + */ + protected $address = ''; + /** + * The number of seconds to wait for a response from a request. The default + * varies based on the request protocol and deployment environment. + * + * Generated from protobuf field double deadline = 3; + */ + protected $deadline = 0.0; + /** + * Deprecated, do not use. + * + * Generated from protobuf field double min_deadline = 4 [deprecated = true]; + * @deprecated + */ + protected $min_deadline = 0.0; + /** + * The number of seconds to wait for the completion of a long running + * operation. The default is no deadline. + * + * Generated from protobuf field double operation_deadline = 5; + */ + protected $operation_deadline = 0.0; + /** + * Generated from protobuf field .google.api.BackendRule.PathTranslation path_translation = 6; + */ + protected $path_translation = 0; + /** + * The protocol used for sending a request to the backend. + * The supported values are "http/1.1" and "h2". + * The default value is inferred from the scheme in the + * [address][google.api.BackendRule.address] field: + * SCHEME PROTOCOL + * http:// http/1.1 + * https:// http/1.1 + * grpc:// h2 + * grpcs:// h2 + * For secure HTTP backends (https://) that support HTTP/2, set this field + * to "h2" for improved performance. + * Configuring this field to non-default values is only supported for secure + * HTTP backends. This field will be ignored for all other backends. + * See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for more details on the supported values. + * + * Generated from protobuf field string protocol = 9; + */ + protected $protocol = ''; + /** + * The map between request protocol and the backend address. + * + * Generated from protobuf field map overrides_by_request_protocol = 10; + */ + private $overrides_by_request_protocol; + protected $authentication; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type string $address + * The address of the API backend. + * The scheme is used to determine the backend protocol and security. + * The following schemes are accepted: + * SCHEME PROTOCOL SECURITY + * http:// HTTP None + * https:// HTTP TLS + * grpc:// gRPC None + * grpcs:// gRPC TLS + * It is recommended to explicitly include a scheme. Leaving out the scheme + * may cause constrasting behaviors across platforms. + * If the port is unspecified, the default is: + * - 80 for schemes without TLS + * - 443 for schemes with TLS + * For HTTP backends, use [protocol][google.api.BackendRule.protocol] + * to specify the protocol version. + * @type float $deadline + * The number of seconds to wait for a response from a request. The default + * varies based on the request protocol and deployment environment. + * @type float $min_deadline + * Deprecated, do not use. + * @type float $operation_deadline + * The number of seconds to wait for the completion of a long running + * operation. The default is no deadline. + * @type int $path_translation + * @type string $jwt_audience + * The JWT audience is used when generating a JWT ID token for the backend. + * This ID token will be added in the HTTP "authorization" header, and sent + * to the backend. + * @type bool $disable_auth + * When disable_auth is true, a JWT ID token won't be generated and the + * original "Authorization" HTTP header will be preserved. If the header is + * used to carry the original token and is expected by the backend, this + * field must be set to true to preserve the header. + * @type string $protocol + * The protocol used for sending a request to the backend. + * The supported values are "http/1.1" and "h2". + * The default value is inferred from the scheme in the + * [address][google.api.BackendRule.address] field: + * SCHEME PROTOCOL + * http:// http/1.1 + * https:// http/1.1 + * grpc:// h2 + * grpcs:// h2 + * For secure HTTP backends (https://) that support HTTP/2, set this field + * to "h2" for improved performance. + * Configuring this field to non-default values is only supported for secure + * HTTP backends. This field will be ignored for all other backends. + * See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for more details on the supported values. + * @type array|\Google\Protobuf\Internal\MapField $overrides_by_request_protocol + * The map between request protocol and the backend address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Backend::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * The address of the API backend. + * The scheme is used to determine the backend protocol and security. + * The following schemes are accepted: + * SCHEME PROTOCOL SECURITY + * http:// HTTP None + * https:// HTTP TLS + * grpc:// gRPC None + * grpcs:// gRPC TLS + * It is recommended to explicitly include a scheme. Leaving out the scheme + * may cause constrasting behaviors across platforms. + * If the port is unspecified, the default is: + * - 80 for schemes without TLS + * - 443 for schemes with TLS + * For HTTP backends, use [protocol][google.api.BackendRule.protocol] + * to specify the protocol version. + * + * Generated from protobuf field string address = 2; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * The address of the API backend. + * The scheme is used to determine the backend protocol and security. + * The following schemes are accepted: + * SCHEME PROTOCOL SECURITY + * http:// HTTP None + * https:// HTTP TLS + * grpc:// gRPC None + * grpcs:// gRPC TLS + * It is recommended to explicitly include a scheme. Leaving out the scheme + * may cause constrasting behaviors across platforms. + * If the port is unspecified, the default is: + * - 80 for schemes without TLS + * - 443 for schemes with TLS + * For HTTP backends, use [protocol][google.api.BackendRule.protocol] + * to specify the protocol version. + * + * Generated from protobuf field string address = 2; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * The number of seconds to wait for a response from a request. The default + * varies based on the request protocol and deployment environment. + * + * Generated from protobuf field double deadline = 3; + * @return float + */ + public function getDeadline() + { + return $this->deadline; + } + + /** + * The number of seconds to wait for a response from a request. The default + * varies based on the request protocol and deployment environment. + * + * Generated from protobuf field double deadline = 3; + * @param float $var + * @return $this + */ + public function setDeadline($var) + { + GPBUtil::checkDouble($var); + $this->deadline = $var; + + return $this; + } + + /** + * Deprecated, do not use. + * + * Generated from protobuf field double min_deadline = 4 [deprecated = true]; + * @return float + * @deprecated + */ + public function getMinDeadline() + { + if ($this->min_deadline !== 0.0) { + @trigger_error('min_deadline is deprecated.', E_USER_DEPRECATED); + } + return $this->min_deadline; + } + + /** + * Deprecated, do not use. + * + * Generated from protobuf field double min_deadline = 4 [deprecated = true]; + * @param float $var + * @return $this + * @deprecated + */ + public function setMinDeadline($var) + { + @trigger_error('min_deadline is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkDouble($var); + $this->min_deadline = $var; + + return $this; + } + + /** + * The number of seconds to wait for the completion of a long running + * operation. The default is no deadline. + * + * Generated from protobuf field double operation_deadline = 5; + * @return float + */ + public function getOperationDeadline() + { + return $this->operation_deadline; + } + + /** + * The number of seconds to wait for the completion of a long running + * operation. The default is no deadline. + * + * Generated from protobuf field double operation_deadline = 5; + * @param float $var + * @return $this + */ + public function setOperationDeadline($var) + { + GPBUtil::checkDouble($var); + $this->operation_deadline = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.api.BackendRule.PathTranslation path_translation = 6; + * @return int + */ + public function getPathTranslation() + { + return $this->path_translation; + } + + /** + * Generated from protobuf field .google.api.BackendRule.PathTranslation path_translation = 6; + * @param int $var + * @return $this + */ + public function setPathTranslation($var) + { + GPBUtil::checkEnum($var, \Google\Api\BackendRule\PathTranslation::class); + $this->path_translation = $var; + + return $this; + } + + /** + * The JWT audience is used when generating a JWT ID token for the backend. + * This ID token will be added in the HTTP "authorization" header, and sent + * to the backend. + * + * Generated from protobuf field string jwt_audience = 7; + * @return string + */ + public function getJwtAudience() + { + return $this->readOneof(7); + } + + public function hasJwtAudience() + { + return $this->hasOneof(7); + } + + /** + * The JWT audience is used when generating a JWT ID token for the backend. + * This ID token will be added in the HTTP "authorization" header, and sent + * to the backend. + * + * Generated from protobuf field string jwt_audience = 7; + * @param string $var + * @return $this + */ + public function setJwtAudience($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * When disable_auth is true, a JWT ID token won't be generated and the + * original "Authorization" HTTP header will be preserved. If the header is + * used to carry the original token and is expected by the backend, this + * field must be set to true to preserve the header. + * + * Generated from protobuf field bool disable_auth = 8; + * @return bool + */ + public function getDisableAuth() + { + return $this->readOneof(8); + } + + public function hasDisableAuth() + { + return $this->hasOneof(8); + } + + /** + * When disable_auth is true, a JWT ID token won't be generated and the + * original "Authorization" HTTP header will be preserved. If the header is + * used to carry the original token and is expected by the backend, this + * field must be set to true to preserve the header. + * + * Generated from protobuf field bool disable_auth = 8; + * @param bool $var + * @return $this + */ + public function setDisableAuth($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The protocol used for sending a request to the backend. + * The supported values are "http/1.1" and "h2". + * The default value is inferred from the scheme in the + * [address][google.api.BackendRule.address] field: + * SCHEME PROTOCOL + * http:// http/1.1 + * https:// http/1.1 + * grpc:// h2 + * grpcs:// h2 + * For secure HTTP backends (https://) that support HTTP/2, set this field + * to "h2" for improved performance. + * Configuring this field to non-default values is only supported for secure + * HTTP backends. This field will be ignored for all other backends. + * See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for more details on the supported values. + * + * Generated from protobuf field string protocol = 9; + * @return string + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * The protocol used for sending a request to the backend. + * The supported values are "http/1.1" and "h2". + * The default value is inferred from the scheme in the + * [address][google.api.BackendRule.address] field: + * SCHEME PROTOCOL + * http:// http/1.1 + * https:// http/1.1 + * grpc:// h2 + * grpcs:// h2 + * For secure HTTP backends (https://) that support HTTP/2, set this field + * to "h2" for improved performance. + * Configuring this field to non-default values is only supported for secure + * HTTP backends. This field will be ignored for all other backends. + * See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for more details on the supported values. + * + * Generated from protobuf field string protocol = 9; + * @param string $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkString($var, True); + $this->protocol = $var; + + return $this; + } + + /** + * The map between request protocol and the backend address. + * + * Generated from protobuf field map overrides_by_request_protocol = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getOverridesByRequestProtocol() + { + return $this->overrides_by_request_protocol; + } + + /** + * The map between request protocol and the backend address. + * + * Generated from protobuf field map overrides_by_request_protocol = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setOverridesByRequestProtocol($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\BackendRule::class); + $this->overrides_by_request_protocol = $arr; + + return $this; + } + + /** + * @return string + */ + public function getAuthentication() + { + return $this->whichOneof("authentication"); + } + +} + diff --git a/vendor/google/common-protos/src/Api/BackendRule/PathTranslation.php b/vendor/google/common-protos/src/Api/BackendRule/PathTranslation.php new file mode 100644 index 0000000..d076295 --- /dev/null +++ b/vendor/google/common-protos/src/Api/BackendRule/PathTranslation.php @@ -0,0 +1,93 @@ +google.api.BackendRule.PathTranslation + */ +class PathTranslation +{ + /** + * Generated from protobuf enum PATH_TRANSLATION_UNSPECIFIED = 0; + */ + const PATH_TRANSLATION_UNSPECIFIED = 0; + /** + * Use the backend address as-is, with no modification to the path. If the + * URL pattern contains variables, the variable names and values will be + * appended to the query string. If a query string parameter and a URL + * pattern variable have the same name, this may result in duplicate keys in + * the query string. + * # Examples + * Given the following operation config: + * Method path: /api/company/{cid}/user/{uid} + * Backend address: https://example.cloudfunctions.net/getUser + * Requests to the following request paths will call the backend at the + * translated path: + * Request path: /api/company/widgetworks/user/johndoe + * Translated: + * https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe + * Request path: /api/company/widgetworks/user/johndoe?timezone=EST + * Translated: + * https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe + * + * Generated from protobuf enum CONSTANT_ADDRESS = 1; + */ + const CONSTANT_ADDRESS = 1; + /** + * The request path will be appended to the backend address. + * # Examples + * Given the following operation config: + * Method path: /api/company/{cid}/user/{uid} + * Backend address: https://example.appspot.com + * Requests to the following request paths will call the backend at the + * translated path: + * Request path: /api/company/widgetworks/user/johndoe + * Translated: + * https://example.appspot.com/api/company/widgetworks/user/johndoe + * Request path: /api/company/widgetworks/user/johndoe?timezone=EST + * Translated: + * https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST + * + * Generated from protobuf enum APPEND_PATH_TO_ADDRESS = 2; + */ + const APPEND_PATH_TO_ADDRESS = 2; + + private static $valueToName = [ + self::PATH_TRANSLATION_UNSPECIFIED => 'PATH_TRANSLATION_UNSPECIFIED', + self::CONSTANT_ADDRESS => 'CONSTANT_ADDRESS', + self::APPEND_PATH_TO_ADDRESS => 'APPEND_PATH_TO_ADDRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/Billing.php b/vendor/google/common-protos/src/Api/Billing.php new file mode 100644 index 0000000..241d2f0 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Billing.php @@ -0,0 +1,107 @@ +google.api.Billing + */ +class Billing extends \Google\Protobuf\Internal\Message +{ + /** + * Billing configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations per service, each one must have + * a different monitored resource type. A metric can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Billing.BillingDestination consumer_destinations = 8; + */ + private $consumer_destinations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\Billing\BillingDestination>|\Google\Protobuf\Internal\RepeatedField $consumer_destinations + * Billing configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations per service, each one must have + * a different monitored resource type. A metric can be used in at most + * one consumer destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Billing::initOnce(); + parent::__construct($data); + } + + /** + * Billing configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations per service, each one must have + * a different monitored resource type. A metric can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Billing.BillingDestination consumer_destinations = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerDestinations() + { + return $this->consumer_destinations; + } + + /** + * Billing configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations per service, each one must have + * a different monitored resource type. A metric can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Billing.BillingDestination consumer_destinations = 8; + * @param array<\Google\Api\Billing\BillingDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Billing\BillingDestination::class); + $this->consumer_destinations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Billing/BillingDestination.php b/vendor/google/common-protos/src/Api/Billing/BillingDestination.php new file mode 100644 index 0000000..39be6dd --- /dev/null +++ b/vendor/google/common-protos/src/Api/Billing/BillingDestination.php @@ -0,0 +1,119 @@ +google.api.Billing.BillingDestination + */ +class BillingDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + */ + protected $monitored_resource = ''; + /** + * Names of the metrics to report to this billing destination. + * Each name must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + */ + private $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $monitored_resource + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * @type array|\Google\Protobuf\Internal\RepeatedField $metrics + * Names of the metrics to report to this billing destination. + * Each name must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Billing::initOnce(); + parent::__construct($data); + } + + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + * @return string + */ + public function getMonitoredResource() + { + return $this->monitored_resource; + } + + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + * @param string $var + * @return $this + */ + public function setMonitoredResource($var) + { + GPBUtil::checkString($var, True); + $this->monitored_resource = $var; + + return $this; + } + + /** + * Names of the metrics to report to this billing destination. + * Each name must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * Names of the metrics to report to this billing destination. + * Each name must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->metrics = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/ChangeType.php b/vendor/google/common-protos/src/Api/ChangeType.php new file mode 100644 index 0000000..e39ab1b --- /dev/null +++ b/vendor/google/common-protos/src/Api/ChangeType.php @@ -0,0 +1,72 @@ +google.api.ChangeType + */ +class ChangeType +{ + /** + * No value was provided. + * + * Generated from protobuf enum CHANGE_TYPE_UNSPECIFIED = 0; + */ + const CHANGE_TYPE_UNSPECIFIED = 0; + /** + * The changed object exists in the 'new' service configuration, but not + * in the 'old' service configuration. + * + * Generated from protobuf enum ADDED = 1; + */ + const ADDED = 1; + /** + * The changed object exists in the 'old' service configuration, but not + * in the 'new' service configuration. + * + * Generated from protobuf enum REMOVED = 2; + */ + const REMOVED = 2; + /** + * The changed object exists in both service configurations, but its value + * is different. + * + * Generated from protobuf enum MODIFIED = 3; + */ + const MODIFIED = 3; + + private static $valueToName = [ + self::CHANGE_TYPE_UNSPECIFIED => 'CHANGE_TYPE_UNSPECIFIED', + self::ADDED => 'ADDED', + self::REMOVED => 'REMOVED', + self::MODIFIED => 'MODIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/ClientLibraryDestination.php b/vendor/google/common-protos/src/Api/ClientLibraryDestination.php new file mode 100644 index 0000000..81aee77 --- /dev/null +++ b/vendor/google/common-protos/src/Api/ClientLibraryDestination.php @@ -0,0 +1,63 @@ +google.api.ClientLibraryDestination + */ +class ClientLibraryDestination +{ + /** + * Client libraries will neither be generated nor published to package + * managers. + * + * Generated from protobuf enum CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0; + */ + const CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0; + /** + * Generate the client library in a repo under github.com/googleapis, + * but don't publish it to package managers. + * + * Generated from protobuf enum GITHUB = 10; + */ + const GITHUB = 10; + /** + * Publish the library to package managers like nuget.org and npmjs.com. + * + * Generated from protobuf enum PACKAGE_MANAGER = 20; + */ + const PACKAGE_MANAGER = 20; + + private static $valueToName = [ + self::CLIENT_LIBRARY_DESTINATION_UNSPECIFIED => 'CLIENT_LIBRARY_DESTINATION_UNSPECIFIED', + self::GITHUB => 'GITHUB', + self::PACKAGE_MANAGER => 'PACKAGE_MANAGER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/ClientLibraryOrganization.php b/vendor/google/common-protos/src/Api/ClientLibraryOrganization.php new file mode 100644 index 0000000..bbb985f --- /dev/null +++ b/vendor/google/common-protos/src/Api/ClientLibraryOrganization.php @@ -0,0 +1,97 @@ +google.api.ClientLibraryOrganization + */ +class ClientLibraryOrganization +{ + /** + * Not useful. + * + * Generated from protobuf enum CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0; + */ + const CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0; + /** + * Google Cloud Platform Org. + * + * Generated from protobuf enum CLOUD = 1; + */ + const CLOUD = 1; + /** + * Ads (Advertising) Org. + * + * Generated from protobuf enum ADS = 2; + */ + const ADS = 2; + /** + * Photos Org. + * + * Generated from protobuf enum PHOTOS = 3; + */ + const PHOTOS = 3; + /** + * Street View Org. + * + * Generated from protobuf enum STREET_VIEW = 4; + */ + const STREET_VIEW = 4; + /** + * Shopping Org. + * + * Generated from protobuf enum SHOPPING = 5; + */ + const SHOPPING = 5; + /** + * Geo Org. + * + * Generated from protobuf enum GEO = 6; + */ + const GEO = 6; + /** + * Generative AI - https://developers.generativeai.google + * + * Generated from protobuf enum GENERATIVE_AI = 7; + */ + const GENERATIVE_AI = 7; + + private static $valueToName = [ + self::CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED => 'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED', + self::CLOUD => 'CLOUD', + self::ADS => 'ADS', + self::PHOTOS => 'PHOTOS', + self::STREET_VIEW => 'STREET_VIEW', + self::SHOPPING => 'SHOPPING', + self::GEO => 'GEO', + self::GENERATIVE_AI => 'GENERATIVE_AI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/ClientLibrarySettings.php b/vendor/google/common-protos/src/Api/ClientLibrarySettings.php new file mode 100644 index 0000000..d67588e --- /dev/null +++ b/vendor/google/common-protos/src/Api/ClientLibrarySettings.php @@ -0,0 +1,499 @@ +google.api.ClientLibrarySettings + */ +class ClientLibrarySettings extends \Google\Protobuf\Internal\Message +{ + /** + * Version of the API to apply these settings to. This is the full protobuf + * package for the API, ending in the version element. + * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + * + * Generated from protobuf field string version = 1; + */ + protected $version = ''; + /** + * Launch stage of this version of the API. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 2; + */ + protected $launch_stage = 0; + /** + * When using transport=rest, the client request will encode enums as + * numbers rather than strings. + * + * Generated from protobuf field bool rest_numeric_enums = 3; + */ + protected $rest_numeric_enums = false; + /** + * Settings for legacy Java features, supported in the Service YAML. + * + * Generated from protobuf field .google.api.JavaSettings java_settings = 21; + */ + protected $java_settings = null; + /** + * Settings for C++ client libraries. + * + * Generated from protobuf field .google.api.CppSettings cpp_settings = 22; + */ + protected $cpp_settings = null; + /** + * Settings for PHP client libraries. + * + * Generated from protobuf field .google.api.PhpSettings php_settings = 23; + */ + protected $php_settings = null; + /** + * Settings for Python client libraries. + * + * Generated from protobuf field .google.api.PythonSettings python_settings = 24; + */ + protected $python_settings = null; + /** + * Settings for Node client libraries. + * + * Generated from protobuf field .google.api.NodeSettings node_settings = 25; + */ + protected $node_settings = null; + /** + * Settings for .NET client libraries. + * + * Generated from protobuf field .google.api.DotnetSettings dotnet_settings = 26; + */ + protected $dotnet_settings = null; + /** + * Settings for Ruby client libraries. + * + * Generated from protobuf field .google.api.RubySettings ruby_settings = 27; + */ + protected $ruby_settings = null; + /** + * Settings for Go client libraries. + * + * Generated from protobuf field .google.api.GoSettings go_settings = 28; + */ + protected $go_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $version + * Version of the API to apply these settings to. This is the full protobuf + * package for the API, ending in the version element. + * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + * @type int $launch_stage + * Launch stage of this version of the API. + * @type bool $rest_numeric_enums + * When using transport=rest, the client request will encode enums as + * numbers rather than strings. + * @type \Google\Api\JavaSettings $java_settings + * Settings for legacy Java features, supported in the Service YAML. + * @type \Google\Api\CppSettings $cpp_settings + * Settings for C++ client libraries. + * @type \Google\Api\PhpSettings $php_settings + * Settings for PHP client libraries. + * @type \Google\Api\PythonSettings $python_settings + * Settings for Python client libraries. + * @type \Google\Api\NodeSettings $node_settings + * Settings for Node client libraries. + * @type \Google\Api\DotnetSettings $dotnet_settings + * Settings for .NET client libraries. + * @type \Google\Api\RubySettings $ruby_settings + * Settings for Ruby client libraries. + * @type \Google\Api\GoSettings $go_settings + * Settings for Go client libraries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Version of the API to apply these settings to. This is the full protobuf + * package for the API, ending in the version element. + * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + * + * Generated from protobuf field string version = 1; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Version of the API to apply these settings to. This is the full protobuf + * package for the API, ending in the version element. + * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + * + * Generated from protobuf field string version = 1; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Launch stage of this version of the API. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 2; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Launch stage of this version of the API. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 2; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * When using transport=rest, the client request will encode enums as + * numbers rather than strings. + * + * Generated from protobuf field bool rest_numeric_enums = 3; + * @return bool + */ + public function getRestNumericEnums() + { + return $this->rest_numeric_enums; + } + + /** + * When using transport=rest, the client request will encode enums as + * numbers rather than strings. + * + * Generated from protobuf field bool rest_numeric_enums = 3; + * @param bool $var + * @return $this + */ + public function setRestNumericEnums($var) + { + GPBUtil::checkBool($var); + $this->rest_numeric_enums = $var; + + return $this; + } + + /** + * Settings for legacy Java features, supported in the Service YAML. + * + * Generated from protobuf field .google.api.JavaSettings java_settings = 21; + * @return \Google\Api\JavaSettings|null + */ + public function getJavaSettings() + { + return $this->java_settings; + } + + public function hasJavaSettings() + { + return isset($this->java_settings); + } + + public function clearJavaSettings() + { + unset($this->java_settings); + } + + /** + * Settings for legacy Java features, supported in the Service YAML. + * + * Generated from protobuf field .google.api.JavaSettings java_settings = 21; + * @param \Google\Api\JavaSettings $var + * @return $this + */ + public function setJavaSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\JavaSettings::class); + $this->java_settings = $var; + + return $this; + } + + /** + * Settings for C++ client libraries. + * + * Generated from protobuf field .google.api.CppSettings cpp_settings = 22; + * @return \Google\Api\CppSettings|null + */ + public function getCppSettings() + { + return $this->cpp_settings; + } + + public function hasCppSettings() + { + return isset($this->cpp_settings); + } + + public function clearCppSettings() + { + unset($this->cpp_settings); + } + + /** + * Settings for C++ client libraries. + * + * Generated from protobuf field .google.api.CppSettings cpp_settings = 22; + * @param \Google\Api\CppSettings $var + * @return $this + */ + public function setCppSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\CppSettings::class); + $this->cpp_settings = $var; + + return $this; + } + + /** + * Settings for PHP client libraries. + * + * Generated from protobuf field .google.api.PhpSettings php_settings = 23; + * @return \Google\Api\PhpSettings|null + */ + public function getPhpSettings() + { + return $this->php_settings; + } + + public function hasPhpSettings() + { + return isset($this->php_settings); + } + + public function clearPhpSettings() + { + unset($this->php_settings); + } + + /** + * Settings for PHP client libraries. + * + * Generated from protobuf field .google.api.PhpSettings php_settings = 23; + * @param \Google\Api\PhpSettings $var + * @return $this + */ + public function setPhpSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\PhpSettings::class); + $this->php_settings = $var; + + return $this; + } + + /** + * Settings for Python client libraries. + * + * Generated from protobuf field .google.api.PythonSettings python_settings = 24; + * @return \Google\Api\PythonSettings|null + */ + public function getPythonSettings() + { + return $this->python_settings; + } + + public function hasPythonSettings() + { + return isset($this->python_settings); + } + + public function clearPythonSettings() + { + unset($this->python_settings); + } + + /** + * Settings for Python client libraries. + * + * Generated from protobuf field .google.api.PythonSettings python_settings = 24; + * @param \Google\Api\PythonSettings $var + * @return $this + */ + public function setPythonSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\PythonSettings::class); + $this->python_settings = $var; + + return $this; + } + + /** + * Settings for Node client libraries. + * + * Generated from protobuf field .google.api.NodeSettings node_settings = 25; + * @return \Google\Api\NodeSettings|null + */ + public function getNodeSettings() + { + return $this->node_settings; + } + + public function hasNodeSettings() + { + return isset($this->node_settings); + } + + public function clearNodeSettings() + { + unset($this->node_settings); + } + + /** + * Settings for Node client libraries. + * + * Generated from protobuf field .google.api.NodeSettings node_settings = 25; + * @param \Google\Api\NodeSettings $var + * @return $this + */ + public function setNodeSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\NodeSettings::class); + $this->node_settings = $var; + + return $this; + } + + /** + * Settings for .NET client libraries. + * + * Generated from protobuf field .google.api.DotnetSettings dotnet_settings = 26; + * @return \Google\Api\DotnetSettings|null + */ + public function getDotnetSettings() + { + return $this->dotnet_settings; + } + + public function hasDotnetSettings() + { + return isset($this->dotnet_settings); + } + + public function clearDotnetSettings() + { + unset($this->dotnet_settings); + } + + /** + * Settings for .NET client libraries. + * + * Generated from protobuf field .google.api.DotnetSettings dotnet_settings = 26; + * @param \Google\Api\DotnetSettings $var + * @return $this + */ + public function setDotnetSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\DotnetSettings::class); + $this->dotnet_settings = $var; + + return $this; + } + + /** + * Settings for Ruby client libraries. + * + * Generated from protobuf field .google.api.RubySettings ruby_settings = 27; + * @return \Google\Api\RubySettings|null + */ + public function getRubySettings() + { + return $this->ruby_settings; + } + + public function hasRubySettings() + { + return isset($this->ruby_settings); + } + + public function clearRubySettings() + { + unset($this->ruby_settings); + } + + /** + * Settings for Ruby client libraries. + * + * Generated from protobuf field .google.api.RubySettings ruby_settings = 27; + * @param \Google\Api\RubySettings $var + * @return $this + */ + public function setRubySettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\RubySettings::class); + $this->ruby_settings = $var; + + return $this; + } + + /** + * Settings for Go client libraries. + * + * Generated from protobuf field .google.api.GoSettings go_settings = 28; + * @return \Google\Api\GoSettings|null + */ + public function getGoSettings() + { + return $this->go_settings; + } + + public function hasGoSettings() + { + return isset($this->go_settings); + } + + public function clearGoSettings() + { + unset($this->go_settings); + } + + /** + * Settings for Go client libraries. + * + * Generated from protobuf field .google.api.GoSettings go_settings = 28; + * @param \Google\Api\GoSettings $var + * @return $this + */ + public function setGoSettings($var) + { + GPBUtil::checkMessage($var, \Google\Api\GoSettings::class); + $this->go_settings = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/CommonLanguageSettings.php b/vendor/google/common-protos/src/Api/CommonLanguageSettings.php new file mode 100644 index 0000000..07f8230 --- /dev/null +++ b/vendor/google/common-protos/src/Api/CommonLanguageSettings.php @@ -0,0 +1,156 @@ +google.api.CommonLanguageSettings + */ +class CommonLanguageSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Link to automatically generated reference documentation. Example: + * https://cloud.google.com/nodejs/docs/reference/asset/latest + * + * Generated from protobuf field string reference_docs_uri = 1 [deprecated = true]; + * @deprecated + */ + protected $reference_docs_uri = ''; + /** + * The destination where API teams want this client library to be published. + * + * Generated from protobuf field repeated .google.api.ClientLibraryDestination destinations = 2; + */ + private $destinations; + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + protected $selective_gapic_generation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reference_docs_uri + * Link to automatically generated reference documentation. Example: + * https://cloud.google.com/nodejs/docs/reference/asset/latest + * @type array|\Google\Protobuf\Internal\RepeatedField $destinations + * The destination where API teams want this client library to be published. + * @type \Google\Api\SelectiveGapicGeneration $selective_gapic_generation + * Configuration for which RPCs should be generated in the GAPIC client. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Link to automatically generated reference documentation. Example: + * https://cloud.google.com/nodejs/docs/reference/asset/latest + * + * Generated from protobuf field string reference_docs_uri = 1 [deprecated = true]; + * @return string + * @deprecated + */ + public function getReferenceDocsUri() + { + if ($this->reference_docs_uri !== '') { + @trigger_error('reference_docs_uri is deprecated.', E_USER_DEPRECATED); + } + return $this->reference_docs_uri; + } + + /** + * Link to automatically generated reference documentation. Example: + * https://cloud.google.com/nodejs/docs/reference/asset/latest + * + * Generated from protobuf field string reference_docs_uri = 1 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setReferenceDocsUri($var) + { + @trigger_error('reference_docs_uri is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->reference_docs_uri = $var; + + return $this; + } + + /** + * The destination where API teams want this client library to be published. + * + * Generated from protobuf field repeated .google.api.ClientLibraryDestination destinations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinations() + { + return $this->destinations; + } + + /** + * The destination where API teams want this client library to be published. + * + * Generated from protobuf field repeated .google.api.ClientLibraryDestination destinations = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Api\ClientLibraryDestination::class); + $this->destinations = $arr; + + return $this; + } + + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * @return \Google\Api\SelectiveGapicGeneration|null + */ + public function getSelectiveGapicGeneration() + { + return $this->selective_gapic_generation; + } + + public function hasSelectiveGapicGeneration() + { + return isset($this->selective_gapic_generation); + } + + public function clearSelectiveGapicGeneration() + { + unset($this->selective_gapic_generation); + } + + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * @param \Google\Api\SelectiveGapicGeneration $var + * @return $this + */ + public function setSelectiveGapicGeneration($var) + { + GPBUtil::checkMessage($var, \Google\Api\SelectiveGapicGeneration::class); + $this->selective_gapic_generation = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ConfigChange.php b/vendor/google/common-protos/src/Api/ConfigChange.php new file mode 100644 index 0000000..8c4fcd5 --- /dev/null +++ b/vendor/google/common-protos/src/Api/ConfigChange.php @@ -0,0 +1,251 @@ +google.api.ConfigChange + */ +class ConfigChange extends \Google\Protobuf\Internal\Message +{ + /** + * Object hierarchy path to the change, with levels separated by a '.' + * character. For repeated fields, an applicable unique identifier field is + * used for the index (usually selector, name, or id). For maps, the term + * 'key' is used. If the field has no unique identifier, the numeric index + * is used. + * Examples: + * - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction + * - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + * - logging.producer_destinations[0] + * + * Generated from protobuf field string element = 1; + */ + protected $element = ''; + /** + * Value of the changed object in the old Service configuration, + * in JSON format. This field will not be populated if ChangeType == ADDED. + * + * Generated from protobuf field string old_value = 2; + */ + protected $old_value = ''; + /** + * Value of the changed object in the new Service configuration, + * in JSON format. This field will not be populated if ChangeType == REMOVED. + * + * Generated from protobuf field string new_value = 3; + */ + protected $new_value = ''; + /** + * The type for this change, either ADDED, REMOVED, or MODIFIED. + * + * Generated from protobuf field .google.api.ChangeType change_type = 4; + */ + protected $change_type = 0; + /** + * Collection of advice provided for this change, useful for determining the + * possible impact of this change. + * + * Generated from protobuf field repeated .google.api.Advice advices = 5; + */ + private $advices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $element + * Object hierarchy path to the change, with levels separated by a '.' + * character. For repeated fields, an applicable unique identifier field is + * used for the index (usually selector, name, or id). For maps, the term + * 'key' is used. If the field has no unique identifier, the numeric index + * is used. + * Examples: + * - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction + * - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + * - logging.producer_destinations[0] + * @type string $old_value + * Value of the changed object in the old Service configuration, + * in JSON format. This field will not be populated if ChangeType == ADDED. + * @type string $new_value + * Value of the changed object in the new Service configuration, + * in JSON format. This field will not be populated if ChangeType == REMOVED. + * @type int $change_type + * The type for this change, either ADDED, REMOVED, or MODIFIED. + * @type array<\Google\Api\Advice>|\Google\Protobuf\Internal\RepeatedField $advices + * Collection of advice provided for this change, useful for determining the + * possible impact of this change. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\ConfigChange::initOnce(); + parent::__construct($data); + } + + /** + * Object hierarchy path to the change, with levels separated by a '.' + * character. For repeated fields, an applicable unique identifier field is + * used for the index (usually selector, name, or id). For maps, the term + * 'key' is used. If the field has no unique identifier, the numeric index + * is used. + * Examples: + * - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction + * - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + * - logging.producer_destinations[0] + * + * Generated from protobuf field string element = 1; + * @return string + */ + public function getElement() + { + return $this->element; + } + + /** + * Object hierarchy path to the change, with levels separated by a '.' + * character. For repeated fields, an applicable unique identifier field is + * used for the index (usually selector, name, or id). For maps, the term + * 'key' is used. If the field has no unique identifier, the numeric index + * is used. + * Examples: + * - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction + * - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + * - logging.producer_destinations[0] + * + * Generated from protobuf field string element = 1; + * @param string $var + * @return $this + */ + public function setElement($var) + { + GPBUtil::checkString($var, True); + $this->element = $var; + + return $this; + } + + /** + * Value of the changed object in the old Service configuration, + * in JSON format. This field will not be populated if ChangeType == ADDED. + * + * Generated from protobuf field string old_value = 2; + * @return string + */ + public function getOldValue() + { + return $this->old_value; + } + + /** + * Value of the changed object in the old Service configuration, + * in JSON format. This field will not be populated if ChangeType == ADDED. + * + * Generated from protobuf field string old_value = 2; + * @param string $var + * @return $this + */ + public function setOldValue($var) + { + GPBUtil::checkString($var, True); + $this->old_value = $var; + + return $this; + } + + /** + * Value of the changed object in the new Service configuration, + * in JSON format. This field will not be populated if ChangeType == REMOVED. + * + * Generated from protobuf field string new_value = 3; + * @return string + */ + public function getNewValue() + { + return $this->new_value; + } + + /** + * Value of the changed object in the new Service configuration, + * in JSON format. This field will not be populated if ChangeType == REMOVED. + * + * Generated from protobuf field string new_value = 3; + * @param string $var + * @return $this + */ + public function setNewValue($var) + { + GPBUtil::checkString($var, True); + $this->new_value = $var; + + return $this; + } + + /** + * The type for this change, either ADDED, REMOVED, or MODIFIED. + * + * Generated from protobuf field .google.api.ChangeType change_type = 4; + * @return int + */ + public function getChangeType() + { + return $this->change_type; + } + + /** + * The type for this change, either ADDED, REMOVED, or MODIFIED. + * + * Generated from protobuf field .google.api.ChangeType change_type = 4; + * @param int $var + * @return $this + */ + public function setChangeType($var) + { + GPBUtil::checkEnum($var, \Google\Api\ChangeType::class); + $this->change_type = $var; + + return $this; + } + + /** + * Collection of advice provided for this change, useful for determining the + * possible impact of this change. + * + * Generated from protobuf field repeated .google.api.Advice advices = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvices() + { + return $this->advices; + } + + /** + * Collection of advice provided for this change, useful for determining the + * possible impact of this change. + * + * Generated from protobuf field repeated .google.api.Advice advices = 5; + * @param array<\Google\Api\Advice>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Advice::class); + $this->advices = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Context.php b/vendor/google/common-protos/src/Api/Context.php new file mode 100644 index 0000000..b353115 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Context.php @@ -0,0 +1,98 @@ +-bin” and + * “x-goog-ext--jspb” format. For example, list any service + * specific protobuf types that can appear in grpc metadata as follows in your + * yaml file: + * Example: + * context: + * rules: + * - selector: "google.example.library.v1.LibraryService.CreateBook" + * allowed_request_extensions: + * - google.foo.v1.NewExtension + * allowed_response_extensions: + * - google.foo.v1.NewExtension + * You can also specify extension ID instead of fully qualified extension name + * here. + * + * Generated from protobuf message google.api.Context + */ +class Context extends \Google\Protobuf\Internal\Message +{ + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.ContextRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\ContextRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Context::initOnce(); + parent::__construct($data); + } + + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.ContextRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.ContextRule rules = 1; + * @param array<\Google\Api\ContextRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\ContextRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ContextRule.php b/vendor/google/common-protos/src/Api/ContextRule.php new file mode 100644 index 0000000..f455b1e --- /dev/null +++ b/vendor/google/common-protos/src/Api/ContextRule.php @@ -0,0 +1,228 @@ +google.api.ContextRule + */ +class ContextRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * A list of full type names of requested contexts, only the requested context + * will be made available to the backend. + * + * Generated from protobuf field repeated string requested = 2; + */ + private $requested; + /** + * A list of full type names of provided contexts. It is used to support + * propagating HTTP headers and ETags from the response extension. + * + * Generated from protobuf field repeated string provided = 3; + */ + private $provided; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + * + * Generated from protobuf field repeated string allowed_request_extensions = 4; + */ + private $allowed_request_extensions; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + * + * Generated from protobuf field repeated string allowed_response_extensions = 5; + */ + private $allowed_response_extensions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type array|\Google\Protobuf\Internal\RepeatedField $requested + * A list of full type names of requested contexts, only the requested context + * will be made available to the backend. + * @type array|\Google\Protobuf\Internal\RepeatedField $provided + * A list of full type names of provided contexts. It is used to support + * propagating HTTP headers and ETags from the response extension. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_request_extensions + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_response_extensions + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Context::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * A list of full type names of requested contexts, only the requested context + * will be made available to the backend. + * + * Generated from protobuf field repeated string requested = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequested() + { + return $this->requested; + } + + /** + * A list of full type names of requested contexts, only the requested context + * will be made available to the backend. + * + * Generated from protobuf field repeated string requested = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequested($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->requested = $arr; + + return $this; + } + + /** + * A list of full type names of provided contexts. It is used to support + * propagating HTTP headers and ETags from the response extension. + * + * Generated from protobuf field repeated string provided = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProvided() + { + return $this->provided; + } + + /** + * A list of full type names of provided contexts. It is used to support + * propagating HTTP headers and ETags from the response extension. + * + * Generated from protobuf field repeated string provided = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProvided($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->provided = $arr; + + return $this; + } + + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + * + * Generated from protobuf field repeated string allowed_request_extensions = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedRequestExtensions() + { + return $this->allowed_request_extensions; + } + + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + * + * Generated from protobuf field repeated string allowed_request_extensions = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedRequestExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_request_extensions = $arr; + + return $this; + } + + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + * + * Generated from protobuf field repeated string allowed_response_extensions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedResponseExtensions() + { + return $this->allowed_response_extensions; + } + + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + * + * Generated from protobuf field repeated string allowed_response_extensions = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedResponseExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_response_extensions = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Control.php b/vendor/google/common-protos/src/Api/Control.php new file mode 100644 index 0000000..5b9bdf1 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Control.php @@ -0,0 +1,112 @@ +google.api.Control + */ +class Control extends \Google\Protobuf\Internal\Message +{ + /** + * The service controller environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. The recommended value for + * most services is servicecontrol.googleapis.com + * + * Generated from protobuf field string environment = 1; + */ + protected $environment = ''; + /** + * Defines policies applying to the API methods of the service. + * + * Generated from protobuf field repeated .google.api.MethodPolicy method_policies = 4; + */ + private $method_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $environment + * The service controller environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. The recommended value for + * most services is servicecontrol.googleapis.com + * @type array<\Google\Api\MethodPolicy>|\Google\Protobuf\Internal\RepeatedField $method_policies + * Defines policies applying to the API methods of the service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Control::initOnce(); + parent::__construct($data); + } + + /** + * The service controller environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. The recommended value for + * most services is servicecontrol.googleapis.com + * + * Generated from protobuf field string environment = 1; + * @return string + */ + public function getEnvironment() + { + return $this->environment; + } + + /** + * The service controller environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. The recommended value for + * most services is servicecontrol.googleapis.com + * + * Generated from protobuf field string environment = 1; + * @param string $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkString($var, True); + $this->environment = $var; + + return $this; + } + + /** + * Defines policies applying to the API methods of the service. + * + * Generated from protobuf field repeated .google.api.MethodPolicy method_policies = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethodPolicies() + { + return $this->method_policies; + } + + /** + * Defines policies applying to the API methods of the service. + * + * Generated from protobuf field repeated .google.api.MethodPolicy method_policies = 4; + * @param array<\Google\Api\MethodPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethodPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MethodPolicy::class); + $this->method_policies = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/CppSettings.php b/vendor/google/common-protos/src/Api/CppSettings.php new file mode 100644 index 0000000..d814b5c --- /dev/null +++ b/vendor/google/common-protos/src/Api/CppSettings.php @@ -0,0 +1,77 @@ +google.api.CppSettings + */ +class CppSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/CustomHttpPattern.php b/vendor/google/common-protos/src/Api/CustomHttpPattern.php new file mode 100644 index 0000000..e937032 --- /dev/null +++ b/vendor/google/common-protos/src/Api/CustomHttpPattern.php @@ -0,0 +1,101 @@ +google.api.CustomHttpPattern + */ +class CustomHttpPattern extends \Google\Protobuf\Internal\Message +{ + /** + * The name of this custom HTTP verb. + * + * Generated from protobuf field string kind = 1; + */ + protected $kind = ''; + /** + * The path matched by this custom verb. + * + * Generated from protobuf field string path = 2; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * The name of this custom HTTP verb. + * @type string $path + * The path matched by this custom verb. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Http::initOnce(); + parent::__construct($data); + } + + /** + * The name of this custom HTTP verb. + * + * Generated from protobuf field string kind = 1; + * @return string + */ + public function getKind() + { + return $this->kind; + } + + /** + * The name of this custom HTTP verb. + * + * Generated from protobuf field string kind = 1; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * The path matched by this custom verb. + * + * Generated from protobuf field string path = 2; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * The path matched by this custom verb. + * + * Generated from protobuf field string path = 2; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Distribution.php b/vendor/google/common-protos/src/Api/Distribution.php new file mode 100644 index 0000000..e81aae5 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution.php @@ -0,0 +1,390 @@ +google.api.Distribution + */ +class Distribution extends \Google\Protobuf\Internal\Message +{ + /** + * The number of values in the population. Must be non-negative. This value + * must equal the sum of the values in `bucket_counts` if a histogram is + * provided. + * + * Generated from protobuf field int64 count = 1; + */ + protected $count = 0; + /** + * The arithmetic mean of the values in the population. If `count` is zero + * then this field must be zero. + * + * Generated from protobuf field double mean = 2; + */ + protected $mean = 0.0; + /** + * The sum of squared deviations from the mean of the values in the + * population. For values x_i this is: + * Sum[i=1..n]((x_i - mean)^2) + * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition + * describes Welford's method for accumulating this sum in one pass. + * If `count` is zero then this field must be zero. + * + * Generated from protobuf field double sum_of_squared_deviation = 3; + */ + protected $sum_of_squared_deviation = 0.0; + /** + * If specified, contains the range of the population values. The field + * must not be present if the `count` is zero. + * + * Generated from protobuf field .google.api.Distribution.Range range = 4; + */ + protected $range = null; + /** + * Defines the histogram bucket boundaries. If the distribution does not + * contain a histogram, then omit this field. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 6; + */ + protected $bucket_options = null; + /** + * The number of values in each bucket of the histogram, as described in + * `bucket_options`. If the distribution does not have a histogram, then omit + * this field. If there is a histogram, then the sum of the values in + * `bucket_counts` must equal the value in the `count` field of the + * distribution. + * If present, `bucket_counts` should contain N values, where N is the number + * of buckets specified in `bucket_options`. If you supply fewer than N + * values, the remaining values are assumed to be 0. + * The order of the values in `bucket_counts` follows the bucket numbering + * schemes described for the three bucket types. The first value must be the + * count for the underflow bucket (number 0). The next N-2 values are the + * counts for the finite buckets (number 1 through N-2). The N'th value in + * `bucket_counts` is the count for the overflow bucket (number N-1). + * + * Generated from protobuf field repeated int64 bucket_counts = 7; + */ + private $bucket_counts; + /** + * Must be in increasing order of `value` field. + * + * Generated from protobuf field repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + private $exemplars; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $count + * The number of values in the population. Must be non-negative. This value + * must equal the sum of the values in `bucket_counts` if a histogram is + * provided. + * @type float $mean + * The arithmetic mean of the values in the population. If `count` is zero + * then this field must be zero. + * @type float $sum_of_squared_deviation + * The sum of squared deviations from the mean of the values in the + * population. For values x_i this is: + * Sum[i=1..n]((x_i - mean)^2) + * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition + * describes Welford's method for accumulating this sum in one pass. + * If `count` is zero then this field must be zero. + * @type \Google\Api\Distribution\Range $range + * If specified, contains the range of the population values. The field + * must not be present if the `count` is zero. + * @type \Google\Api\Distribution\BucketOptions $bucket_options + * Defines the histogram bucket boundaries. If the distribution does not + * contain a histogram, then omit this field. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $bucket_counts + * The number of values in each bucket of the histogram, as described in + * `bucket_options`. If the distribution does not have a histogram, then omit + * this field. If there is a histogram, then the sum of the values in + * `bucket_counts` must equal the value in the `count` field of the + * distribution. + * If present, `bucket_counts` should contain N values, where N is the number + * of buckets specified in `bucket_options`. If you supply fewer than N + * values, the remaining values are assumed to be 0. + * The order of the values in `bucket_counts` follows the bucket numbering + * schemes described for the three bucket types. The first value must be the + * count for the underflow bucket (number 0). The next N-2 values are the + * counts for the finite buckets (number 1 through N-2). The N'th value in + * `bucket_counts` is the count for the overflow bucket (number N-1). + * @type array<\Google\Api\Distribution\Exemplar>|\Google\Protobuf\Internal\RepeatedField $exemplars + * Must be in increasing order of `value` field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * The number of values in the population. Must be non-negative. This value + * must equal the sum of the values in `bucket_counts` if a histogram is + * provided. + * + * Generated from protobuf field int64 count = 1; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of values in the population. Must be non-negative. This value + * must equal the sum of the values in `bucket_counts` if a histogram is + * provided. + * + * Generated from protobuf field int64 count = 1; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * The arithmetic mean of the values in the population. If `count` is zero + * then this field must be zero. + * + * Generated from protobuf field double mean = 2; + * @return float + */ + public function getMean() + { + return $this->mean; + } + + /** + * The arithmetic mean of the values in the population. If `count` is zero + * then this field must be zero. + * + * Generated from protobuf field double mean = 2; + * @param float $var + * @return $this + */ + public function setMean($var) + { + GPBUtil::checkDouble($var); + $this->mean = $var; + + return $this; + } + + /** + * The sum of squared deviations from the mean of the values in the + * population. For values x_i this is: + * Sum[i=1..n]((x_i - mean)^2) + * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition + * describes Welford's method for accumulating this sum in one pass. + * If `count` is zero then this field must be zero. + * + * Generated from protobuf field double sum_of_squared_deviation = 3; + * @return float + */ + public function getSumOfSquaredDeviation() + { + return $this->sum_of_squared_deviation; + } + + /** + * The sum of squared deviations from the mean of the values in the + * population. For values x_i this is: + * Sum[i=1..n]((x_i - mean)^2) + * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition + * describes Welford's method for accumulating this sum in one pass. + * If `count` is zero then this field must be zero. + * + * Generated from protobuf field double sum_of_squared_deviation = 3; + * @param float $var + * @return $this + */ + public function setSumOfSquaredDeviation($var) + { + GPBUtil::checkDouble($var); + $this->sum_of_squared_deviation = $var; + + return $this; + } + + /** + * If specified, contains the range of the population values. The field + * must not be present if the `count` is zero. + * + * Generated from protobuf field .google.api.Distribution.Range range = 4; + * @return \Google\Api\Distribution\Range|null + */ + public function getRange() + { + return $this->range; + } + + public function hasRange() + { + return isset($this->range); + } + + public function clearRange() + { + unset($this->range); + } + + /** + * If specified, contains the range of the population values. The field + * must not be present if the `count` is zero. + * + * Generated from protobuf field .google.api.Distribution.Range range = 4; + * @param \Google\Api\Distribution\Range $var + * @return $this + */ + public function setRange($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\Range::class); + $this->range = $var; + + return $this; + } + + /** + * Defines the histogram bucket boundaries. If the distribution does not + * contain a histogram, then omit this field. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 6; + * @return \Google\Api\Distribution\BucketOptions|null + */ + public function getBucketOptions() + { + return $this->bucket_options; + } + + public function hasBucketOptions() + { + return isset($this->bucket_options); + } + + public function clearBucketOptions() + { + unset($this->bucket_options); + } + + /** + * Defines the histogram bucket boundaries. If the distribution does not + * contain a histogram, then omit this field. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 6; + * @param \Google\Api\Distribution\BucketOptions $var + * @return $this + */ + public function setBucketOptions($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions::class); + $this->bucket_options = $var; + + return $this; + } + + /** + * The number of values in each bucket of the histogram, as described in + * `bucket_options`. If the distribution does not have a histogram, then omit + * this field. If there is a histogram, then the sum of the values in + * `bucket_counts` must equal the value in the `count` field of the + * distribution. + * If present, `bucket_counts` should contain N values, where N is the number + * of buckets specified in `bucket_options`. If you supply fewer than N + * values, the remaining values are assumed to be 0. + * The order of the values in `bucket_counts` follows the bucket numbering + * schemes described for the three bucket types. The first value must be the + * count for the underflow bucket (number 0). The next N-2 values are the + * counts for the finite buckets (number 1 through N-2). The N'th value in + * `bucket_counts` is the count for the overflow bucket (number N-1). + * + * Generated from protobuf field repeated int64 bucket_counts = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBucketCounts() + { + return $this->bucket_counts; + } + + /** + * The number of values in each bucket of the histogram, as described in + * `bucket_options`. If the distribution does not have a histogram, then omit + * this field. If there is a histogram, then the sum of the values in + * `bucket_counts` must equal the value in the `count` field of the + * distribution. + * If present, `bucket_counts` should contain N values, where N is the number + * of buckets specified in `bucket_options`. If you supply fewer than N + * values, the remaining values are assumed to be 0. + * The order of the values in `bucket_counts` follows the bucket numbering + * schemes described for the three bucket types. The first value must be the + * count for the underflow bucket (number 0). The next N-2 values are the + * counts for the finite buckets (number 1 through N-2). The N'th value in + * `bucket_counts` is the count for the overflow bucket (number N-1). + * + * Generated from protobuf field repeated int64 bucket_counts = 7; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBucketCounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->bucket_counts = $arr; + + return $this; + } + + /** + * Must be in increasing order of `value` field. + * + * Generated from protobuf field repeated .google.api.Distribution.Exemplar exemplars = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * Must be in increasing order of `value` field. + * + * Generated from protobuf field repeated .google.api.Distribution.Exemplar exemplars = 10; + * @param array<\Google\Api\Distribution\Exemplar>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Distribution\Exemplar::class); + $this->exemplars = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Distribution/BucketOptions.php b/vendor/google/common-protos/src/Api/Distribution/BucketOptions.php new file mode 100644 index 0000000..22aa21f --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/BucketOptions.php @@ -0,0 +1,155 @@ + 0) is the + * same as the upper bound of bucket i - 1. The buckets span the whole range + * of finite values: lower bound of the underflow bucket is -infinity and the + * upper bound of the overflow bucket is +infinity. The finite buckets are + * so-called because both bounds are finite. + * + * Generated from protobuf message google.api.Distribution.BucketOptions + */ +class BucketOptions extends \Google\Protobuf\Internal\Message +{ + protected $options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\Distribution\BucketOptions\Linear $linear_buckets + * The linear bucket. + * @type \Google\Api\Distribution\BucketOptions\Exponential $exponential_buckets + * The exponential buckets. + * @type \Google\Api\Distribution\BucketOptions\Explicit $explicit_buckets + * The explicit buckets. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * The linear bucket. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Linear linear_buckets = 1; + * @return \Google\Api\Distribution\BucketOptions\Linear|null + */ + public function getLinearBuckets() + { + return $this->readOneof(1); + } + + public function hasLinearBuckets() + { + return $this->hasOneof(1); + } + + /** + * The linear bucket. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Linear linear_buckets = 1; + * @param \Google\Api\Distribution\BucketOptions\Linear $var + * @return $this + */ + public function setLinearBuckets($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions\Linear::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The exponential buckets. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Exponential exponential_buckets = 2; + * @return \Google\Api\Distribution\BucketOptions\Exponential|null + */ + public function getExponentialBuckets() + { + return $this->readOneof(2); + } + + public function hasExponentialBuckets() + { + return $this->hasOneof(2); + } + + /** + * The exponential buckets. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Exponential exponential_buckets = 2; + * @param \Google\Api\Distribution\BucketOptions\Exponential $var + * @return $this + */ + public function setExponentialBuckets($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions\Exponential::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The explicit buckets. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Explicit explicit_buckets = 3; + * @return \Google\Api\Distribution\BucketOptions\Explicit|null + */ + public function getExplicitBuckets() + { + return $this->readOneof(3); + } + + public function hasExplicitBuckets() + { + return $this->hasOneof(3); + } + + /** + * The explicit buckets. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions.Explicit explicit_buckets = 3; + * @param \Google\Api\Distribution\BucketOptions\Explicit $var + * @return $this + */ + public function setExplicitBuckets($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions\Explicit::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getOptions() + { + return $this->whichOneof("options"); + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Explicit.php b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Explicit.php new file mode 100644 index 0000000..e39aaae --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Explicit.php @@ -0,0 +1,75 @@ +google.api.Distribution.BucketOptions.Explicit + */ +class Explicit extends \Google\Protobuf\Internal\Message +{ + /** + * The values must be monotonically increasing. + * + * Generated from protobuf field repeated double bounds = 1; + */ + private $bounds; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $bounds + * The values must be monotonically increasing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * The values must be monotonically increasing. + * + * Generated from protobuf field repeated double bounds = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBounds() + { + return $this->bounds; + } + + /** + * The values must be monotonically increasing. + * + * Generated from protobuf field repeated double bounds = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBounds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->bounds = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Exponential.php b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Exponential.php new file mode 100644 index 0000000..b717581 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Exponential.php @@ -0,0 +1,142 @@ +google.api.Distribution.BucketOptions.Exponential + */ +class Exponential extends \Google\Protobuf\Internal\Message +{ + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + */ + protected $num_finite_buckets = 0; + /** + * Must be greater than 1. + * + * Generated from protobuf field double growth_factor = 2; + */ + protected $growth_factor = 0.0; + /** + * Must be greater than 0. + * + * Generated from protobuf field double scale = 3; + */ + protected $scale = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $num_finite_buckets + * Must be greater than 0. + * @type float $growth_factor + * Must be greater than 1. + * @type float $scale + * Must be greater than 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + * @return int + */ + public function getNumFiniteBuckets() + { + return $this->num_finite_buckets; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + * @param int $var + * @return $this + */ + public function setNumFiniteBuckets($var) + { + GPBUtil::checkInt32($var); + $this->num_finite_buckets = $var; + + return $this; + } + + /** + * Must be greater than 1. + * + * Generated from protobuf field double growth_factor = 2; + * @return float + */ + public function getGrowthFactor() + { + return $this->growth_factor; + } + + /** + * Must be greater than 1. + * + * Generated from protobuf field double growth_factor = 2; + * @param float $var + * @return $this + */ + public function setGrowthFactor($var) + { + GPBUtil::checkDouble($var); + $this->growth_factor = $var; + + return $this; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field double scale = 3; + * @return float + */ + public function getScale() + { + return $this->scale; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field double scale = 3; + * @param float $var + * @return $this + */ + public function setScale($var) + { + GPBUtil::checkDouble($var); + $this->scale = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Linear.php b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Linear.php new file mode 100644 index 0000000..8ed9bc9 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/BucketOptions/Linear.php @@ -0,0 +1,142 @@ +google.api.Distribution.BucketOptions.Linear + */ +class Linear extends \Google\Protobuf\Internal\Message +{ + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + */ + protected $num_finite_buckets = 0; + /** + * Must be greater than 0. + * + * Generated from protobuf field double width = 2; + */ + protected $width = 0.0; + /** + * Lower bound of the first bucket. + * + * Generated from protobuf field double offset = 3; + */ + protected $offset = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $num_finite_buckets + * Must be greater than 0. + * @type float $width + * Must be greater than 0. + * @type float $offset + * Lower bound of the first bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + * @return int + */ + public function getNumFiniteBuckets() + { + return $this->num_finite_buckets; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field int32 num_finite_buckets = 1; + * @param int $var + * @return $this + */ + public function setNumFiniteBuckets($var) + { + GPBUtil::checkInt32($var); + $this->num_finite_buckets = $var; + + return $this; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field double width = 2; + * @return float + */ + public function getWidth() + { + return $this->width; + } + + /** + * Must be greater than 0. + * + * Generated from protobuf field double width = 2; + * @param float $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkDouble($var); + $this->width = $var; + + return $this; + } + + /** + * Lower bound of the first bucket. + * + * Generated from protobuf field double offset = 3; + * @return float + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Lower bound of the first bucket. + * + * Generated from protobuf field double offset = 3; + * @param float $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkDouble($var); + $this->offset = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Distribution/Exemplar.php b/vendor/google/common-protos/src/Api/Distribution/Exemplar.php new file mode 100644 index 0000000..5e7654a --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/Exemplar.php @@ -0,0 +1,178 @@ +google.api.Distribution.Exemplar + */ +class Exemplar extends \Google\Protobuf\Internal\Message +{ + /** + * Value of the exemplar point. This value determines to which bucket the + * exemplar belongs. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + /** + * The observation (sampling) time of the above value. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + */ + protected $timestamp = null; + /** + * Contextual information about the example value. Examples are: + * Trace: type.googleapis.com/google.monitoring.v3.SpanContext + * Literal string: type.googleapis.com/google.protobuf.StringValue + * Labels dropped during aggregation: + * type.googleapis.com/google.monitoring.v3.DroppedLabels + * There may be only a single attachment of any given message type in a + * single exemplar, and this is enforced by the system. + * + * Generated from protobuf field repeated .google.protobuf.Any attachments = 3; + */ + private $attachments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * Value of the exemplar point. This value determines to which bucket the + * exemplar belongs. + * @type \Google\Protobuf\Timestamp $timestamp + * The observation (sampling) time of the above value. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $attachments + * Contextual information about the example value. Examples are: + * Trace: type.googleapis.com/google.monitoring.v3.SpanContext + * Literal string: type.googleapis.com/google.protobuf.StringValue + * Labels dropped during aggregation: + * type.googleapis.com/google.monitoring.v3.DroppedLabels + * There may be only a single attachment of any given message type in a + * single exemplar, and this is enforced by the system. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * Value of the exemplar point. This value determines to which bucket the + * exemplar belongs. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Value of the exemplar point. This value determines to which bucket the + * exemplar belongs. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * The observation (sampling) time of the above value. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * The observation (sampling) time of the above value. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->timestamp = $var; + + return $this; + } + + /** + * Contextual information about the example value. Examples are: + * Trace: type.googleapis.com/google.monitoring.v3.SpanContext + * Literal string: type.googleapis.com/google.protobuf.StringValue + * Labels dropped during aggregation: + * type.googleapis.com/google.monitoring.v3.DroppedLabels + * There may be only a single attachment of any given message type in a + * single exemplar, and this is enforced by the system. + * + * Generated from protobuf field repeated .google.protobuf.Any attachments = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachments() + { + return $this->attachments; + } + + /** + * Contextual information about the example value. Examples are: + * Trace: type.googleapis.com/google.monitoring.v3.SpanContext + * Literal string: type.googleapis.com/google.protobuf.StringValue + * Labels dropped during aggregation: + * type.googleapis.com/google.monitoring.v3.DroppedLabels + * There may be only a single attachment of any given message type in a + * single exemplar, and this is enforced by the system. + * + * Generated from protobuf field repeated .google.protobuf.Any attachments = 3; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->attachments = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Distribution/Range.php b/vendor/google/common-protos/src/Api/Distribution/Range.php new file mode 100644 index 0000000..8ace8a8 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Distribution/Range.php @@ -0,0 +1,102 @@ +google.api.Distribution.Range + */ +class Range extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum of the population values. + * + * Generated from protobuf field double min = 1; + */ + protected $min = 0.0; + /** + * The maximum of the population values. + * + * Generated from protobuf field double max = 2; + */ + protected $max = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $min + * The minimum of the population values. + * @type float $max + * The maximum of the population values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Distribution::initOnce(); + parent::__construct($data); + } + + /** + * The minimum of the population values. + * + * Generated from protobuf field double min = 1; + * @return float + */ + public function getMin() + { + return $this->min; + } + + /** + * The minimum of the population values. + * + * Generated from protobuf field double min = 1; + * @param float $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkDouble($var); + $this->min = $var; + + return $this; + } + + /** + * The maximum of the population values. + * + * Generated from protobuf field double max = 2; + * @return float + */ + public function getMax() + { + return $this->max; + } + + /** + * The maximum of the population values. + * + * Generated from protobuf field double max = 2; + * @param float $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkDouble($var); + $this->max = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Documentation.php b/vendor/google/common-protos/src/Api/Documentation.php new file mode 100644 index 0000000..aced421 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Documentation.php @@ -0,0 +1,362 @@ +documentation: + * summary: > + * The Google Calendar API gives access + * to most calendar features. + * pages: + * - name: Overview + * content: (== include google/foo/overview.md ==) + * - name: Tutorial + * content: (== include google/foo/tutorial.md ==) + * subpages: + * - name: Java + * content: (== include google/foo/tutorial_java.md ==) + * rules: + * - selector: google.calendar.Calendar.Get + * description: > + * ... + * - selector: google.calendar.Calendar.Put + * description: > + * ... + * + * Documentation is provided in markdown syntax. In addition to + * standard markdown features, definition lists, tables and fenced + * code blocks are supported. Section headers can be provided and are + * interpreted relative to the section nesting of the context where + * a documentation fragment is embedded. + * Documentation from the IDL is merged with documentation defined + * via the config at normalization time, where documentation provided + * by config rules overrides IDL provided. + * A number of constructs specific to the API platform are supported + * in documentation text. + * In order to reference a proto element, the following + * notation can be used: + *
[fully.qualified.proto.name][]
+ * To override the display text used for the link, this can be used: + *
[display text][fully.qualified.proto.name]
+ * Text can be excluded from doc using the following notation: + *
(-- internal comment --)
+ * A few directives are available in documentation. Note that + * directives must appear on a single line to be properly + * identified. The `include` directive includes a markdown file from + * an external source: + *
(== include path/to/file ==)
+ * The `resource_for` directive marks a message to be the resource of + * a collection in REST view. If it is not specified, tools attempt + * to infer the resource from the operations in a collection: + *
(== resource_for v1.shelves.books ==)
+ * The directive `suppress_warning` does not directly affect documentation + * and is documented together with service config validation. + * + * Generated from protobuf message google.api.Documentation + */ +class Documentation extends \Google\Protobuf\Internal\Message +{ + /** + * A short description of what the service does. The summary must be plain + * text. It becomes the overview of the service displayed in Google Cloud + * Console. + * NOTE: This field is equivalent to the standard field `description`. + * + * Generated from protobuf field string summary = 1; + */ + protected $summary = ''; + /** + * The top level pages for the documentation set. + * + * Generated from protobuf field repeated .google.api.Page pages = 5; + */ + private $pages; + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.DocumentationRule rules = 3; + */ + private $rules; + /** + * The URL to the root of documentation. + * + * Generated from protobuf field string documentation_root_url = 4; + */ + protected $documentation_root_url = ''; + /** + * Specifies the service root url if the default one (the service name + * from the yaml file) is not suitable. This can be seen in any fully + * specified service urls as well as sections that show a base that other + * urls are relative to. + * + * Generated from protobuf field string service_root_url = 6; + */ + protected $service_root_url = ''; + /** + * Declares a single overview page. For example: + *
documentation:
+     *   summary: ...
+     *   overview: (== include overview.md ==)
+     * 
+ * This is a shortcut for the following declaration (using pages style): + *
documentation:
+     *   summary: ...
+     *   pages:
+     *   - name: Overview
+     *     content: (== include overview.md ==)
+     * 
+ * Note: you cannot specify both `overview` field and `pages` field. + * + * Generated from protobuf field string overview = 2; + */ + protected $overview = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $summary + * A short description of what the service does. The summary must be plain + * text. It becomes the overview of the service displayed in Google Cloud + * Console. + * NOTE: This field is equivalent to the standard field `description`. + * @type array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $pages + * The top level pages for the documentation set. + * @type array<\Google\Api\DocumentationRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * @type string $documentation_root_url + * The URL to the root of documentation. + * @type string $service_root_url + * Specifies the service root url if the default one (the service name + * from the yaml file) is not suitable. This can be seen in any fully + * specified service urls as well as sections that show a base that other + * urls are relative to. + * @type string $overview + * Declares a single overview page. For example: + *
documentation:
+     *             summary: ...
+     *             overview: (== include overview.md ==)
+     *           
+ * This is a shortcut for the following declaration (using pages style): + *
documentation:
+     *             summary: ...
+     *             pages:
+     *             - name: Overview
+     *               content: (== include overview.md ==)
+     *           
+ * Note: you cannot specify both `overview` field and `pages` field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Documentation::initOnce(); + parent::__construct($data); + } + + /** + * A short description of what the service does. The summary must be plain + * text. It becomes the overview of the service displayed in Google Cloud + * Console. + * NOTE: This field is equivalent to the standard field `description`. + * + * Generated from protobuf field string summary = 1; + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * A short description of what the service does. The summary must be plain + * text. It becomes the overview of the service displayed in Google Cloud + * Console. + * NOTE: This field is equivalent to the standard field `description`. + * + * Generated from protobuf field string summary = 1; + * @param string $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkString($var, True); + $this->summary = $var; + + return $this; + } + + /** + * The top level pages for the documentation set. + * + * Generated from protobuf field repeated .google.api.Page pages = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPages() + { + return $this->pages; + } + + /** + * The top level pages for the documentation set. + * + * Generated from protobuf field repeated .google.api.Page pages = 5; + * @param array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Page::class); + $this->pages = $arr; + + return $this; + } + + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.DocumentationRule rules = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.DocumentationRule rules = 3; + * @param array<\Google\Api\DocumentationRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\DocumentationRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * The URL to the root of documentation. + * + * Generated from protobuf field string documentation_root_url = 4; + * @return string + */ + public function getDocumentationRootUrl() + { + return $this->documentation_root_url; + } + + /** + * The URL to the root of documentation. + * + * Generated from protobuf field string documentation_root_url = 4; + * @param string $var + * @return $this + */ + public function setDocumentationRootUrl($var) + { + GPBUtil::checkString($var, True); + $this->documentation_root_url = $var; + + return $this; + } + + /** + * Specifies the service root url if the default one (the service name + * from the yaml file) is not suitable. This can be seen in any fully + * specified service urls as well as sections that show a base that other + * urls are relative to. + * + * Generated from protobuf field string service_root_url = 6; + * @return string + */ + public function getServiceRootUrl() + { + return $this->service_root_url; + } + + /** + * Specifies the service root url if the default one (the service name + * from the yaml file) is not suitable. This can be seen in any fully + * specified service urls as well as sections that show a base that other + * urls are relative to. + * + * Generated from protobuf field string service_root_url = 6; + * @param string $var + * @return $this + */ + public function setServiceRootUrl($var) + { + GPBUtil::checkString($var, True); + $this->service_root_url = $var; + + return $this; + } + + /** + * Declares a single overview page. For example: + *
documentation:
+     *   summary: ...
+     *   overview: (== include overview.md ==)
+     * 
+ * This is a shortcut for the following declaration (using pages style): + *
documentation:
+     *   summary: ...
+     *   pages:
+     *   - name: Overview
+     *     content: (== include overview.md ==)
+     * 
+ * Note: you cannot specify both `overview` field and `pages` field. + * + * Generated from protobuf field string overview = 2; + * @return string + */ + public function getOverview() + { + return $this->overview; + } + + /** + * Declares a single overview page. For example: + *
documentation:
+     *   summary: ...
+     *   overview: (== include overview.md ==)
+     * 
+ * This is a shortcut for the following declaration (using pages style): + *
documentation:
+     *   summary: ...
+     *   pages:
+     *   - name: Overview
+     *     content: (== include overview.md ==)
+     * 
+ * Note: you cannot specify both `overview` field and `pages` field. + * + * Generated from protobuf field string overview = 2; + * @param string $var + * @return $this + */ + public function setOverview($var) + { + GPBUtil::checkString($var, True); + $this->overview = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/DocumentationRule.php b/vendor/google/common-protos/src/Api/DocumentationRule.php new file mode 100644 index 0000000..c904d1a --- /dev/null +++ b/vendor/google/common-protos/src/Api/DocumentationRule.php @@ -0,0 +1,171 @@ +google.api.DocumentationRule + */ +class DocumentationRule extends \Google\Protobuf\Internal\Message +{ + /** + * The selector is a comma-separated list of patterns for any element such as + * a method, a field, an enum value. Each pattern is a qualified name of the + * element which may end in "*", indicating a wildcard. Wildcards are only + * allowed at the end and for a whole component of the qualified name, + * i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + * one or more components. To specify a default for all applicable elements, + * the whole pattern "*" is used. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * Description of the selected proto element (e.g. a message, a method, a + * 'service' definition, or a field). Defaults to leading & trailing comments + * taken from the proto source definition of the proto element. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + * + * Generated from protobuf field string deprecation_description = 3; + */ + protected $deprecation_description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * The selector is a comma-separated list of patterns for any element such as + * a method, a field, an enum value. Each pattern is a qualified name of the + * element which may end in "*", indicating a wildcard. Wildcards are only + * allowed at the end and for a whole component of the qualified name, + * i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + * one or more components. To specify a default for all applicable elements, + * the whole pattern "*" is used. + * @type string $description + * Description of the selected proto element (e.g. a message, a method, a + * 'service' definition, or a field). Defaults to leading & trailing comments + * taken from the proto source definition of the proto element. + * @type string $deprecation_description + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Documentation::initOnce(); + parent::__construct($data); + } + + /** + * The selector is a comma-separated list of patterns for any element such as + * a method, a field, an enum value. Each pattern is a qualified name of the + * element which may end in "*", indicating a wildcard. Wildcards are only + * allowed at the end and for a whole component of the qualified name, + * i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + * one or more components. To specify a default for all applicable elements, + * the whole pattern "*" is used. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * The selector is a comma-separated list of patterns for any element such as + * a method, a field, an enum value. Each pattern is a qualified name of the + * element which may end in "*", indicating a wildcard. Wildcards are only + * allowed at the end and for a whole component of the qualified name, + * i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + * one or more components. To specify a default for all applicable elements, + * the whole pattern "*" is used. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Description of the selected proto element (e.g. a message, a method, a + * 'service' definition, or a field). Defaults to leading & trailing comments + * taken from the proto source definition of the proto element. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the selected proto element (e.g. a message, a method, a + * 'service' definition, or a field). Defaults to leading & trailing comments + * taken from the proto source definition of the proto element. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + * + * Generated from protobuf field string deprecation_description = 3; + * @return string + */ + public function getDeprecationDescription() + { + return $this->deprecation_description; + } + + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + * + * Generated from protobuf field string deprecation_description = 3; + * @param string $var + * @return $this + */ + public function setDeprecationDescription($var) + { + GPBUtil::checkString($var, True); + $this->deprecation_description = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/DotnetSettings.php b/vendor/google/common-protos/src/Api/DotnetSettings.php new file mode 100644 index 0000000..de7672c --- /dev/null +++ b/vendor/google/common-protos/src/Api/DotnetSettings.php @@ -0,0 +1,307 @@ +google.api.DotnetSettings + */ +class DotnetSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + /** + * Map from original service names to renamed versions. + * This is used when the default generated types + * would cause a naming conflict. (Neither name is + * fully-qualified.) + * Example: Subscriber to SubscriberServiceApi. + * + * Generated from protobuf field map renamed_services = 2; + */ + private $renamed_services; + /** + * Map from full resource types to the effective short name + * for the resource. This is used when otherwise resource + * named from different services would cause naming collisions. + * Example entry: + * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + * + * Generated from protobuf field map renamed_resources = 3; + */ + private $renamed_resources; + /** + * List of full resource types to ignore during generation. + * This is typically used for API-specific Location resources, + * which should be handled by the generator as if they were actually + * the common Location resources. + * Example entry: "documentai.googleapis.com/Location" + * + * Generated from protobuf field repeated string ignored_resources = 4; + */ + private $ignored_resources; + /** + * Namespaces which must be aliased in snippets due to + * a known (but non-generator-predictable) naming collision + * + * Generated from protobuf field repeated string forced_namespace_aliases = 5; + */ + private $forced_namespace_aliases; + /** + * Method signatures (in the form "service.method(signature)") + * which are provided separately, so shouldn't be generated. + * Snippets *calling* these methods are still generated, however. + * + * Generated from protobuf field repeated string handwritten_signatures = 6; + */ + private $handwritten_signatures; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * @type array|\Google\Protobuf\Internal\MapField $renamed_services + * Map from original service names to renamed versions. + * This is used when the default generated types + * would cause a naming conflict. (Neither name is + * fully-qualified.) + * Example: Subscriber to SubscriberServiceApi. + * @type array|\Google\Protobuf\Internal\MapField $renamed_resources + * Map from full resource types to the effective short name + * for the resource. This is used when otherwise resource + * named from different services would cause naming collisions. + * Example entry: + * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + * @type array|\Google\Protobuf\Internal\RepeatedField $ignored_resources + * List of full resource types to ignore during generation. + * This is typically used for API-specific Location resources, + * which should be handled by the generator as if they were actually + * the common Location resources. + * Example entry: "documentai.googleapis.com/Location" + * @type array|\Google\Protobuf\Internal\RepeatedField $forced_namespace_aliases + * Namespaces which must be aliased in snippets due to + * a known (but non-generator-predictable) naming collision + * @type array|\Google\Protobuf\Internal\RepeatedField $handwritten_signatures + * Method signatures (in the form "service.method(signature)") + * which are provided separately, so shouldn't be generated. + * Snippets *calling* these methods are still generated, however. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + + /** + * Map from original service names to renamed versions. + * This is used when the default generated types + * would cause a naming conflict. (Neither name is + * fully-qualified.) + * Example: Subscriber to SubscriberServiceApi. + * + * Generated from protobuf field map renamed_services = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRenamedServices() + { + return $this->renamed_services; + } + + /** + * Map from original service names to renamed versions. + * This is used when the default generated types + * would cause a naming conflict. (Neither name is + * fully-qualified.) + * Example: Subscriber to SubscriberServiceApi. + * + * Generated from protobuf field map renamed_services = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRenamedServices($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->renamed_services = $arr; + + return $this; + } + + /** + * Map from full resource types to the effective short name + * for the resource. This is used when otherwise resource + * named from different services would cause naming collisions. + * Example entry: + * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + * + * Generated from protobuf field map renamed_resources = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRenamedResources() + { + return $this->renamed_resources; + } + + /** + * Map from full resource types to the effective short name + * for the resource. This is used when otherwise resource + * named from different services would cause naming collisions. + * Example entry: + * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + * + * Generated from protobuf field map renamed_resources = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRenamedResources($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->renamed_resources = $arr; + + return $this; + } + + /** + * List of full resource types to ignore during generation. + * This is typically used for API-specific Location resources, + * which should be handled by the generator as if they were actually + * the common Location resources. + * Example entry: "documentai.googleapis.com/Location" + * + * Generated from protobuf field repeated string ignored_resources = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoredResources() + { + return $this->ignored_resources; + } + + /** + * List of full resource types to ignore during generation. + * This is typically used for API-specific Location resources, + * which should be handled by the generator as if they were actually + * the common Location resources. + * Example entry: "documentai.googleapis.com/Location" + * + * Generated from protobuf field repeated string ignored_resources = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoredResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ignored_resources = $arr; + + return $this; + } + + /** + * Namespaces which must be aliased in snippets due to + * a known (but non-generator-predictable) naming collision + * + * Generated from protobuf field repeated string forced_namespace_aliases = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForcedNamespaceAliases() + { + return $this->forced_namespace_aliases; + } + + /** + * Namespaces which must be aliased in snippets due to + * a known (but non-generator-predictable) naming collision + * + * Generated from protobuf field repeated string forced_namespace_aliases = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForcedNamespaceAliases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->forced_namespace_aliases = $arr; + + return $this; + } + + /** + * Method signatures (in the form "service.method(signature)") + * which are provided separately, so shouldn't be generated. + * Snippets *calling* these methods are still generated, however. + * + * Generated from protobuf field repeated string handwritten_signatures = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHandwrittenSignatures() + { + return $this->handwritten_signatures; + } + + /** + * Method signatures (in the form "service.method(signature)") + * which are provided separately, so shouldn't be generated. + * Snippets *calling* these methods are still generated, however. + * + * Generated from protobuf field repeated string handwritten_signatures = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHandwrittenSignatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->handwritten_signatures = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Endpoint.php b/vendor/google/common-protos/src/Api/Endpoint.php new file mode 100644 index 0000000..41c1cbe --- /dev/null +++ b/vendor/google/common-protos/src/Api/Endpoint.php @@ -0,0 +1,231 @@ +google.api.Endpoint + */ +class Endpoint extends \Google\Protobuf\Internal\Message +{ + /** + * The canonical name of this endpoint. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Aliases for this endpoint, these will be served by the same UrlMap as the + * parent endpoint, and will be provisioned in the GCP stack for the Regional + * Endpoints. + * + * Generated from protobuf field repeated string aliases = 2; + */ + private $aliases; + /** + * The specification of an Internet routable address of API frontend that will + * handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For example, + * "8.8.8.8" or "myservice.appspot.com". + * + * Generated from protobuf field string target = 101; + */ + protected $target = ''; + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint to + * receive and respond to HTTP OPTIONS requests. The response will be used by + * the browser to determine whether the subsequent cross-origin request is + * allowed to proceed. + * + * Generated from protobuf field bool allow_cors = 5; + */ + protected $allow_cors = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The canonical name of this endpoint. + * @type array|\Google\Protobuf\Internal\RepeatedField $aliases + * Aliases for this endpoint, these will be served by the same UrlMap as the + * parent endpoint, and will be provisioned in the GCP stack for the Regional + * Endpoints. + * @type string $target + * The specification of an Internet routable address of API frontend that will + * handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For example, + * "8.8.8.8" or "myservice.appspot.com". + * @type bool $allow_cors + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint to + * receive and respond to HTTP OPTIONS requests. The response will be used by + * the browser to determine whether the subsequent cross-origin request is + * allowed to proceed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Endpoint::initOnce(); + parent::__construct($data); + } + + /** + * The canonical name of this endpoint. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The canonical name of this endpoint. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Aliases for this endpoint, these will be served by the same UrlMap as the + * parent endpoint, and will be provisioned in the GCP stack for the Regional + * Endpoints. + * + * Generated from protobuf field repeated string aliases = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAliases() + { + return $this->aliases; + } + + /** + * Aliases for this endpoint, these will be served by the same UrlMap as the + * parent endpoint, and will be provisioned in the GCP stack for the Regional + * Endpoints. + * + * Generated from protobuf field repeated string aliases = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAliases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->aliases = $arr; + + return $this; + } + + /** + * The specification of an Internet routable address of API frontend that will + * handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For example, + * "8.8.8.8" or "myservice.appspot.com". + * + * Generated from protobuf field string target = 101; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * The specification of an Internet routable address of API frontend that will + * handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For example, + * "8.8.8.8" or "myservice.appspot.com". + * + * Generated from protobuf field string target = 101; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint to + * receive and respond to HTTP OPTIONS requests. The response will be used by + * the browser to determine whether the subsequent cross-origin request is + * allowed to proceed. + * + * Generated from protobuf field bool allow_cors = 5; + * @return bool + */ + public function getAllowCors() + { + return $this->allow_cors; + } + + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint to + * receive and respond to HTTP OPTIONS requests. The response will be used by + * the browser to determine whether the subsequent cross-origin request is + * allowed to proceed. + * + * Generated from protobuf field bool allow_cors = 5; + * @param bool $var + * @return $this + */ + public function setAllowCors($var) + { + GPBUtil::checkBool($var); + $this->allow_cors = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ErrorReason.php b/vendor/google/common-protos/src/Api/ErrorReason.php new file mode 100644 index 0000000..04641c2 --- /dev/null +++ b/vendor/google/common-protos/src/Api/ErrorReason.php @@ -0,0 +1,690 @@ +google.api.ErrorReason + */ +class ErrorReason +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum ERROR_REASON_UNSPECIFIED = 0; + */ + const ERROR_REASON_UNSPECIFIED = 0; + /** + * The request is calling a disabled service for a consumer. + * Example of an ErrorInfo when the consumer "projects/123" contacting + * "pubsub.googleapis.com" service which is disabled: + * { "reason": "SERVICE_DISABLED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "pubsub.googleapis.com" + * } + * } + * This response indicates the "pubsub.googleapis.com" has been disabled in + * "projects/123". + * + * Generated from protobuf enum SERVICE_DISABLED = 1; + */ + const SERVICE_DISABLED = 1; + /** + * The request whose associated billing account is disabled. + * Example of an ErrorInfo when the consumer "projects/123" fails to contact + * "pubsub.googleapis.com" service because the associated billing account is + * disabled: + * { "reason": "BILLING_DISABLED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "pubsub.googleapis.com" + * } + * } + * This response indicates the billing account associated has been disabled. + * + * Generated from protobuf enum BILLING_DISABLED = 2; + */ + const BILLING_DISABLED = 2; + /** + * The request is denied because the provided [API + * key](https://cloud.google.com/docs/authentication/api-keys) is invalid. It + * may be in a bad format, cannot be found, or has been expired). + * Example of an ErrorInfo when the request is contacting + * "storage.googleapis.com" service with an invalid API key: + * { "reason": "API_KEY_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * } + * } + * + * Generated from protobuf enum API_KEY_INVALID = 3; + */ + const API_KEY_INVALID = 3; + /** + * The request is denied because it violates [API key API + * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions). + * Example of an ErrorInfo when the consumer "projects/123" fails to call the + * "storage.googleapis.com" service because this service is restricted in the + * API key: + * { "reason": "API_KEY_SERVICE_BLOCKED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum API_KEY_SERVICE_BLOCKED = 4; + */ + const API_KEY_SERVICE_BLOCKED = 4; + /** + * The request is denied because it violates [API key HTTP + * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions). + * Example of an ErrorInfo when the consumer "projects/123" fails to call + * "storage.googleapis.com" service because the http referrer of the request + * violates API key HTTP restrictions: + * { "reason": "API_KEY_HTTP_REFERRER_BLOCKED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * } + * } + * + * Generated from protobuf enum API_KEY_HTTP_REFERRER_BLOCKED = 7; + */ + const API_KEY_HTTP_REFERRER_BLOCKED = 7; + /** + * The request is denied because it violates [API key IP address + * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions). + * Example of an ErrorInfo when the consumer "projects/123" fails to call + * "storage.googleapis.com" service because the caller IP of the request + * violates API key IP address restrictions: + * { "reason": "API_KEY_IP_ADDRESS_BLOCKED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * } + * } + * + * Generated from protobuf enum API_KEY_IP_ADDRESS_BLOCKED = 8; + */ + const API_KEY_IP_ADDRESS_BLOCKED = 8; + /** + * The request is denied because it violates [API key Android application + * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions). + * Example of an ErrorInfo when the consumer "projects/123" fails to call + * "storage.googleapis.com" service because the request from the Android apps + * violates the API key Android application restrictions: + * { "reason": "API_KEY_ANDROID_APP_BLOCKED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum API_KEY_ANDROID_APP_BLOCKED = 9; + */ + const API_KEY_ANDROID_APP_BLOCKED = 9; + /** + * The request is denied because it violates [API key iOS application + * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions). + * Example of an ErrorInfo when the consumer "projects/123" fails to call + * "storage.googleapis.com" service because the request from the iOS apps + * violates the API key iOS application restrictions: + * { "reason": "API_KEY_IOS_APP_BLOCKED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum API_KEY_IOS_APP_BLOCKED = 13; + */ + const API_KEY_IOS_APP_BLOCKED = 13; + /** + * The request is denied because there is not enough rate quota for the + * consumer. + * Example of an ErrorInfo when the consumer "projects/123" fails to contact + * "pubsub.googleapis.com" service because consumer's rate quota usage has + * reached the maximum value set for the quota limit + * "ReadsPerMinutePerProject" on the quota metric + * "pubsub.googleapis.com/read_requests": + * { "reason": "RATE_LIMIT_EXCEEDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "pubsub.googleapis.com", + * "quota_metric": "pubsub.googleapis.com/read_requests", + * "quota_limit": "ReadsPerMinutePerProject" + * } + * } + * Example of an ErrorInfo when the consumer "projects/123" checks quota on + * the service "dataflow.googleapis.com" and hits the organization quota + * limit "DefaultRequestsPerMinutePerOrganization" on the metric + * "dataflow.googleapis.com/default_requests". + * { "reason": "RATE_LIMIT_EXCEEDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "dataflow.googleapis.com", + * "quota_metric": "dataflow.googleapis.com/default_requests", + * "quota_limit": "DefaultRequestsPerMinutePerOrganization" + * } + * } + * + * Generated from protobuf enum RATE_LIMIT_EXCEEDED = 5; + */ + const RATE_LIMIT_EXCEEDED = 5; + /** + * The request is denied because there is not enough resource quota for the + * consumer. + * Example of an ErrorInfo when the consumer "projects/123" fails to contact + * "compute.googleapis.com" service because consumer's resource quota usage + * has reached the maximum value set for the quota limit "VMsPerProject" + * on the quota metric "compute.googleapis.com/vms": + * { "reason": "RESOURCE_QUOTA_EXCEEDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "compute.googleapis.com", + * "quota_metric": "compute.googleapis.com/vms", + * "quota_limit": "VMsPerProject" + * } + * } + * Example of an ErrorInfo when the consumer "projects/123" checks resource + * quota on the service "dataflow.googleapis.com" and hits the organization + * quota limit "jobs-per-organization" on the metric + * "dataflow.googleapis.com/job_count". + * { "reason": "RESOURCE_QUOTA_EXCEEDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "dataflow.googleapis.com", + * "quota_metric": "dataflow.googleapis.com/job_count", + * "quota_limit": "jobs-per-organization" + * } + * } + * + * Generated from protobuf enum RESOURCE_QUOTA_EXCEEDED = 6; + */ + const RESOURCE_QUOTA_EXCEEDED = 6; + /** + * The request whose associated billing account address is in a tax restricted + * location, violates the local tax restrictions when creating resources in + * the restricted region. + * Example of an ErrorInfo when creating the Cloud Storage Bucket in the + * container "projects/123" under a tax restricted region + * "locations/asia-northeast3": + * { "reason": "LOCATION_TAX_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * "location": "locations/asia-northeast3" + * } + * } + * This response indicates creating the Cloud Storage Bucket in + * "locations/asia-northeast3" violates the location tax restriction. + * + * Generated from protobuf enum LOCATION_TAX_POLICY_VIOLATED = 10; + */ + const LOCATION_TAX_POLICY_VIOLATED = 10; + /** + * The request is denied because the caller does not have required permission + * on the user project "projects/123" or the user project is invalid. For more + * information, check the [userProject System + * Parameters](https://cloud.google.com/apis/docs/system-parameters). + * Example of an ErrorInfo when the caller is calling Cloud Storage service + * with insufficient permissions on the user project: + * { "reason": "USER_PROJECT_DENIED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum USER_PROJECT_DENIED = 11; + */ + const USER_PROJECT_DENIED = 11; + /** + * The request is denied because the consumer "projects/123" is suspended due + * to Terms of Service(Tos) violations. Check [Project suspension + * guidelines](https://cloud.google.com/resource-manager/docs/project-suspension-guidelines) + * for more information. + * Example of an ErrorInfo when calling Cloud Storage service with the + * suspended consumer "projects/123": + * { "reason": "CONSUMER_SUSPENDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum CONSUMER_SUSPENDED = 12; + */ + const CONSUMER_SUSPENDED = 12; + /** + * The request is denied because the associated consumer is invalid. It may be + * in a bad format, cannot be found, or have been deleted. + * Example of an ErrorInfo when calling Cloud Storage service with the + * invalid consumer "projects/123": + * { "reason": "CONSUMER_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum CONSUMER_INVALID = 14; + */ + const CONSUMER_INVALID = 14; + /** + * The request is denied because it violates [VPC Service + * Controls](https://cloud.google.com/vpc-service-controls/docs/overview). + * The 'uid' field is a random generated identifier that customer can use it + * to search the audit log for a request rejected by VPC Service Controls. For + * more information, please refer [VPC Service Controls + * Troubleshooting](https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id) + * Example of an ErrorInfo when the consumer "projects/123" fails to call + * Cloud Storage service because the request is prohibited by the VPC Service + * Controls. + * { "reason": "SECURITY_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "uid": "123456789abcde", + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum SECURITY_POLICY_VIOLATED = 15; + */ + const SECURITY_POLICY_VIOLATED = 15; + /** + * The request is denied because the provided access token has expired. + * Example of an ErrorInfo when the request is calling Cloud Storage service + * with an expired access token: + * { "reason": "ACCESS_TOKEN_EXPIRED", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } + * + * Generated from protobuf enum ACCESS_TOKEN_EXPIRED = 16; + */ + const ACCESS_TOKEN_EXPIRED = 16; + /** + * The request is denied because the provided access token doesn't have at + * least one of the acceptable scopes required for the API. Please check + * [OAuth 2.0 Scopes for Google + * APIs](https://developers.google.com/identity/protocols/oauth2/scopes) for + * the list of the OAuth 2.0 scopes that you might need to request to access + * the API. + * Example of an ErrorInfo when the request is calling Cloud Storage service + * with an access token that is missing required scopes: + * { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } + * + * Generated from protobuf enum ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; + */ + const ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; + /** + * The request is denied because the account associated with the provided + * access token is in an invalid state, such as disabled or deleted. + * For more information, see https://cloud.google.com/docs/authentication. + * Warning: For privacy reasons, the server may not be able to disclose the + * email address for some accounts. The client MUST NOT depend on the + * availability of the `email` attribute. + * Example of an ErrorInfo when the request is to the Cloud Storage API with + * an access token that is associated with a disabled or deleted [service + * account](http://cloud/iam/docs/service-accounts): + * { "reason": "ACCOUNT_STATE_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject", + * "email": "user@123.iam.gserviceaccount.com" + * } + * } + * + * Generated from protobuf enum ACCOUNT_STATE_INVALID = 18; + */ + const ACCOUNT_STATE_INVALID = 18; + /** + * The request is denied because the type of the provided access token is not + * supported by the API being called. + * Example of an ErrorInfo when the request is to the Cloud Storage API with + * an unsupported token type. + * { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } + * + * Generated from protobuf enum ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; + */ + const ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; + /** + * The request is denied because the request doesn't have any authentication + * credentials. For more information regarding the supported authentication + * strategies for Google Cloud APIs, see + * https://cloud.google.com/docs/authentication. + * Example of an ErrorInfo when the request is to the Cloud Storage API + * without any authentication credentials. + * { "reason": "CREDENTIALS_MISSING", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } + * + * Generated from protobuf enum CREDENTIALS_MISSING = 20; + */ + const CREDENTIALS_MISSING = 20; + /** + * The request is denied because the provided project owning the resource + * which acts as the [API + * consumer](https://cloud.google.com/apis/design/glossary#api_consumer) is + * invalid. It may be in a bad format or empty. + * Example of an ErrorInfo when the request is to the Cloud Functions API, + * but the offered resource project in the request in a bad format which can't + * perform the ListFunctions method. + * { "reason": "RESOURCE_PROJECT_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "cloudfunctions.googleapis.com", + * "method": + * "google.cloud.functions.v1.CloudFunctionsService.ListFunctions" + * } + * } + * + * Generated from protobuf enum RESOURCE_PROJECT_INVALID = 21; + */ + const RESOURCE_PROJECT_INVALID = 21; + /** + * The request is denied because the provided session cookie is missing, + * invalid or failed to decode. + * Example of an ErrorInfo when the request is calling Cloud Storage service + * with a SID cookie which can't be decoded. + * { "reason": "SESSION_COOKIE_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject", + * "cookie": "SID" + * } + * } + * + * Generated from protobuf enum SESSION_COOKIE_INVALID = 23; + */ + const SESSION_COOKIE_INVALID = 23; + /** + * The request is denied because the user is from a Google Workspace customer + * that blocks their users from accessing a particular service. + * Example scenario: https://support.google.com/a/answer/9197205?hl=en + * Example of an ErrorInfo when access to Google Cloud Storage service is + * blocked by the Google Workspace administrator: + * { "reason": "USER_BLOCKED_BY_ADMIN", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject", + * } + * } + * + * Generated from protobuf enum USER_BLOCKED_BY_ADMIN = 24; + */ + const USER_BLOCKED_BY_ADMIN = 24; + /** + * The request is denied because the resource service usage is restricted + * by administrators according to the organization policy constraint. + * For more information see + * https://cloud.google.com/resource-manager/docs/organization-policy/restricting-services. + * Example of an ErrorInfo when access to Google Cloud Storage service is + * restricted by Resource Usage Restriction policy: + * { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/project-123", + * "service": "storage.googleapis.com" + * } + * } + * + * Generated from protobuf enum RESOURCE_USAGE_RESTRICTION_VIOLATED = 25; + */ + const RESOURCE_USAGE_RESTRICTION_VIOLATED = 25; + /** + * Unimplemented. Do not use. + * The request is denied because it contains unsupported system parameters in + * URL query parameters or HTTP headers. For more information, + * see https://cloud.google.com/apis/docs/system-parameters + * Example of an ErrorInfo when access "pubsub.googleapis.com" service with + * a request header of "x-goog-user-ip": + * { "reason": "SYSTEM_PARAMETER_UNSUPPORTED", + * "domain": "googleapis.com", + * "metadata": { + * "service": "pubsub.googleapis.com" + * "parameter": "x-goog-user-ip" + * } + * } + * + * Generated from protobuf enum SYSTEM_PARAMETER_UNSUPPORTED = 26; + */ + const SYSTEM_PARAMETER_UNSUPPORTED = 26; + /** + * The request is denied because it violates Org Restriction: the requested + * resource does not belong to allowed organizations specified in + * "X-Goog-Allowed-Resources" header. + * Example of an ErrorInfo when accessing a GCP resource that is restricted by + * Org Restriction for "pubsub.googleapis.com" service. + * { + * reason: "ORG_RESTRICTION_VIOLATION" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum ORG_RESTRICTION_VIOLATION = 27; + */ + const ORG_RESTRICTION_VIOLATION = 27; + /** + * The request is denied because "X-Goog-Allowed-Resources" header is in a bad + * format. + * Example of an ErrorInfo when + * accessing "pubsub.googleapis.com" service with an invalid + * "X-Goog-Allowed-Resources" request header. + * { + * reason: "ORG_RESTRICTION_HEADER_INVALID" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum ORG_RESTRICTION_HEADER_INVALID = 28; + */ + const ORG_RESTRICTION_HEADER_INVALID = 28; + /** + * Unimplemented. Do not use. + * The request is calling a service that is not visible to the consumer. + * Example of an ErrorInfo when the consumer "projects/123" contacting + * "pubsub.googleapis.com" service which is not visible to the consumer. + * { "reason": "SERVICE_NOT_VISIBLE", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "pubsub.googleapis.com" + * } + * } + * This response indicates the "pubsub.googleapis.com" is not visible to + * "projects/123" (or it may not exist). + * + * Generated from protobuf enum SERVICE_NOT_VISIBLE = 29; + */ + const SERVICE_NOT_VISIBLE = 29; + /** + * The request is related to a project for which GCP access is suspended. + * Example of an ErrorInfo when the consumer "projects/123" fails to contact + * "pubsub.googleapis.com" service because GCP access is suspended: + * { "reason": "GCP_SUSPENDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "pubsub.googleapis.com" + * } + * } + * This response indicates the associated GCP account has been suspended. + * + * Generated from protobuf enum GCP_SUSPENDED = 30; + */ + const GCP_SUSPENDED = 30; + /** + * The request violates the location policies when creating resources in + * the restricted region. + * Example of an ErrorInfo when creating the Cloud Storage Bucket by + * "projects/123" for service storage.googleapis.com: + * { "reason": "LOCATION_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * } + * } + * This response indicates creating the Cloud Storage Bucket in + * "locations/asia-northeast3" violates at least one location policy. + * The troubleshooting guidance is provided in the Help links. + * + * Generated from protobuf enum LOCATION_POLICY_VIOLATED = 31; + */ + const LOCATION_POLICY_VIOLATED = 31; + /** + * The request is denied because origin request header is missing. + * Example of an ErrorInfo when + * accessing "pubsub.googleapis.com" service with an empty "Origin" request + * header. + * { + * reason: "MISSING_ORIGIN" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum MISSING_ORIGIN = 33; + */ + const MISSING_ORIGIN = 33; + /** + * The request is denied because the request contains more than one credential + * type that are individually acceptable, but not together. The customer + * should retry their request with only one set of credentials. + * Example of an ErrorInfo when + * accessing "pubsub.googleapis.com" service with overloaded credentials. + * { + * reason: "OVERLOADED_CREDENTIALS" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum OVERLOADED_CREDENTIALS = 34; + */ + const OVERLOADED_CREDENTIALS = 34; + + private static $valueToName = [ + self::ERROR_REASON_UNSPECIFIED => 'ERROR_REASON_UNSPECIFIED', + self::SERVICE_DISABLED => 'SERVICE_DISABLED', + self::BILLING_DISABLED => 'BILLING_DISABLED', + self::API_KEY_INVALID => 'API_KEY_INVALID', + self::API_KEY_SERVICE_BLOCKED => 'API_KEY_SERVICE_BLOCKED', + self::API_KEY_HTTP_REFERRER_BLOCKED => 'API_KEY_HTTP_REFERRER_BLOCKED', + self::API_KEY_IP_ADDRESS_BLOCKED => 'API_KEY_IP_ADDRESS_BLOCKED', + self::API_KEY_ANDROID_APP_BLOCKED => 'API_KEY_ANDROID_APP_BLOCKED', + self::API_KEY_IOS_APP_BLOCKED => 'API_KEY_IOS_APP_BLOCKED', + self::RATE_LIMIT_EXCEEDED => 'RATE_LIMIT_EXCEEDED', + self::RESOURCE_QUOTA_EXCEEDED => 'RESOURCE_QUOTA_EXCEEDED', + self::LOCATION_TAX_POLICY_VIOLATED => 'LOCATION_TAX_POLICY_VIOLATED', + self::USER_PROJECT_DENIED => 'USER_PROJECT_DENIED', + self::CONSUMER_SUSPENDED => 'CONSUMER_SUSPENDED', + self::CONSUMER_INVALID => 'CONSUMER_INVALID', + self::SECURITY_POLICY_VIOLATED => 'SECURITY_POLICY_VIOLATED', + self::ACCESS_TOKEN_EXPIRED => 'ACCESS_TOKEN_EXPIRED', + self::ACCESS_TOKEN_SCOPE_INSUFFICIENT => 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', + self::ACCOUNT_STATE_INVALID => 'ACCOUNT_STATE_INVALID', + self::ACCESS_TOKEN_TYPE_UNSUPPORTED => 'ACCESS_TOKEN_TYPE_UNSUPPORTED', + self::CREDENTIALS_MISSING => 'CREDENTIALS_MISSING', + self::RESOURCE_PROJECT_INVALID => 'RESOURCE_PROJECT_INVALID', + self::SESSION_COOKIE_INVALID => 'SESSION_COOKIE_INVALID', + self::USER_BLOCKED_BY_ADMIN => 'USER_BLOCKED_BY_ADMIN', + self::RESOURCE_USAGE_RESTRICTION_VIOLATED => 'RESOURCE_USAGE_RESTRICTION_VIOLATED', + self::SYSTEM_PARAMETER_UNSUPPORTED => 'SYSTEM_PARAMETER_UNSUPPORTED', + self::ORG_RESTRICTION_VIOLATION => 'ORG_RESTRICTION_VIOLATION', + self::ORG_RESTRICTION_HEADER_INVALID => 'ORG_RESTRICTION_HEADER_INVALID', + self::SERVICE_NOT_VISIBLE => 'SERVICE_NOT_VISIBLE', + self::GCP_SUSPENDED => 'GCP_SUSPENDED', + self::LOCATION_POLICY_VIOLATED => 'LOCATION_POLICY_VIOLATED', + self::MISSING_ORIGIN => 'MISSING_ORIGIN', + self::OVERLOADED_CREDENTIALS => 'OVERLOADED_CREDENTIALS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/FieldBehavior.php b/vendor/google/common-protos/src/Api/FieldBehavior.php new file mode 100644 index 0000000..4c57c50 --- /dev/null +++ b/vendor/google/common-protos/src/Api/FieldBehavior.php @@ -0,0 +1,133 @@ +google.api.FieldBehavior + */ +class FieldBehavior +{ + /** + * Conventional default for enums. Do not use this. + * + * Generated from protobuf enum FIELD_BEHAVIOR_UNSPECIFIED = 0; + */ + const FIELD_BEHAVIOR_UNSPECIFIED = 0; + /** + * Specifically denotes a field as optional. + * While all fields in protocol buffers are optional, this may be specified + * for emphasis if appropriate. + * + * Generated from protobuf enum OPTIONAL = 1; + */ + const OPTIONAL = 1; + /** + * Denotes a field as required. + * This indicates that the field **must** be provided as part of the request, + * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + * + * Generated from protobuf enum REQUIRED = 2; + */ + const REQUIRED = 2; + /** + * Denotes a field as output only. + * This indicates that the field is provided in responses, but including the + * field in a request does nothing (the server *must* ignore it and + * *must not* throw an error as a result of the field's presence). + * + * Generated from protobuf enum OUTPUT_ONLY = 3; + */ + const OUTPUT_ONLY = 3; + /** + * Denotes a field as input only. + * This indicates that the field is provided in requests, and the + * corresponding field is not included in output. + * + * Generated from protobuf enum INPUT_ONLY = 4; + */ + const INPUT_ONLY = 4; + /** + * Denotes a field as immutable. + * This indicates that the field may be set once in a request to create a + * resource, but may not be changed thereafter. + * + * Generated from protobuf enum IMMUTABLE = 5; + */ + const IMMUTABLE = 5; + /** + * Denotes that a (repeated) field is an unordered list. + * This indicates that the service may provide the elements of the list + * in any arbitrary order, rather than the order the user originally + * provided. Additionally, the list's order may or may not be stable. + * + * Generated from protobuf enum UNORDERED_LIST = 6; + */ + const UNORDERED_LIST = 6; + /** + * Denotes that this field returns a non-empty default value if not set. + * This indicates that if the user provides the empty value in a request, + * a non-empty value will be returned. The user will not be aware of what + * non-empty value to expect. + * + * Generated from protobuf enum NON_EMPTY_DEFAULT = 7; + */ + const NON_EMPTY_DEFAULT = 7; + /** + * Denotes that the field in a resource (a message annotated with + * google.api.resource) is used in the resource name to uniquely identify the + * resource. For AIP-compliant APIs, this should only be applied to the + * `name` field on the resource. + * This behavior should not be applied to references to other resources within + * the message. + * The identifier field of resources often have different field behavior + * depending on the request it is embedded in (e.g. for Create methods name + * is optional and unused, while for Update methods it is required). Instead + * of method-specific annotations, only `IDENTIFIER` is required. + * + * Generated from protobuf enum IDENTIFIER = 8; + */ + const IDENTIFIER = 8; + + private static $valueToName = [ + self::FIELD_BEHAVIOR_UNSPECIFIED => 'FIELD_BEHAVIOR_UNSPECIFIED', + self::OPTIONAL => 'OPTIONAL', + self::REQUIRED => 'REQUIRED', + self::OUTPUT_ONLY => 'OUTPUT_ONLY', + self::INPUT_ONLY => 'INPUT_ONLY', + self::IMMUTABLE => 'IMMUTABLE', + self::UNORDERED_LIST => 'UNORDERED_LIST', + self::NON_EMPTY_DEFAULT => 'NON_EMPTY_DEFAULT', + self::IDENTIFIER => 'IDENTIFIER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/FieldInfo.php b/vendor/google/common-protos/src/Api/FieldInfo.php new file mode 100644 index 0000000..617bf40 --- /dev/null +++ b/vendor/google/common-protos/src/Api/FieldInfo.php @@ -0,0 +1,117 @@ +google.api.FieldInfo + */ +class FieldInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The standard format of a field value. This does not explicitly configure + * any API consumer, just documents the API's format for the field it is + * applied to. + * + * Generated from protobuf field .google.api.FieldInfo.Format format = 1; + */ + protected $format = 0; + /** + * The type(s) that the annotated, generic field may represent. + * Currently, this must only be used on fields of type `google.protobuf.Any`. + * Supporting other generic types may be considered in the future. + * + * Generated from protobuf field repeated .google.api.TypeReference referenced_types = 2; + */ + private $referenced_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $format + * The standard format of a field value. This does not explicitly configure + * any API consumer, just documents the API's format for the field it is + * applied to. + * @type array<\Google\Api\TypeReference>|\Google\Protobuf\Internal\RepeatedField $referenced_types + * The type(s) that the annotated, generic field may represent. + * Currently, this must only be used on fields of type `google.protobuf.Any`. + * Supporting other generic types may be considered in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\FieldInfo::initOnce(); + parent::__construct($data); + } + + /** + * The standard format of a field value. This does not explicitly configure + * any API consumer, just documents the API's format for the field it is + * applied to. + * + * Generated from protobuf field .google.api.FieldInfo.Format format = 1; + * @return int + */ + public function getFormat() + { + return $this->format; + } + + /** + * The standard format of a field value. This does not explicitly configure + * any API consumer, just documents the API's format for the field it is + * applied to. + * + * Generated from protobuf field .google.api.FieldInfo.Format format = 1; + * @param int $var + * @return $this + */ + public function setFormat($var) + { + GPBUtil::checkEnum($var, \Google\Api\FieldInfo\Format::class); + $this->format = $var; + + return $this; + } + + /** + * The type(s) that the annotated, generic field may represent. + * Currently, this must only be used on fields of type `google.protobuf.Any`. + * Supporting other generic types may be considered in the future. + * + * Generated from protobuf field repeated .google.api.TypeReference referenced_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReferencedTypes() + { + return $this->referenced_types; + } + + /** + * The type(s) that the annotated, generic field may represent. + * Currently, this must only be used on fields of type `google.protobuf.Any`. + * Supporting other generic types may be considered in the future. + * + * Generated from protobuf field repeated .google.api.TypeReference referenced_types = 2; + * @param array<\Google\Api\TypeReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReferencedTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\TypeReference::class); + $this->referenced_types = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/FieldInfo/Format.php b/vendor/google/common-protos/src/Api/FieldInfo/Format.php new file mode 100644 index 0000000..1977ca9 --- /dev/null +++ b/vendor/google/common-protos/src/Api/FieldInfo/Format.php @@ -0,0 +1,90 @@ +google.api.FieldInfo.Format + */ +class Format +{ + /** + * Default, unspecified value. + * + * Generated from protobuf enum FORMAT_UNSPECIFIED = 0; + */ + const FORMAT_UNSPECIFIED = 0; + /** + * Universally Unique Identifier, version 4, value as defined by + * https://datatracker.ietf.org/doc/html/rfc4122. The value may be + * normalized to entirely lowercase letters. For example, the value + * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + * `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + * + * Generated from protobuf enum UUID4 = 1; + */ + const UUID4 = 1; + /** + * Internet Protocol v4 value as defined by [RFC + * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + * condensed, with leading zeros in each octet stripped. For example, + * `001.022.233.040` would be condensed to `1.22.233.40`. + * + * Generated from protobuf enum IPV4 = 2; + */ + const IPV4 = 2; + /** + * Internet Protocol v6 value as defined by [RFC + * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + * normalized to entirely lowercase letters with zeros compressed, following + * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + * the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + * + * Generated from protobuf enum IPV6 = 3; + */ + const IPV6 = 3; + /** + * An IP address in either v4 or v6 format as described by the individual + * values defined herein. See the comments on the IPV4 and IPV6 types for + * allowed normalizations of each. + * + * Generated from protobuf enum IPV4_OR_IPV6 = 4; + */ + const IPV4_OR_IPV6 = 4; + + private static $valueToName = [ + self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', + self::UUID4 => 'UUID4', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + self::IPV4_OR_IPV6 => 'IPV4_OR_IPV6', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/FieldPolicy.php b/vendor/google/common-protos/src/Api/FieldPolicy.php new file mode 100644 index 0000000..53474a4 --- /dev/null +++ b/vendor/google/common-protos/src/Api/FieldPolicy.php @@ -0,0 +1,181 @@ +google.api.FieldPolicy + */ +class FieldPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Selects one or more request or response message fields to apply this + * `FieldPolicy`. + * When a `FieldPolicy` is used in proto annotation, the selector must + * be left as empty. The service config generator will automatically fill + * the correct value. + * When a `FieldPolicy` is used in service config, the selector must be a + * comma-separated string with valid request or response field paths, + * such as "foo.bar" or "foo.bar,foo.baz". + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * Specifies the required permission(s) for the resource referred to by the + * field. It requires the field contains a valid resource reference, and + * the request must pass the permission checks to proceed. For example, + * "resourcemanager.projects.get". + * + * Generated from protobuf field string resource_permission = 2; + */ + protected $resource_permission = ''; + /** + * Specifies the resource type for the resource referred to by the field. + * + * Generated from protobuf field string resource_type = 3; + */ + protected $resource_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects one or more request or response message fields to apply this + * `FieldPolicy`. + * When a `FieldPolicy` is used in proto annotation, the selector must + * be left as empty. The service config generator will automatically fill + * the correct value. + * When a `FieldPolicy` is used in service config, the selector must be a + * comma-separated string with valid request or response field paths, + * such as "foo.bar" or "foo.bar,foo.baz". + * @type string $resource_permission + * Specifies the required permission(s) for the resource referred to by the + * field. It requires the field contains a valid resource reference, and + * the request must pass the permission checks to proceed. For example, + * "resourcemanager.projects.get". + * @type string $resource_type + * Specifies the resource type for the resource referred to by the field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Policy::initOnce(); + parent::__construct($data); + } + + /** + * Selects one or more request or response message fields to apply this + * `FieldPolicy`. + * When a `FieldPolicy` is used in proto annotation, the selector must + * be left as empty. The service config generator will automatically fill + * the correct value. + * When a `FieldPolicy` is used in service config, the selector must be a + * comma-separated string with valid request or response field paths, + * such as "foo.bar" or "foo.bar,foo.baz". + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects one or more request or response message fields to apply this + * `FieldPolicy`. + * When a `FieldPolicy` is used in proto annotation, the selector must + * be left as empty. The service config generator will automatically fill + * the correct value. + * When a `FieldPolicy` is used in service config, the selector must be a + * comma-separated string with valid request or response field paths, + * such as "foo.bar" or "foo.bar,foo.baz". + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Specifies the required permission(s) for the resource referred to by the + * field. It requires the field contains a valid resource reference, and + * the request must pass the permission checks to proceed. For example, + * "resourcemanager.projects.get". + * + * Generated from protobuf field string resource_permission = 2; + * @return string + */ + public function getResourcePermission() + { + return $this->resource_permission; + } + + /** + * Specifies the required permission(s) for the resource referred to by the + * field. It requires the field contains a valid resource reference, and + * the request must pass the permission checks to proceed. For example, + * "resourcemanager.projects.get". + * + * Generated from protobuf field string resource_permission = 2; + * @param string $var + * @return $this + */ + public function setResourcePermission($var) + { + GPBUtil::checkString($var, True); + $this->resource_permission = $var; + + return $this; + } + + /** + * Specifies the resource type for the resource referred to by the field. + * + * Generated from protobuf field string resource_type = 3; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Specifies the resource type for the resource referred to by the field. + * + * Generated from protobuf field string resource_type = 3; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/GoSettings.php b/vendor/google/common-protos/src/Api/GoSettings.php new file mode 100644 index 0000000..f70db3c --- /dev/null +++ b/vendor/google/common-protos/src/Api/GoSettings.php @@ -0,0 +1,135 @@ +google.api.GoSettings + */ +class GoSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + */ + private $renamed_services; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * @type array|\Google\Protobuf\Internal\MapField $renamed_services + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRenamedServices() + { + return $this->renamed_services; + } + + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRenamedServices($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->renamed_services = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Http.php b/vendor/google/common-protos/src/Api/Http.php new file mode 100644 index 0000000..712894e --- /dev/null +++ b/vendor/google/common-protos/src/Api/Http.php @@ -0,0 +1,123 @@ +google.api.Http + */ +class Http extends \Google\Protobuf\Internal\Message +{ + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.HttpRule rules = 1; + */ + private $rules; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + * + * Generated from protobuf field bool fully_decode_reserved_expansion = 2; + */ + protected $fully_decode_reserved_expansion = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * @type bool $fully_decode_reserved_expansion + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Http::initOnce(); + parent::__construct($data); + } + + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.HttpRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.HttpRule rules = 1; + * @param array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\HttpRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + * + * Generated from protobuf field bool fully_decode_reserved_expansion = 2; + * @return bool + */ + public function getFullyDecodeReservedExpansion() + { + return $this->fully_decode_reserved_expansion; + } + + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + * + * Generated from protobuf field bool fully_decode_reserved_expansion = 2; + * @param bool $var + * @return $this + */ + public function setFullyDecodeReservedExpansion($var) + { + GPBUtil::checkBool($var); + $this->fully_decode_reserved_expansion = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/HttpBody.php b/vendor/google/common-protos/src/Api/HttpBody.php new file mode 100644 index 0000000..c5626f1 --- /dev/null +++ b/vendor/google/common-protos/src/Api/HttpBody.php @@ -0,0 +1,168 @@ +google.api.HttpBody + */ +class HttpBody extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP Content-Type header value specifying the content type of the body. + * + * Generated from protobuf field string content_type = 1; + */ + protected $content_type = ''; + /** + * The HTTP request/response body as raw binary. + * + * Generated from protobuf field bytes data = 2; + */ + protected $data = ''; + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 3; + */ + private $extensions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content_type + * The HTTP Content-Type header value specifying the content type of the body. + * @type string $data + * The HTTP request/response body as raw binary. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Httpbody::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP Content-Type header value specifying the content type of the body. + * + * Generated from protobuf field string content_type = 1; + * @return string + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * The HTTP Content-Type header value specifying the content type of the body. + * + * Generated from protobuf field string content_type = 1; + * @param string $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkString($var, True); + $this->content_type = $var; + + return $this; + } + + /** + * The HTTP request/response body as raw binary. + * + * Generated from protobuf field bytes data = 2; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * The HTTP request/response body as raw binary. + * + * Generated from protobuf field bytes data = 2; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 3; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->extensions = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/HttpRule.php b/vendor/google/common-protos/src/Api/HttpRule.php new file mode 100644 index 0000000..3b72f5a --- /dev/null +++ b/vendor/google/common-protos/src/Api/HttpRule.php @@ -0,0 +1,651 @@ +google.api.HttpRule + */ +class HttpRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects a method to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * NOTE: the referred field must be present at the top-level of the request + * message type. + * + * Generated from protobuf field string body = 7; + */ + protected $body = ''; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * NOTE: The referred field must be present at the top-level of the response + * message type. + * + * Generated from protobuf field string response_body = 12; + */ + protected $response_body = ''; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + * + * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; + */ + private $additional_bindings; + protected $pattern; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects a method to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type string $get + * Maps to HTTP GET. Used for listing and getting information about + * resources. + * @type string $put + * Maps to HTTP PUT. Used for replacing a resource. + * @type string $post + * Maps to HTTP POST. Used for creating a resource or performing an action. + * @type string $delete + * Maps to HTTP DELETE. Used for deleting a resource. + * @type string $patch + * Maps to HTTP PATCH. Used for updating a resource. + * @type \Google\Api\CustomHttpPattern $custom + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + * @type string $body + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * NOTE: the referred field must be present at the top-level of the request + * message type. + * @type string $response_body + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * NOTE: The referred field must be present at the top-level of the response + * message type. + * @type array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $additional_bindings + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Http::initOnce(); + parent::__construct($data); + } + + /** + * Selects a method to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects a method to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + * + * Generated from protobuf field string get = 2; + * @return string + */ + public function getGet() + { + return $this->readOneof(2); + } + + public function hasGet() + { + return $this->hasOneof(2); + } + + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + * + * Generated from protobuf field string get = 2; + * @param string $var + * @return $this + */ + public function setGet($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Maps to HTTP PUT. Used for replacing a resource. + * + * Generated from protobuf field string put = 3; + * @return string + */ + public function getPut() + { + return $this->readOneof(3); + } + + public function hasPut() + { + return $this->hasOneof(3); + } + + /** + * Maps to HTTP PUT. Used for replacing a resource. + * + * Generated from protobuf field string put = 3; + * @param string $var + * @return $this + */ + public function setPut($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Maps to HTTP POST. Used for creating a resource or performing an action. + * + * Generated from protobuf field string post = 4; + * @return string + */ + public function getPost() + { + return $this->readOneof(4); + } + + public function hasPost() + { + return $this->hasOneof(4); + } + + /** + * Maps to HTTP POST. Used for creating a resource or performing an action. + * + * Generated from protobuf field string post = 4; + * @param string $var + * @return $this + */ + public function setPost($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Maps to HTTP DELETE. Used for deleting a resource. + * + * Generated from protobuf field string delete = 5; + * @return string + */ + public function getDelete() + { + return $this->readOneof(5); + } + + public function hasDelete() + { + return $this->hasOneof(5); + } + + /** + * Maps to HTTP DELETE. Used for deleting a resource. + * + * Generated from protobuf field string delete = 5; + * @param string $var + * @return $this + */ + public function setDelete($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Maps to HTTP PATCH. Used for updating a resource. + * + * Generated from protobuf field string patch = 6; + * @return string + */ + public function getPatch() + { + return $this->readOneof(6); + } + + public function hasPatch() + { + return $this->hasOneof(6); + } + + /** + * Maps to HTTP PATCH. Used for updating a resource. + * + * Generated from protobuf field string patch = 6; + * @param string $var + * @return $this + */ + public function setPatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + * + * Generated from protobuf field .google.api.CustomHttpPattern custom = 8; + * @return \Google\Api\CustomHttpPattern|null + */ + public function getCustom() + { + return $this->readOneof(8); + } + + public function hasCustom() + { + return $this->hasOneof(8); + } + + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + * + * Generated from protobuf field .google.api.CustomHttpPattern custom = 8; + * @param \Google\Api\CustomHttpPattern $var + * @return $this + */ + public function setCustom($var) + { + GPBUtil::checkMessage($var, \Google\Api\CustomHttpPattern::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * NOTE: the referred field must be present at the top-level of the request + * message type. + * + * Generated from protobuf field string body = 7; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * NOTE: the referred field must be present at the top-level of the request + * message type. + * + * Generated from protobuf field string body = 7; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, True); + $this->body = $var; + + return $this; + } + + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * NOTE: The referred field must be present at the top-level of the response + * message type. + * + * Generated from protobuf field string response_body = 12; + * @return string + */ + public function getResponseBody() + { + return $this->response_body; + } + + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * NOTE: The referred field must be present at the top-level of the response + * message type. + * + * Generated from protobuf field string response_body = 12; + * @param string $var + * @return $this + */ + public function setResponseBody($var) + { + GPBUtil::checkString($var, True); + $this->response_body = $var; + + return $this; + } + + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + * + * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalBindings() + { + return $this->additional_bindings; + } + + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + * + * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; + * @param array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\HttpRule::class); + $this->additional_bindings = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPattern() + { + return $this->whichOneof("pattern"); + } + +} + diff --git a/vendor/google/common-protos/src/Api/JavaSettings.php b/vendor/google/common-protos/src/Api/JavaSettings.php new file mode 100644 index 0000000..cddb41b --- /dev/null +++ b/vendor/google/common-protos/src/Api/JavaSettings.php @@ -0,0 +1,221 @@ +google.api.JavaSettings + */ +class JavaSettings extends \Google\Protobuf\Internal\Message +{ + /** + * The package name to use in Java. Clobbers the java_package option + * set in the protobuf. This should be used **only** by APIs + * who have already set the language_settings.java.package_name" field + * in gapic.yaml. API teams should use the protobuf java_package option + * where possible. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 + * + * Generated from protobuf field string library_package = 1; + */ + protected $library_package = ''; + /** + * Configure the Java class name to use instead of the service's for its + * corresponding generated GAPIC client. Keys are fully-qualified + * service names as they appear in the protobuf (including the full + * the language_settings.java.interface_names" field in gapic.yaml. API + * teams should otherwise use the service name as it appears in the + * protobuf. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * Generated from protobuf field map service_class_names = 2; + */ + private $service_class_names; + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 3; + */ + protected $common = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $library_package + * The package name to use in Java. Clobbers the java_package option + * set in the protobuf. This should be used **only** by APIs + * who have already set the language_settings.java.package_name" field + * in gapic.yaml. API teams should use the protobuf java_package option + * where possible. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 + * @type array|\Google\Protobuf\Internal\MapField $service_class_names + * Configure the Java class name to use instead of the service's for its + * corresponding generated GAPIC client. Keys are fully-qualified + * service names as they appear in the protobuf (including the full + * the language_settings.java.interface_names" field in gapic.yaml. API + * teams should otherwise use the service name as it appears in the + * protobuf. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * The package name to use in Java. Clobbers the java_package option + * set in the protobuf. This should be used **only** by APIs + * who have already set the language_settings.java.package_name" field + * in gapic.yaml. API teams should use the protobuf java_package option + * where possible. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 + * + * Generated from protobuf field string library_package = 1; + * @return string + */ + public function getLibraryPackage() + { + return $this->library_package; + } + + /** + * The package name to use in Java. Clobbers the java_package option + * set in the protobuf. This should be used **only** by APIs + * who have already set the language_settings.java.package_name" field + * in gapic.yaml. API teams should use the protobuf java_package option + * where possible. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 + * + * Generated from protobuf field string library_package = 1; + * @param string $var + * @return $this + */ + public function setLibraryPackage($var) + { + GPBUtil::checkString($var, True); + $this->library_package = $var; + + return $this; + } + + /** + * Configure the Java class name to use instead of the service's for its + * corresponding generated GAPIC client. Keys are fully-qualified + * service names as they appear in the protobuf (including the full + * the language_settings.java.interface_names" field in gapic.yaml. API + * teams should otherwise use the service name as it appears in the + * protobuf. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * Generated from protobuf field map service_class_names = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getServiceClassNames() + { + return $this->service_class_names; + } + + /** + * Configure the Java class name to use instead of the service's for its + * corresponding generated GAPIC client. Keys are fully-qualified + * service names as they appear in the protobuf (including the full + * the language_settings.java.interface_names" field in gapic.yaml. API + * teams should otherwise use the service name as it appears in the + * protobuf. + * Example of a YAML configuration:: + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * Generated from protobuf field map service_class_names = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setServiceClassNames($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->service_class_names = $arr; + + return $this; + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 3; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 3; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/JwtLocation.php b/vendor/google/common-protos/src/Api/JwtLocation.php new file mode 100644 index 0000000..1bfbdd8 --- /dev/null +++ b/vendor/google/common-protos/src/Api/JwtLocation.php @@ -0,0 +1,199 @@ +google.api.JwtLocation + */ +class JwtLocation extends \Google\Protobuf\Internal\Message +{ + /** + * The value prefix. The value format is "value_prefix{token}" + * Only applies to "in" header type. Must be empty for "in" query type. + * If not empty, the header value has to match (case sensitive) this prefix. + * If not matched, JWT will not be extracted. If matched, JWT will be + * extracted after the prefix is removed. + * For example, for "Authorization: Bearer {JWT}", + * value_prefix="Bearer " with a space at the end. + * + * Generated from protobuf field string value_prefix = 3; + */ + protected $value_prefix = ''; + protected $in; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header + * Specifies HTTP header name to extract JWT token. + * @type string $query + * Specifies URL query parameter name to extract JWT token. + * @type string $cookie + * Specifies cookie name to extract JWT token. + * @type string $value_prefix + * The value prefix. The value format is "value_prefix{token}" + * Only applies to "in" header type. Must be empty for "in" query type. + * If not empty, the header value has to match (case sensitive) this prefix. + * If not matched, JWT will not be extracted. If matched, JWT will be + * extracted after the prefix is removed. + * For example, for "Authorization: Bearer {JWT}", + * value_prefix="Bearer " with a space at the end. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * Specifies HTTP header name to extract JWT token. + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->readOneof(1); + } + + public function hasHeader() + { + return $this->hasOneof(1); + } + + /** + * Specifies HTTP header name to extract JWT token. + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Specifies URL query parameter name to extract JWT token. + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->readOneof(2); + } + + public function hasQuery() + { + return $this->hasOneof(2); + } + + /** + * Specifies URL query parameter name to extract JWT token. + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Specifies cookie name to extract JWT token. + * + * Generated from protobuf field string cookie = 4; + * @return string + */ + public function getCookie() + { + return $this->readOneof(4); + } + + public function hasCookie() + { + return $this->hasOneof(4); + } + + /** + * Specifies cookie name to extract JWT token. + * + * Generated from protobuf field string cookie = 4; + * @param string $var + * @return $this + */ + public function setCookie($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The value prefix. The value format is "value_prefix{token}" + * Only applies to "in" header type. Must be empty for "in" query type. + * If not empty, the header value has to match (case sensitive) this prefix. + * If not matched, JWT will not be extracted. If matched, JWT will be + * extracted after the prefix is removed. + * For example, for "Authorization: Bearer {JWT}", + * value_prefix="Bearer " with a space at the end. + * + * Generated from protobuf field string value_prefix = 3; + * @return string + */ + public function getValuePrefix() + { + return $this->value_prefix; + } + + /** + * The value prefix. The value format is "value_prefix{token}" + * Only applies to "in" header type. Must be empty for "in" query type. + * If not empty, the header value has to match (case sensitive) this prefix. + * If not matched, JWT will not be extracted. If matched, JWT will be + * extracted after the prefix is removed. + * For example, for "Authorization: Bearer {JWT}", + * value_prefix="Bearer " with a space at the end. + * + * Generated from protobuf field string value_prefix = 3; + * @param string $var + * @return $this + */ + public function setValuePrefix($var) + { + GPBUtil::checkString($var, True); + $this->value_prefix = $var; + + return $this; + } + + /** + * @return string + */ + public function getIn() + { + return $this->whichOneof("in"); + } + +} + diff --git a/vendor/google/common-protos/src/Api/LabelDescriptor.php b/vendor/google/common-protos/src/Api/LabelDescriptor.php new file mode 100644 index 0000000..67fa39a --- /dev/null +++ b/vendor/google/common-protos/src/Api/LabelDescriptor.php @@ -0,0 +1,135 @@ +google.api.LabelDescriptor + */ +class LabelDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The label key. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The type of data that can be assigned to the label. + * + * Generated from protobuf field .google.api.LabelDescriptor.ValueType value_type = 2; + */ + protected $value_type = 0; + /** + * A human-readable description for the label. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The label key. + * @type int $value_type + * The type of data that can be assigned to the label. + * @type string $description + * A human-readable description for the label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Label::initOnce(); + parent::__construct($data); + } + + /** + * The label key. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The label key. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The type of data that can be assigned to the label. + * + * Generated from protobuf field .google.api.LabelDescriptor.ValueType value_type = 2; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * The type of data that can be assigned to the label. + * + * Generated from protobuf field .google.api.LabelDescriptor.ValueType value_type = 2; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Api\LabelDescriptor\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * A human-readable description for the label. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A human-readable description for the label. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/LabelDescriptor/ValueType.php b/vendor/google/common-protos/src/Api/LabelDescriptor/ValueType.php new file mode 100644 index 0000000..044b29d --- /dev/null +++ b/vendor/google/common-protos/src/Api/LabelDescriptor/ValueType.php @@ -0,0 +1,62 @@ +google.api.LabelDescriptor.ValueType + */ +class ValueType +{ + /** + * A variable-length string. This is the default. + * + * Generated from protobuf enum STRING = 0; + */ + const STRING = 0; + /** + * Boolean; true or false. + * + * Generated from protobuf enum BOOL = 1; + */ + const BOOL = 1; + /** + * A 64-bit signed integer. + * + * Generated from protobuf enum INT64 = 2; + */ + const INT64 = 2; + + private static $valueToName = [ + self::STRING => 'STRING', + self::BOOL => 'BOOL', + self::INT64 => 'INT64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/LaunchStage.php b/vendor/google/common-protos/src/Api/LaunchStage.php new file mode 100644 index 0000000..766aa79 --- /dev/null +++ b/vendor/google/common-protos/src/Api/LaunchStage.php @@ -0,0 +1,118 @@ +google.api.LaunchStage + */ +class LaunchStage +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum LAUNCH_STAGE_UNSPECIFIED = 0; + */ + const LAUNCH_STAGE_UNSPECIFIED = 0; + /** + * The feature is not yet implemented. Users can not use it. + * + * Generated from protobuf enum UNIMPLEMENTED = 6; + */ + const UNIMPLEMENTED = 6; + /** + * Prelaunch features are hidden from users and are only visible internally. + * + * Generated from protobuf enum PRELAUNCH = 7; + */ + const PRELAUNCH = 7; + /** + * Early Access features are limited to a closed group of testers. To use + * these features, you must sign up in advance and sign a Trusted Tester + * agreement (which includes confidentiality provisions). These features may + * be unstable, changed in backward-incompatible ways, and are not + * guaranteed to be released. + * + * Generated from protobuf enum EARLY_ACCESS = 1; + */ + const EARLY_ACCESS = 1; + /** + * Alpha is a limited availability test for releases before they are cleared + * for widespread use. By Alpha, all significant design issues are resolved + * and we are in the process of verifying functionality. Alpha customers + * need to apply for access, agree to applicable terms, and have their + * projects allowlisted. Alpha releases don't have to be feature complete, + * no SLAs are provided, and there are no technical support obligations, but + * they will be far enough along that customers can actually use them in + * test environments or for limited-use tests -- just like they would in + * normal production cases. + * + * Generated from protobuf enum ALPHA = 2; + */ + const ALPHA = 2; + /** + * Beta is the point at which we are ready to open a release for any + * customer to use. There are no SLA or technical support obligations in a + * Beta release. Products will be complete from a feature perspective, but + * may have some open outstanding issues. Beta releases are suitable for + * limited production use cases. + * + * Generated from protobuf enum BETA = 3; + */ + const BETA = 3; + /** + * GA features are open to all developers and are considered stable and + * fully qualified for production use. + * + * Generated from protobuf enum GA = 4; + */ + const GA = 4; + /** + * Deprecated features are scheduled to be shut down and removed. For more + * information, see the "Deprecation Policy" section of our [Terms of + * Service](https://cloud.google.com/terms/) + * and the [Google Cloud Platform Subject to the Deprecation + * Policy](https://cloud.google.com/terms/deprecation) documentation. + * + * Generated from protobuf enum DEPRECATED = 5; + */ + const DEPRECATED = 5; + + private static $valueToName = [ + self::LAUNCH_STAGE_UNSPECIFIED => 'LAUNCH_STAGE_UNSPECIFIED', + self::UNIMPLEMENTED => 'UNIMPLEMENTED', + self::PRELAUNCH => 'PRELAUNCH', + self::EARLY_ACCESS => 'EARLY_ACCESS', + self::ALPHA => 'ALPHA', + self::BETA => 'BETA', + self::GA => 'GA', + self::DEPRECATED => 'DEPRECATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Api/LogDescriptor.php b/vendor/google/common-protos/src/Api/LogDescriptor.php new file mode 100644 index 0000000..bb48558 --- /dev/null +++ b/vendor/google/common-protos/src/Api/LogDescriptor.php @@ -0,0 +1,203 @@ +google.api.LogDescriptor + */ +class LogDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including + * slash, underscore, hyphen, period [/_-.]. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are + * considered invalid. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + */ + private $labels; + /** + * A human-readable description of this log. This information appears in + * the documentation and can contain details. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * The human-readable name for this log. This information appears on + * the user interface and should be concise. + * + * Generated from protobuf field string display_name = 4; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including + * slash, underscore, hyphen, period [/_-.]. + * @type array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are + * considered invalid. + * @type string $description + * A human-readable description of this log. This information appears in + * the documentation and can contain details. + * @type string $display_name + * The human-readable name for this log. This information appears on + * the user interface and should be concise. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Log::initOnce(); + parent::__construct($data); + } + + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including + * slash, underscore, hyphen, period [/_-.]. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including + * slash, underscore, hyphen, period [/_-.]. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are + * considered invalid. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are + * considered invalid. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + * @param array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); + $this->labels = $arr; + + return $this; + } + + /** + * A human-readable description of this log. This information appears in + * the documentation and can contain details. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A human-readable description of this log. This information appears in + * the documentation and can contain details. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The human-readable name for this log. This information appears on + * the user interface and should be concise. + * + * Generated from protobuf field string display_name = 4; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The human-readable name for this log. This information appears on + * the user interface and should be concise. + * + * Generated from protobuf field string display_name = 4; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Logging.php b/vendor/google/common-protos/src/Api/Logging.php new file mode 100644 index 0000000..52198c1 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Logging.php @@ -0,0 +1,151 @@ +google.api.Logging + */ +class Logging extends \Google\Protobuf\Internal\Message +{ + /** + * Logging configurations for sending logs to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one producer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination producer_destinations = 1; + */ + private $producer_destinations; + /** + * Logging configurations for sending logs to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; + */ + private $consumer_destinations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\Logging\LoggingDestination>|\Google\Protobuf\Internal\RepeatedField $producer_destinations + * Logging configurations for sending logs to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one producer destination. + * @type array<\Google\Api\Logging\LoggingDestination>|\Google\Protobuf\Internal\RepeatedField $consumer_destinations + * Logging configurations for sending logs to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one consumer destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Logging configurations for sending logs to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one producer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination producer_destinations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducerDestinations() + { + return $this->producer_destinations; + } + + /** + * Logging configurations for sending logs to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one producer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination producer_destinations = 1; + * @param array<\Google\Api\Logging\LoggingDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducerDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Logging\LoggingDestination::class); + $this->producer_destinations = $arr; + + return $this; + } + + /** + * Logging configurations for sending logs to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerDestinations() + { + return $this->consumer_destinations; + } + + /** + * Logging configurations for sending logs to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A log can be used in at most + * one consumer destination. + * + * Generated from protobuf field repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; + * @param array<\Google\Api\Logging\LoggingDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Logging\LoggingDestination::class); + $this->consumer_destinations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Logging/LoggingDestination.php b/vendor/google/common-protos/src/Api/Logging/LoggingDestination.php new file mode 100644 index 0000000..22d2e91 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Logging/LoggingDestination.php @@ -0,0 +1,123 @@ +google.api.Logging.LoggingDestination + */ +class LoggingDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The monitored resource type. The type must be defined in the + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 3; + */ + protected $monitored_resource = ''; + /** + * Names of the logs to be sent to this destination. Each name must + * be defined in the [Service.logs][google.api.Service.logs] section. If the + * log name is not a domain scoped name, it will be automatically prefixed + * with the service name followed by "/". + * + * Generated from protobuf field repeated string logs = 1; + */ + private $logs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $monitored_resource + * The monitored resource type. The type must be defined in the + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * @type array|\Google\Protobuf\Internal\RepeatedField $logs + * Names of the logs to be sent to this destination. Each name must + * be defined in the [Service.logs][google.api.Service.logs] section. If the + * log name is not a domain scoped name, it will be automatically prefixed + * with the service name followed by "/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Logging::initOnce(); + parent::__construct($data); + } + + /** + * The monitored resource type. The type must be defined in the + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 3; + * @return string + */ + public function getMonitoredResource() + { + return $this->monitored_resource; + } + + /** + * The monitored resource type. The type must be defined in the + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 3; + * @param string $var + * @return $this + */ + public function setMonitoredResource($var) + { + GPBUtil::checkString($var, True); + $this->monitored_resource = $var; + + return $this; + } + + /** + * Names of the logs to be sent to this destination. Each name must + * be defined in the [Service.logs][google.api.Service.logs] section. If the + * log name is not a domain scoped name, it will be automatically prefixed + * with the service name followed by "/". + * + * Generated from protobuf field repeated string logs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogs() + { + return $this->logs; + } + + /** + * Names of the logs to be sent to this destination. Each name must + * be defined in the [Service.logs][google.api.Service.logs] section. If the + * log name is not a domain scoped name, it will be automatically prefixed + * with the service name followed by "/". + * + * Generated from protobuf field repeated string logs = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->logs = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/MethodPolicy.php b/vendor/google/common-protos/src/Api/MethodPolicy.php new file mode 100644 index 0000000..faeb40a --- /dev/null +++ b/vendor/google/common-protos/src/Api/MethodPolicy.php @@ -0,0 +1,121 @@ +google.api.MethodPolicy + */ +class MethodPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Selects a method to which these policies should be enforced, for example, + * "google.pubsub.v1.Subscriber.CreateSubscription". + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * NOTE: This field must not be set in the proto annotation. It will be + * automatically filled by the service config compiler . + * + * Generated from protobuf field string selector = 9; + */ + protected $selector = ''; + /** + * Policies that are applicable to the request message. + * + * Generated from protobuf field repeated .google.api.FieldPolicy request_policies = 2; + */ + private $request_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects a method to which these policies should be enforced, for example, + * "google.pubsub.v1.Subscriber.CreateSubscription". + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * NOTE: This field must not be set in the proto annotation. It will be + * automatically filled by the service config compiler . + * @type array<\Google\Api\FieldPolicy>|\Google\Protobuf\Internal\RepeatedField $request_policies + * Policies that are applicable to the request message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Policy::initOnce(); + parent::__construct($data); + } + + /** + * Selects a method to which these policies should be enforced, for example, + * "google.pubsub.v1.Subscriber.CreateSubscription". + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * NOTE: This field must not be set in the proto annotation. It will be + * automatically filled by the service config compiler . + * + * Generated from protobuf field string selector = 9; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects a method to which these policies should be enforced, for example, + * "google.pubsub.v1.Subscriber.CreateSubscription". + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * NOTE: This field must not be set in the proto annotation. It will be + * automatically filled by the service config compiler . + * + * Generated from protobuf field string selector = 9; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Policies that are applicable to the request message. + * + * Generated from protobuf field repeated .google.api.FieldPolicy request_policies = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestPolicies() + { + return $this->request_policies; + } + + /** + * Policies that are applicable to the request message. + * + * Generated from protobuf field repeated .google.api.FieldPolicy request_policies = 2; + * @param array<\Google\Api\FieldPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\FieldPolicy::class); + $this->request_policies = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MethodSettings.php b/vendor/google/common-protos/src/Api/MethodSettings.php new file mode 100644 index 0000000..0e95d50 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MethodSettings.php @@ -0,0 +1,245 @@ +google.api.MethodSettings + */ +class MethodSettings extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of the method, for which the options below apply. + * This is used to find the method to apply the options. + * Example: + * publishing: + * method_settings: + * - selector: google.storage.control.v2.StorageControl.CreateFolder + * # method settings for CreateFolder... + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * Describes settings to use for long-running operations when generating + * API methods for RPCs. Complements RPCs that use the annotations in + * google/longrunning/operations.proto. + * Example of a YAML configuration:: + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes + * + * Generated from protobuf field .google.api.MethodSettings.LongRunning long_running = 2; + */ + protected $long_running = null; + /** + * List of top-level fields of the request message, that should be + * automatically populated by the client libraries based on their + * (google.api.field_info).format. Currently supported format: UUID4. + * Example of a YAML configuration: + * publishing: + * method_settings: + * - selector: google.example.v1.ExampleService.CreateExample + * auto_populated_fields: + * - request_id + * + * Generated from protobuf field repeated string auto_populated_fields = 3; + */ + private $auto_populated_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * The fully qualified name of the method, for which the options below apply. + * This is used to find the method to apply the options. + * Example: + * publishing: + * method_settings: + * - selector: google.storage.control.v2.StorageControl.CreateFolder + * # method settings for CreateFolder... + * @type \Google\Api\MethodSettings\LongRunning $long_running + * Describes settings to use for long-running operations when generating + * API methods for RPCs. Complements RPCs that use the annotations in + * google/longrunning/operations.proto. + * Example of a YAML configuration:: + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes + * @type array|\Google\Protobuf\Internal\RepeatedField $auto_populated_fields + * List of top-level fields of the request message, that should be + * automatically populated by the client libraries based on their + * (google.api.field_info).format. Currently supported format: UUID4. + * Example of a YAML configuration: + * publishing: + * method_settings: + * - selector: google.example.v1.ExampleService.CreateExample + * auto_populated_fields: + * - request_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of the method, for which the options below apply. + * This is used to find the method to apply the options. + * Example: + * publishing: + * method_settings: + * - selector: google.storage.control.v2.StorageControl.CreateFolder + * # method settings for CreateFolder... + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * The fully qualified name of the method, for which the options below apply. + * This is used to find the method to apply the options. + * Example: + * publishing: + * method_settings: + * - selector: google.storage.control.v2.StorageControl.CreateFolder + * # method settings for CreateFolder... + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Describes settings to use for long-running operations when generating + * API methods for RPCs. Complements RPCs that use the annotations in + * google/longrunning/operations.proto. + * Example of a YAML configuration:: + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes + * + * Generated from protobuf field .google.api.MethodSettings.LongRunning long_running = 2; + * @return \Google\Api\MethodSettings\LongRunning|null + */ + public function getLongRunning() + { + return $this->long_running; + } + + public function hasLongRunning() + { + return isset($this->long_running); + } + + public function clearLongRunning() + { + unset($this->long_running); + } + + /** + * Describes settings to use for long-running operations when generating + * API methods for RPCs. Complements RPCs that use the annotations in + * google/longrunning/operations.proto. + * Example of a YAML configuration:: + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes + * + * Generated from protobuf field .google.api.MethodSettings.LongRunning long_running = 2; + * @param \Google\Api\MethodSettings\LongRunning $var + * @return $this + */ + public function setLongRunning($var) + { + GPBUtil::checkMessage($var, \Google\Api\MethodSettings\LongRunning::class); + $this->long_running = $var; + + return $this; + } + + /** + * List of top-level fields of the request message, that should be + * automatically populated by the client libraries based on their + * (google.api.field_info).format. Currently supported format: UUID4. + * Example of a YAML configuration: + * publishing: + * method_settings: + * - selector: google.example.v1.ExampleService.CreateExample + * auto_populated_fields: + * - request_id + * + * Generated from protobuf field repeated string auto_populated_fields = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutoPopulatedFields() + { + return $this->auto_populated_fields; + } + + /** + * List of top-level fields of the request message, that should be + * automatically populated by the client libraries based on their + * (google.api.field_info).format. Currently supported format: UUID4. + * Example of a YAML configuration: + * publishing: + * method_settings: + * - selector: google.example.v1.ExampleService.CreateExample + * auto_populated_fields: + * - request_id + * + * Generated from protobuf field repeated string auto_populated_fields = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutoPopulatedFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->auto_populated_fields = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MethodSettings/LongRunning.php b/vendor/google/common-protos/src/Api/MethodSettings/LongRunning.php new file mode 100644 index 0000000..eba2265 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MethodSettings/LongRunning.php @@ -0,0 +1,224 @@ +google.api.MethodSettings.LongRunning + */ +class LongRunning extends \Google\Protobuf\Internal\Message +{ + /** + * Initial delay after which the first poll request will be made. + * Default value: 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration initial_poll_delay = 1; + */ + protected $initial_poll_delay = null; + /** + * Multiplier to gradually increase delay between subsequent polls until it + * reaches max_poll_delay. + * Default value: 1.5. + * + * Generated from protobuf field float poll_delay_multiplier = 2; + */ + protected $poll_delay_multiplier = 0.0; + /** + * Maximum time between two subsequent poll requests. + * Default value: 45 seconds. + * + * Generated from protobuf field .google.protobuf.Duration max_poll_delay = 3; + */ + protected $max_poll_delay = null; + /** + * Total polling timeout. + * Default value: 5 minutes. + * + * Generated from protobuf field .google.protobuf.Duration total_poll_timeout = 4; + */ + protected $total_poll_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $initial_poll_delay + * Initial delay after which the first poll request will be made. + * Default value: 5 seconds. + * @type float $poll_delay_multiplier + * Multiplier to gradually increase delay between subsequent polls until it + * reaches max_poll_delay. + * Default value: 1.5. + * @type \Google\Protobuf\Duration $max_poll_delay + * Maximum time between two subsequent poll requests. + * Default value: 45 seconds. + * @type \Google\Protobuf\Duration $total_poll_timeout + * Total polling timeout. + * Default value: 5 minutes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Initial delay after which the first poll request will be made. + * Default value: 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration initial_poll_delay = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getInitialPollDelay() + { + return $this->initial_poll_delay; + } + + public function hasInitialPollDelay() + { + return isset($this->initial_poll_delay); + } + + public function clearInitialPollDelay() + { + unset($this->initial_poll_delay); + } + + /** + * Initial delay after which the first poll request will be made. + * Default value: 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration initial_poll_delay = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setInitialPollDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->initial_poll_delay = $var; + + return $this; + } + + /** + * Multiplier to gradually increase delay between subsequent polls until it + * reaches max_poll_delay. + * Default value: 1.5. + * + * Generated from protobuf field float poll_delay_multiplier = 2; + * @return float + */ + public function getPollDelayMultiplier() + { + return $this->poll_delay_multiplier; + } + + /** + * Multiplier to gradually increase delay between subsequent polls until it + * reaches max_poll_delay. + * Default value: 1.5. + * + * Generated from protobuf field float poll_delay_multiplier = 2; + * @param float $var + * @return $this + */ + public function setPollDelayMultiplier($var) + { + GPBUtil::checkFloat($var); + $this->poll_delay_multiplier = $var; + + return $this; + } + + /** + * Maximum time between two subsequent poll requests. + * Default value: 45 seconds. + * + * Generated from protobuf field .google.protobuf.Duration max_poll_delay = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxPollDelay() + { + return $this->max_poll_delay; + } + + public function hasMaxPollDelay() + { + return isset($this->max_poll_delay); + } + + public function clearMaxPollDelay() + { + unset($this->max_poll_delay); + } + + /** + * Maximum time between two subsequent poll requests. + * Default value: 45 seconds. + * + * Generated from protobuf field .google.protobuf.Duration max_poll_delay = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxPollDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_poll_delay = $var; + + return $this; + } + + /** + * Total polling timeout. + * Default value: 5 minutes. + * + * Generated from protobuf field .google.protobuf.Duration total_poll_timeout = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getTotalPollTimeout() + { + return $this->total_poll_timeout; + } + + public function hasTotalPollTimeout() + { + return isset($this->total_poll_timeout); + } + + public function clearTotalPollTimeout() + { + unset($this->total_poll_timeout); + } + + /** + * Total polling timeout. + * Default value: 5 minutes. + * + * Generated from protobuf field .google.protobuf.Duration total_poll_timeout = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTotalPollTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->total_poll_timeout = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Metric.php b/vendor/google/common-protos/src/Api/Metric.php new file mode 100644 index 0000000..488552f --- /dev/null +++ b/vendor/google/common-protos/src/Api/Metric.php @@ -0,0 +1,114 @@ +google.api.Metric + */ +class Metric extends \Google\Protobuf\Internal\Message +{ + /** + * An existing metric type, see + * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example, + * `custom.googleapis.com/invoice/paid/amount`. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * The set of label values that uniquely identify this metric. All + * labels listed in the `MetricDescriptor` must be assigned values. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * An existing metric type, see + * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example, + * `custom.googleapis.com/invoice/paid/amount`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The set of label values that uniquely identify this metric. All + * labels listed in the `MetricDescriptor` must be assigned values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Metric::initOnce(); + parent::__construct($data); + } + + /** + * An existing metric type, see + * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example, + * `custom.googleapis.com/invoice/paid/amount`. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * An existing metric type, see + * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example, + * `custom.googleapis.com/invoice/paid/amount`. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The set of label values that uniquely identify this metric. All + * labels listed in the `MetricDescriptor` must be assigned values. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of label values that uniquely identify this metric. All + * labels listed in the `MetricDescriptor` must be assigned values. + * + * Generated from protobuf field map labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MetricDescriptor.php b/vendor/google/common-protos/src/Api/MetricDescriptor.php new file mode 100644 index 0000000..b8a39d6 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricDescriptor.php @@ -0,0 +1,831 @@ +google.api.MetricDescriptor + */ +class MetricDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the metric descriptor. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined metric types have the DNS name + * `custom.googleapis.com` or `external.googleapis.com`. Metric types should + * use a natural hierarchical grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" + * + * Generated from protobuf field string type = 8; + */ + protected $type = ''; + /** + * The set of labels that can be used to describe a specific + * instance of this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric + * type has a label for the HTTP response code, `response_code`, so + * you can look at latencies for successful responses or just + * for responses that failed. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + */ + private $labels; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + */ + protected $metric_kind = 0; + /** + * Whether the measurement is an integer, a floating-point number, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + */ + protected $value_type = 0; + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * Different systems might scale the values to be more easily displayed (so a + * value of `0.02kBy` _might_ be displayed as `20By`, and a value of + * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is + * `kBy`, then the value of the metric is always in thousands of bytes, no + * matter how it might be displayed. + * If you want a custom metric to record the exact number of CPU-seconds used + * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is + * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 + * CPU-seconds, then the value is written as `12005`. + * Alternatively, if you want a custom metric to record data in a more + * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is + * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), + * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * The supported units are a subset of [The Unified Code for Units of + * Measure](https://unitsofmeasure.org/ucum.html) standard: + * **Basic units (UNIT)** + * * `bit` bit + * * `By` byte + * * `s` second + * * `min` minute + * * `h` hour + * * `d` day + * * `1` dimensionless + * **Prefixes (PREFIX)** + * * `k` kilo (10^3) + * * `M` mega (10^6) + * * `G` giga (10^9) + * * `T` tera (10^12) + * * `P` peta (10^15) + * * `E` exa (10^18) + * * `Z` zetta (10^21) + * * `Y` yotta (10^24) + * * `m` milli (10^-3) + * * `u` micro (10^-6) + * * `n` nano (10^-9) + * * `p` pico (10^-12) + * * `f` femto (10^-15) + * * `a` atto (10^-18) + * * `z` zepto (10^-21) + * * `y` yocto (10^-24) + * * `Ki` kibi (2^10) + * * `Mi` mebi (2^20) + * * `Gi` gibi (2^30) + * * `Ti` tebi (2^40) + * * `Pi` pebi (2^50) + * **Grammar** + * The grammar also includes these connectors: + * * `/` division or ratio (as an infix operator). For examples, + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). + * * `.` multiplication or composition (as an infix operator). For + * examples, `GBy.d` or `k{watt}.h`. + * The grammar for a unit is as follows: + * Expression = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * Annotation = "{" NAME "}" ; + * Notes: + * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * * `NAME` is a sequence of non-blank printable ASCII characters not + * containing `{` or `}`. + * * `1` represents a unitary [dimensionless + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). + * * `%` represents dimensionless value of 1/100, and annotates values giving + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). + * * `10^2.%` indicates a metric contains a ratio, typically in the range + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). + * + * Generated from protobuf field string unit = 5; + */ + protected $unit = ''; + /** + * A detailed description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 6; + */ + protected $description = ''; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request count". + * This field is optional but it is recommended to be set for any metrics + * associated with user-visible concepts, such as Quota. + * + * Generated from protobuf field string display_name = 7; + */ + protected $display_name = ''; + /** + * Optional. Metadata which can be used to guide usage of the metric. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; + */ + protected $metadata = null; + /** + * Optional. The launch stage of the metric definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 12; + */ + protected $launch_stage = 0; + /** + * Read-only. If present, then a [time + * series][google.monitoring.v3.TimeSeries], which is identified partially by + * a metric type and a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that + * is associated with this metric type can only be associated with one of the + * monitored resource types listed here. + * + * Generated from protobuf field repeated string monitored_resource_types = 13; + */ + private $monitored_resource_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the metric descriptor. + * @type string $type + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined metric types have the DNS name + * `custom.googleapis.com` or `external.googleapis.com`. Metric types should + * use a natural hierarchical grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" + * @type array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that can be used to describe a specific + * instance of this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric + * type has a label for the HTTP response code, `response_code`, so + * you can look at latencies for successful responses or just + * for responses that failed. + * @type int $metric_kind + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * @type int $value_type + * Whether the measurement is an integer, a floating-point number, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * @type string $unit + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * Different systems might scale the values to be more easily displayed (so a + * value of `0.02kBy` _might_ be displayed as `20By`, and a value of + * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is + * `kBy`, then the value of the metric is always in thousands of bytes, no + * matter how it might be displayed. + * If you want a custom metric to record the exact number of CPU-seconds used + * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is + * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 + * CPU-seconds, then the value is written as `12005`. + * Alternatively, if you want a custom metric to record data in a more + * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is + * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), + * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * The supported units are a subset of [The Unified Code for Units of + * Measure](https://unitsofmeasure.org/ucum.html) standard: + * **Basic units (UNIT)** + * * `bit` bit + * * `By` byte + * * `s` second + * * `min` minute + * * `h` hour + * * `d` day + * * `1` dimensionless + * **Prefixes (PREFIX)** + * * `k` kilo (10^3) + * * `M` mega (10^6) + * * `G` giga (10^9) + * * `T` tera (10^12) + * * `P` peta (10^15) + * * `E` exa (10^18) + * * `Z` zetta (10^21) + * * `Y` yotta (10^24) + * * `m` milli (10^-3) + * * `u` micro (10^-6) + * * `n` nano (10^-9) + * * `p` pico (10^-12) + * * `f` femto (10^-15) + * * `a` atto (10^-18) + * * `z` zepto (10^-21) + * * `y` yocto (10^-24) + * * `Ki` kibi (2^10) + * * `Mi` mebi (2^20) + * * `Gi` gibi (2^30) + * * `Ti` tebi (2^40) + * * `Pi` pebi (2^50) + * **Grammar** + * The grammar also includes these connectors: + * * `/` division or ratio (as an infix operator). For examples, + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). + * * `.` multiplication or composition (as an infix operator). For + * examples, `GBy.d` or `k{watt}.h`. + * The grammar for a unit is as follows: + * Expression = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * Annotation = "{" NAME "}" ; + * Notes: + * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * * `NAME` is a sequence of non-blank printable ASCII characters not + * containing `{` or `}`. + * * `1` represents a unitary [dimensionless + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). + * * `%` represents dimensionless value of 1/100, and annotates values giving + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). + * * `10^2.%` indicates a metric contains a ratio, typically in the range + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). + * @type string $description + * A detailed description of the metric, which can be used in documentation. + * @type string $display_name + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request count". + * This field is optional but it is recommended to be set for any metrics + * associated with user-visible concepts, such as Quota. + * @type \Google\Api\MetricDescriptor\MetricDescriptorMetadata $metadata + * Optional. Metadata which can be used to guide usage of the metric. + * @type int $launch_stage + * Optional. The launch stage of the metric definition. + * @type array|\Google\Protobuf\Internal\RepeatedField $monitored_resource_types + * Read-only. If present, then a [time + * series][google.monitoring.v3.TimeSeries], which is identified partially by + * a metric type and a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that + * is associated with this metric type can only be associated with one of the + * monitored resource types listed here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the metric descriptor. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the metric descriptor. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined metric types have the DNS name + * `custom.googleapis.com` or `external.googleapis.com`. Metric types should + * use a natural hierarchical grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" + * + * Generated from protobuf field string type = 8; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined metric types have the DNS name + * `custom.googleapis.com` or `external.googleapis.com`. Metric types should + * use a natural hierarchical grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" + * + * Generated from protobuf field string type = 8; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The set of labels that can be used to describe a specific + * instance of this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric + * type has a label for the HTTP response code, `response_code`, so + * you can look at latencies for successful responses or just + * for responses that failed. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that can be used to describe a specific + * instance of this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric + * type has a label for the HTTP response code, `response_code`, so + * you can look at latencies for successful responses or just + * for responses that failed. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 2; + * @param array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); + $this->labels = $arr; + + return $this; + } + + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @return int + */ + public function getMetricKind() + { + return $this->metric_kind; + } + + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @param int $var + * @return $this + */ + public function setMetricKind($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); + $this->metric_kind = $var; + + return $this; + } + + /** + * Whether the measurement is an integer, a floating-point number, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * Whether the measurement is an integer, a floating-point number, etc. + * Some combinations of `metric_kind` and `value_type` might not be supported. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * Different systems might scale the values to be more easily displayed (so a + * value of `0.02kBy` _might_ be displayed as `20By`, and a value of + * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is + * `kBy`, then the value of the metric is always in thousands of bytes, no + * matter how it might be displayed. + * If you want a custom metric to record the exact number of CPU-seconds used + * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is + * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 + * CPU-seconds, then the value is written as `12005`. + * Alternatively, if you want a custom metric to record data in a more + * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is + * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), + * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * The supported units are a subset of [The Unified Code for Units of + * Measure](https://unitsofmeasure.org/ucum.html) standard: + * **Basic units (UNIT)** + * * `bit` bit + * * `By` byte + * * `s` second + * * `min` minute + * * `h` hour + * * `d` day + * * `1` dimensionless + * **Prefixes (PREFIX)** + * * `k` kilo (10^3) + * * `M` mega (10^6) + * * `G` giga (10^9) + * * `T` tera (10^12) + * * `P` peta (10^15) + * * `E` exa (10^18) + * * `Z` zetta (10^21) + * * `Y` yotta (10^24) + * * `m` milli (10^-3) + * * `u` micro (10^-6) + * * `n` nano (10^-9) + * * `p` pico (10^-12) + * * `f` femto (10^-15) + * * `a` atto (10^-18) + * * `z` zepto (10^-21) + * * `y` yocto (10^-24) + * * `Ki` kibi (2^10) + * * `Mi` mebi (2^20) + * * `Gi` gibi (2^30) + * * `Ti` tebi (2^40) + * * `Pi` pebi (2^50) + * **Grammar** + * The grammar also includes these connectors: + * * `/` division or ratio (as an infix operator). For examples, + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). + * * `.` multiplication or composition (as an infix operator). For + * examples, `GBy.d` or `k{watt}.h`. + * The grammar for a unit is as follows: + * Expression = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * Annotation = "{" NAME "}" ; + * Notes: + * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * * `NAME` is a sequence of non-blank printable ASCII characters not + * containing `{` or `}`. + * * `1` represents a unitary [dimensionless + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). + * * `%` represents dimensionless value of 1/100, and annotates values giving + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). + * * `10^2.%` indicates a metric contains a ratio, typically in the range + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). + * + * Generated from protobuf field string unit = 5; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * Different systems might scale the values to be more easily displayed (so a + * value of `0.02kBy` _might_ be displayed as `20By`, and a value of + * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is + * `kBy`, then the value of the metric is always in thousands of bytes, no + * matter how it might be displayed. + * If you want a custom metric to record the exact number of CPU-seconds used + * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is + * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 + * CPU-seconds, then the value is written as `12005`. + * Alternatively, if you want a custom metric to record data in a more + * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is + * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), + * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * The supported units are a subset of [The Unified Code for Units of + * Measure](https://unitsofmeasure.org/ucum.html) standard: + * **Basic units (UNIT)** + * * `bit` bit + * * `By` byte + * * `s` second + * * `min` minute + * * `h` hour + * * `d` day + * * `1` dimensionless + * **Prefixes (PREFIX)** + * * `k` kilo (10^3) + * * `M` mega (10^6) + * * `G` giga (10^9) + * * `T` tera (10^12) + * * `P` peta (10^15) + * * `E` exa (10^18) + * * `Z` zetta (10^21) + * * `Y` yotta (10^24) + * * `m` milli (10^-3) + * * `u` micro (10^-6) + * * `n` nano (10^-9) + * * `p` pico (10^-12) + * * `f` femto (10^-15) + * * `a` atto (10^-18) + * * `z` zepto (10^-21) + * * `y` yocto (10^-24) + * * `Ki` kibi (2^10) + * * `Mi` mebi (2^20) + * * `Gi` gibi (2^30) + * * `Ti` tebi (2^40) + * * `Pi` pebi (2^50) + * **Grammar** + * The grammar also includes these connectors: + * * `/` division or ratio (as an infix operator). For examples, + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). + * * `.` multiplication or composition (as an infix operator). For + * examples, `GBy.d` or `k{watt}.h`. + * The grammar for a unit is as follows: + * Expression = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * Annotation = "{" NAME "}" ; + * Notes: + * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * * `NAME` is a sequence of non-blank printable ASCII characters not + * containing `{` or `}`. + * * `1` represents a unitary [dimensionless + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). + * * `%` represents dimensionless value of 1/100, and annotates values giving + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). + * * `10^2.%` indicates a metric contains a ratio, typically in the range + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). + * + * Generated from protobuf field string unit = 5; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + + /** + * A detailed description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 6; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A detailed description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 6; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request count". + * This field is optional but it is recommended to be set for any metrics + * associated with user-visible concepts, such as Quota. + * + * Generated from protobuf field string display_name = 7; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request count". + * This field is optional but it is recommended to be set for any metrics + * associated with user-visible concepts, such as Quota. + * + * Generated from protobuf field string display_name = 7; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Metadata which can be used to guide usage of the metric. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; + * @return \Google\Api\MetricDescriptor\MetricDescriptorMetadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Optional. Metadata which can be used to guide usage of the metric. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; + * @param \Google\Api\MetricDescriptor\MetricDescriptorMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Api\MetricDescriptor\MetricDescriptorMetadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Optional. The launch stage of the metric definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 12; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Optional. The launch stage of the metric definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 12; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Read-only. If present, then a [time + * series][google.monitoring.v3.TimeSeries], which is identified partially by + * a metric type and a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that + * is associated with this metric type can only be associated with one of the + * monitored resource types listed here. + * + * Generated from protobuf field repeated string monitored_resource_types = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMonitoredResourceTypes() + { + return $this->monitored_resource_types; + } + + /** + * Read-only. If present, then a [time + * series][google.monitoring.v3.TimeSeries], which is identified partially by + * a metric type and a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that + * is associated with this metric type can only be associated with one of the + * monitored resource types listed here. + * + * Generated from protobuf field repeated string monitored_resource_types = 13; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMonitoredResourceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->monitored_resource_types = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php new file mode 100644 index 0000000..d4ce06e --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php @@ -0,0 +1,225 @@ +google.api.MetricDescriptor.MetricDescriptorMetadata + */ +class MetricDescriptorMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated. Must use the + * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] + * instead. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 1 [deprecated = true]; + * @deprecated + */ + protected $launch_stage = 0; + /** + * The sampling period of metric data points. For metrics which are written + * periodically, consecutive data points are stored at this time interval, + * excluding data loss due to errors. Metrics with a higher granularity have + * a smaller sampling period. + * + * Generated from protobuf field .google.protobuf.Duration sample_period = 2; + */ + protected $sample_period = null; + /** + * The delay of data points caused by ingestion. Data points older than this + * age are guaranteed to be ingested and available to be read, excluding + * data loss due to errors. + * + * Generated from protobuf field .google.protobuf.Duration ingest_delay = 3; + */ + protected $ingest_delay = null; + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + */ + private $time_series_resource_hierarchy_level; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $launch_stage + * Deprecated. Must use the + * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] + * instead. + * @type \Google\Protobuf\Duration $sample_period + * The sampling period of metric data points. For metrics which are written + * periodically, consecutive data points are stored at this time interval, + * excluding data loss due to errors. Metrics with a higher granularity have + * a smaller sampling period. + * @type \Google\Protobuf\Duration $ingest_delay + * The delay of data points caused by ingestion. Data points older than this + * age are guaranteed to be ingested and available to be read, excluding + * data loss due to errors. + * @type array|\Google\Protobuf\Internal\RepeatedField $time_series_resource_hierarchy_level + * The scope of the timeseries data of the metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Metric::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated. Must use the + * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] + * instead. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 1 [deprecated = true]; + * @return int + * @deprecated + */ + public function getLaunchStage() + { + if ($this->launch_stage !== 0) { + @trigger_error('launch_stage is deprecated.', E_USER_DEPRECATED); + } + return $this->launch_stage; + } + + /** + * Deprecated. Must use the + * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] + * instead. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 1 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setLaunchStage($var) + { + @trigger_error('launch_stage is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * The sampling period of metric data points. For metrics which are written + * periodically, consecutive data points are stored at this time interval, + * excluding data loss due to errors. Metrics with a higher granularity have + * a smaller sampling period. + * + * Generated from protobuf field .google.protobuf.Duration sample_period = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getSamplePeriod() + { + return $this->sample_period; + } + + public function hasSamplePeriod() + { + return isset($this->sample_period); + } + + public function clearSamplePeriod() + { + unset($this->sample_period); + } + + /** + * The sampling period of metric data points. For metrics which are written + * periodically, consecutive data points are stored at this time interval, + * excluding data loss due to errors. Metrics with a higher granularity have + * a smaller sampling period. + * + * Generated from protobuf field .google.protobuf.Duration sample_period = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSamplePeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->sample_period = $var; + + return $this; + } + + /** + * The delay of data points caused by ingestion. Data points older than this + * age are guaranteed to be ingested and available to be read, excluding + * data loss due to errors. + * + * Generated from protobuf field .google.protobuf.Duration ingest_delay = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getIngestDelay() + { + return $this->ingest_delay; + } + + public function hasIngestDelay() + { + return isset($this->ingest_delay); + } + + public function clearIngestDelay() + { + unset($this->ingest_delay); + } + + /** + * The delay of data points caused by ingestion. Data points older than this + * age are guaranteed to be ingested and available to be read, excluding + * data loss due to errors. + * + * Generated from protobuf field .google.protobuf.Duration ingest_delay = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setIngestDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->ingest_delay = $var; + + return $this; + } + + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeSeriesResourceHierarchyLevel() + { + return $this->time_series_resource_hierarchy_level; + } + + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeSeriesResourceHierarchyLevel($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Api\MetricDescriptor\MetricDescriptorMetadata\TimeSeriesResourceHierarchyLevel::class); + $this->time_series_resource_hierarchy_level = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php new file mode 100644 index 0000000..c621598 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php @@ -0,0 +1,69 @@ +google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + */ +class TimeSeriesResourceHierarchyLevel +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + */ + const TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + /** + * Scopes a metric to a project. + * + * Generated from protobuf enum PROJECT = 1; + */ + const PROJECT = 1; + /** + * Scopes a metric to an organization. + * + * Generated from protobuf enum ORGANIZATION = 2; + */ + const ORGANIZATION = 2; + /** + * Scopes a metric to a folder. + * + * Generated from protobuf enum FOLDER = 3; + */ + const FOLDER = 3; + + private static $valueToName = [ + self::TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED => 'TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED', + self::PROJECT => 'PROJECT', + self::ORGANIZATION => 'ORGANIZATION', + self::FOLDER => 'FOLDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/MetricDescriptor/MetricKind.php b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricKind.php new file mode 100644 index 0000000..a486417 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricDescriptor/MetricKind.php @@ -0,0 +1,75 @@ +google.api.MetricDescriptor.MetricKind + */ +class MetricKind +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum METRIC_KIND_UNSPECIFIED = 0; + */ + const METRIC_KIND_UNSPECIFIED = 0; + /** + * An instantaneous measurement of a value. + * + * Generated from protobuf enum GAUGE = 1; + */ + const GAUGE = 1; + /** + * The change in a value during a time interval. + * + * Generated from protobuf enum DELTA = 2; + */ + const DELTA = 2; + /** + * A value accumulated over a time interval. Cumulative + * measurements in a time series should have the same start time + * and increasing end times, until an event resets the cumulative + * value to zero and sets a new start time for the following + * points. + * + * Generated from protobuf enum CUMULATIVE = 3; + */ + const CUMULATIVE = 3; + + private static $valueToName = [ + self::METRIC_KIND_UNSPECIFIED => 'METRIC_KIND_UNSPECIFIED', + self::GAUGE => 'GAUGE', + self::DELTA => 'DELTA', + self::CUMULATIVE => 'CUMULATIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/MetricDescriptor/ValueType.php b/vendor/google/common-protos/src/Api/MetricDescriptor/ValueType.php new file mode 100644 index 0000000..d433d2e --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricDescriptor/ValueType.php @@ -0,0 +1,92 @@ +google.api.MetricDescriptor.ValueType + */ +class ValueType +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; + */ + const VALUE_TYPE_UNSPECIFIED = 0; + /** + * The value is a boolean. + * This value type can be used only if the metric kind is `GAUGE`. + * + * Generated from protobuf enum BOOL = 1; + */ + const BOOL = 1; + /** + * The value is a signed 64-bit integer. + * + * Generated from protobuf enum INT64 = 2; + */ + const INT64 = 2; + /** + * The value is a double precision floating point number. + * + * Generated from protobuf enum DOUBLE = 3; + */ + const DOUBLE = 3; + /** + * The value is a text string. + * This value type can be used only if the metric kind is `GAUGE`. + * + * Generated from protobuf enum STRING = 4; + */ + const STRING = 4; + /** + * The value is a [`Distribution`][google.api.Distribution]. + * + * Generated from protobuf enum DISTRIBUTION = 5; + */ + const DISTRIBUTION = 5; + /** + * The value is money. + * + * Generated from protobuf enum MONEY = 6; + */ + const MONEY = 6; + + private static $valueToName = [ + self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', + self::BOOL => 'BOOL', + self::INT64 => 'INT64', + self::DOUBLE => 'DOUBLE', + self::STRING => 'STRING', + self::DISTRIBUTION => 'DISTRIBUTION', + self::MONEY => 'MONEY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/MetricRule.php b/vendor/google/common-protos/src/Api/MetricRule.php new file mode 100644 index 0000000..f8eeccd --- /dev/null +++ b/vendor/google/common-protos/src/Api/MetricRule.php @@ -0,0 +1,126 @@ +google.api.MetricRule + */ +class MetricRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * Metrics to update when the selected methods are called, and the associated + * cost applied to each metric. + * The key of the map is the metric name, and the values are the amount + * increased for the metric against which the quota limits are defined. + * The value must not be negative. + * + * Generated from protobuf field map metric_costs = 2; + */ + private $metric_costs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type array|\Google\Protobuf\Internal\MapField $metric_costs + * Metrics to update when the selected methods are called, and the associated + * cost applied to each metric. + * The key of the map is the metric name, and the values are the amount + * increased for the metric against which the quota limits are defined. + * The value must not be negative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Quota::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Metrics to update when the selected methods are called, and the associated + * cost applied to each metric. + * The key of the map is the metric name, and the values are the amount + * increased for the metric against which the quota limits are defined. + * The value must not be negative. + * + * Generated from protobuf field map metric_costs = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetricCosts() + { + return $this->metric_costs; + } + + /** + * Metrics to update when the selected methods are called, and the associated + * cost applied to each metric. + * The key of the map is the metric name, and the values are the amount + * increased for the metric against which the quota limits are defined. + * The value must not be negative. + * + * Generated from protobuf field map metric_costs = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetricCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64); + $this->metric_costs = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MonitoredResource.php b/vendor/google/common-protos/src/Api/MonitoredResource.php new file mode 100644 index 0000000..7af0f6d --- /dev/null +++ b/vendor/google/common-protos/src/Api/MonitoredResource.php @@ -0,0 +1,147 @@ +google.api.MonitoredResource + */ +class MonitoredResource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The monitored resource type. This field must match + * the `type` field of a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] + * object. For example, the type of a Compute Engine VM instance is + * `gce_instance`. Some descriptors include the service name in the type; for + * example, the type of a Datastream stream is + * `datastream.googleapis.com/Stream`. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels `"project_id"`, `"instance_id"`, and `"zone"`. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * Required. The monitored resource type. This field must match + * the `type` field of a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] + * object. For example, the type of a Compute Engine VM instance is + * `gce_instance`. Some descriptors include the service name in the type; for + * example, the type of a Datastream stream is + * `datastream.googleapis.com/Stream`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels `"project_id"`, `"instance_id"`, and `"zone"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\MonitoredResource::initOnce(); + parent::__construct($data); + } + + /** + * Required. The monitored resource type. This field must match + * the `type` field of a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] + * object. For example, the type of a Compute Engine VM instance is + * `gce_instance`. Some descriptors include the service name in the type; for + * example, the type of a Datastream stream is + * `datastream.googleapis.com/Stream`. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The monitored resource type. This field must match + * the `type` field of a + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] + * object. For example, the type of a Compute Engine VM instance is + * `gce_instance`. Some descriptors include the service name in the type; for + * example, the type of a Datastream stream is + * `datastream.googleapis.com/Stream`. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels `"project_id"`, `"instance_id"`, and `"zone"`. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels `"project_id"`, `"instance_id"`, and `"zone"`. + * + * Generated from protobuf field map labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MonitoredResourceDescriptor.php b/vendor/google/common-protos/src/Api/MonitoredResourceDescriptor.php new file mode 100644 index 0000000..c6727e2 --- /dev/null +++ b/vendor/google/common-protos/src/Api/MonitoredResourceDescriptor.php @@ -0,0 +1,309 @@ +google.api.MonitoredResourceDescriptor + */ +class MonitoredResourceDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + * {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + * + * Generated from protobuf field string name = 5; + */ + protected $name = ''; + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * For a list of types, see [Monitored resource + * types](https://cloud.google.com/monitoring/api/resources) + * and [Logging resource + * types](https://cloud.google.com/logging/docs/api/v2/resource-list). + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, + * `"Google Cloud SQL Database"`. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Optional. A detailed description of the monitored resource type that might + * be used in documentation. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and `"zone"`. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + */ + private $labels; + /** + * Optional. The launch stage of the monitored resource definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + */ + protected $launch_stage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + * {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + * @type string $type + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * For a list of types, see [Monitored resource + * types](https://cloud.google.com/monitoring/api/resources) + * and [Logging resource + * types](https://cloud.google.com/logging/docs/api/v2/resource-list). + * @type string $display_name + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, + * `"Google Cloud SQL Database"`. + * @type string $description + * Optional. A detailed description of the monitored resource type that might + * be used in documentation. + * @type array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $labels + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and `"zone"`. + * @type int $launch_stage + * Optional. The launch stage of the monitored resource definition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\MonitoredResource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + * {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + * + * Generated from protobuf field string name = 5; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + * {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + * + * Generated from protobuf field string name = 5; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * For a list of types, see [Monitored resource + * types](https://cloud.google.com/monitoring/api/resources) + * and [Logging resource + * types](https://cloud.google.com/logging/docs/api/v2/resource-list). + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * For a list of types, see [Monitored resource + * types](https://cloud.google.com/monitoring/api/resources) + * and [Logging resource + * types](https://cloud.google.com/logging/docs/api/v2/resource-list). + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, + * `"Google Cloud SQL Database"`. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, + * `"Google Cloud SQL Database"`. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. A detailed description of the monitored resource type that might + * be used in documentation. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A detailed description of the monitored resource type that might + * be used in documentation. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and `"zone"`. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and `"zone"`. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + * @param array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The launch stage of the monitored resource definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Optional. The launch stage of the monitored resource definition. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/MonitoredResourceMetadata.php b/vendor/google/common-protos/src/Api/MonitoredResourceMetadata.php new file mode 100644 index 0000000..da6dc4b --- /dev/null +++ b/vendor/google/common-protos/src/Api/MonitoredResourceMetadata.php @@ -0,0 +1,148 @@ +google.api.MonitoredResourceMetadata + */ +class MonitoredResourceMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Values for predefined system metadata labels. + * System labels are a kind of metadata extracted by Google, including + * "machine_image", "vpc", "subnet_id", + * "security_group", "name", etc. + * System label values can be only strings, Boolean values, or a list of + * strings. For example: + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } + * + * Generated from protobuf field .google.protobuf.Struct system_labels = 1; + */ + protected $system_labels = null; + /** + * Output only. A map of user-defined metadata labels. + * + * Generated from protobuf field map user_labels = 2; + */ + private $user_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $system_labels + * Output only. Values for predefined system metadata labels. + * System labels are a kind of metadata extracted by Google, including + * "machine_image", "vpc", "subnet_id", + * "security_group", "name", etc. + * System label values can be only strings, Boolean values, or a list of + * strings. For example: + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * Output only. A map of user-defined metadata labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\MonitoredResource::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Values for predefined system metadata labels. + * System labels are a kind of metadata extracted by Google, including + * "machine_image", "vpc", "subnet_id", + * "security_group", "name", etc. + * System label values can be only strings, Boolean values, or a list of + * strings. For example: + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } + * + * Generated from protobuf field .google.protobuf.Struct system_labels = 1; + * @return \Google\Protobuf\Struct|null + */ + public function getSystemLabels() + { + return $this->system_labels; + } + + public function hasSystemLabels() + { + return isset($this->system_labels); + } + + public function clearSystemLabels() + { + unset($this->system_labels); + } + + /** + * Output only. Values for predefined system metadata labels. + * System labels are a kind of metadata extracted by Google, including + * "machine_image", "vpc", "subnet_id", + * "security_group", "name", etc. + * System label values can be only strings, Boolean values, or a list of + * strings. For example: + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } + * + * Generated from protobuf field .google.protobuf.Struct system_labels = 1; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setSystemLabels($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->system_labels = $var; + + return $this; + } + + /** + * Output only. A map of user-defined metadata labels. + * + * Generated from protobuf field map user_labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * Output only. A map of user-defined metadata labels. + * + * Generated from protobuf field map user_labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Monitoring.php b/vendor/google/common-protos/src/Api/Monitoring.php new file mode 100644 index 0000000..5415b64 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Monitoring.php @@ -0,0 +1,190 @@ +google.api.Monitoring + */ +class Monitoring extends \Google\Protobuf\Internal\Message +{ + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; + */ + private $producer_destinations; + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; + */ + private $consumer_destinations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\Monitoring\MonitoringDestination>|\Google\Protobuf\Internal\RepeatedField $producer_destinations + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * @type array<\Google\Api\Monitoring\MonitoringDestination>|\Google\Protobuf\Internal\RepeatedField $consumer_destinations + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Monitoring::initOnce(); + parent::__construct($data); + } + + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducerDestinations() + { + return $this->producer_destinations; + } + + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; + * @param array<\Google\Api\Monitoring\MonitoringDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducerDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Monitoring\MonitoringDestination::class); + $this->producer_destinations = $arr; + + return $this; + } + + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerDestinations() + { + return $this->consumer_destinations; + } + + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations. A monitored resource type may + * appear in multiple monitoring destinations if different aggregations are + * needed for different sets of metrics associated with that monitored + * resource type. A monitored resource and metric pair may only be used once + * in the Monitoring configuration. + * + * Generated from protobuf field repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; + * @param array<\Google\Api\Monitoring\MonitoringDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Monitoring\MonitoringDestination::class); + $this->consumer_destinations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Monitoring/MonitoringDestination.php b/vendor/google/common-protos/src/Api/Monitoring/MonitoringDestination.php new file mode 100644 index 0000000..050620e --- /dev/null +++ b/vendor/google/common-protos/src/Api/Monitoring/MonitoringDestination.php @@ -0,0 +1,119 @@ +google.api.Monitoring.MonitoringDestination + */ +class MonitoringDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + */ + protected $monitored_resource = ''; + /** + * Types of the metrics to report to this monitoring destination. + * Each type must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + */ + private $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $monitored_resource + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * @type array|\Google\Protobuf\Internal\RepeatedField $metrics + * Types of the metrics to report to this monitoring destination. + * Each type must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Monitoring::initOnce(); + parent::__construct($data); + } + + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + * @return string + */ + public function getMonitoredResource() + { + return $this->monitored_resource; + } + + /** + * The monitored resource type. The type must be defined in + * [Service.monitored_resources][google.api.Service.monitored_resources] + * section. + * + * Generated from protobuf field string monitored_resource = 1; + * @param string $var + * @return $this + */ + public function setMonitoredResource($var) + { + GPBUtil::checkString($var, True); + $this->monitored_resource = $var; + + return $this; + } + + /** + * Types of the metrics to report to this monitoring destination. + * Each type must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * Types of the metrics to report to this monitoring destination. + * Each type must be defined in + * [Service.metrics][google.api.Service.metrics] section. + * + * Generated from protobuf field repeated string metrics = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->metrics = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/NodeSettings.php b/vendor/google/common-protos/src/Api/NodeSettings.php new file mode 100644 index 0000000..54b8ccb --- /dev/null +++ b/vendor/google/common-protos/src/Api/NodeSettings.php @@ -0,0 +1,77 @@ +google.api.NodeSettings + */ +class NodeSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/OAuthRequirements.php b/vendor/google/common-protos/src/Api/OAuthRequirements.php new file mode 100644 index 0000000..842640c --- /dev/null +++ b/vendor/google/common-protos/src/Api/OAuthRequirements.php @@ -0,0 +1,96 @@ +google.api.OAuthRequirements + */ +class OAuthRequirements extends \Google\Protobuf\Internal\Message +{ + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. + * Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + * + * Generated from protobuf field string canonical_scopes = 1; + */ + protected $canonical_scopes = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $canonical_scopes + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. + * Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Auth::initOnce(); + parent::__construct($data); + } + + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. + * Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + * + * Generated from protobuf field string canonical_scopes = 1; + * @return string + */ + public function getCanonicalScopes() + { + return $this->canonical_scopes; + } + + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. + * Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + * + * Generated from protobuf field string canonical_scopes = 1; + * @param string $var + * @return $this + */ + public function setCanonicalScopes($var) + { + GPBUtil::checkString($var, True); + $this->canonical_scopes = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Page.php b/vendor/google/common-protos/src/Api/Page.php new file mode 100644 index 0000000..0709745 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Page.php @@ -0,0 +1,200 @@ +google.api.Page + */ +class Page extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: + *
pages:
+     * - name: Tutorial
+     *   content: (== include tutorial.md ==)
+     *   subpages:
+     *   - name: Java
+     *     content: (== include tutorial_java.md ==)
+     * 
+ * You can reference `Java` page using Markdown reference link syntax: + * `[Java][Tutorial.Java]`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + * + * Generated from protobuf field repeated .google.api.Page subpages = 3; + */ + private $subpages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: + *
pages:
+     *           - name: Tutorial
+     *             content: (== include tutorial.md ==)
+     *             subpages:
+     *             - name: Java
+     *               content: (== include tutorial_java.md ==)
+     *           
+ * You can reference `Java` page using Markdown reference link syntax: + * `[Java][Tutorial.Java]`. + * @type string $content + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. + * @type array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $subpages + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Documentation::initOnce(); + parent::__construct($data); + } + + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: + *
pages:
+     * - name: Tutorial
+     *   content: (== include tutorial.md ==)
+     *   subpages:
+     *   - name: Java
+     *     content: (== include tutorial_java.md ==)
+     * 
+ * You can reference `Java` page using Markdown reference link syntax: + * `[Java][Tutorial.Java]`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: + *
pages:
+     * - name: Tutorial
+     *   content: (== include tutorial.md ==)
+     *   subpages:
+     *   - name: Java
+     *     content: (== include tutorial_java.md ==)
+     * 
+ * You can reference `Java` page using Markdown reference link syntax: + * `[Java][Tutorial.Java]`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + * + * Generated from protobuf field repeated .google.api.Page subpages = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubpages() + { + return $this->subpages; + } + + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + * + * Generated from protobuf field repeated .google.api.Page subpages = 3; + * @param array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubpages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Page::class); + $this->subpages = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/PhpSettings.php b/vendor/google/common-protos/src/Api/PhpSettings.php new file mode 100644 index 0000000..06486ac --- /dev/null +++ b/vendor/google/common-protos/src/Api/PhpSettings.php @@ -0,0 +1,77 @@ +google.api.PhpSettings + */ +class PhpSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ProjectProperties.php b/vendor/google/common-protos/src/Api/ProjectProperties.php new file mode 100644 index 0000000..122688d --- /dev/null +++ b/vendor/google/common-protos/src/Api/ProjectProperties.php @@ -0,0 +1,80 @@ +google.api.ProjectProperties + */ +class ProjectProperties extends \Google\Protobuf\Internal\Message +{ + /** + * List of per consumer project-specific properties. + * + * Generated from protobuf field repeated .google.api.Property properties = 1; + */ + private $properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\Property>|\Google\Protobuf\Internal\RepeatedField $properties + * List of per consumer project-specific properties. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Consumer::initOnce(); + parent::__construct($data); + } + + /** + * List of per consumer project-specific properties. + * + * Generated from protobuf field repeated .google.api.Property properties = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProperties() + { + return $this->properties; + } + + /** + * List of per consumer project-specific properties. + * + * Generated from protobuf field repeated .google.api.Property properties = 1; + * @param array<\Google\Api\Property>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Property::class); + $this->properties = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Property.php b/vendor/google/common-protos/src/Api/Property.php new file mode 100644 index 0000000..6212e63 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Property.php @@ -0,0 +1,142 @@ +google.api.Property + */ +class Property extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the property (a.k.a key). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The type of this property. + * + * Generated from protobuf field .google.api.Property.PropertyType type = 2; + */ + protected $type = 0; + /** + * The description of the property + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the property (a.k.a key). + * @type int $type + * The type of this property. + * @type string $description + * The description of the property + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Consumer::initOnce(); + parent::__construct($data); + } + + /** + * The name of the property (a.k.a key). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the property (a.k.a key). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of this property. + * + * Generated from protobuf field .google.api.Property.PropertyType type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this property. + * + * Generated from protobuf field .google.api.Property.PropertyType type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Api\Property\PropertyType::class); + $this->type = $var; + + return $this; + } + + /** + * The description of the property + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of the property + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Property/PropertyType.php b/vendor/google/common-protos/src/Api/Property/PropertyType.php new file mode 100644 index 0000000..b4b6cd7 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Property/PropertyType.php @@ -0,0 +1,76 @@ +google.api.Property.PropertyType + */ +class PropertyType +{ + /** + * The type is unspecified, and will result in an error. + * + * Generated from protobuf enum UNSPECIFIED = 0; + */ + const UNSPECIFIED = 0; + /** + * The type is `int64`. + * + * Generated from protobuf enum INT64 = 1; + */ + const INT64 = 1; + /** + * The type is `bool`. + * + * Generated from protobuf enum BOOL = 2; + */ + const BOOL = 2; + /** + * The type is `string`. + * + * Generated from protobuf enum STRING = 3; + */ + const STRING = 3; + /** + * The type is 'double'. + * + * Generated from protobuf enum DOUBLE = 4; + */ + const DOUBLE = 4; + + private static $valueToName = [ + self::UNSPECIFIED => 'UNSPECIFIED', + self::INT64 => 'INT64', + self::BOOL => 'BOOL', + self::STRING => 'STRING', + self::DOUBLE => 'DOUBLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/Publishing.php b/vendor/google/common-protos/src/Api/Publishing.php new file mode 100644 index 0000000..6618617 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Publishing.php @@ -0,0 +1,453 @@ +google.api.Publishing + */ +class Publishing extends \Google\Protobuf\Internal\Message +{ + /** + * A list of API method settings, e.g. the behavior for methods that use the + * long-running operation pattern. + * + * Generated from protobuf field repeated .google.api.MethodSettings method_settings = 2; + */ + private $method_settings; + /** + * Link to a *public* URI where users can report issues. Example: + * https://issuetracker.google.com/issues/new?component=190865&template=1161103 + * + * Generated from protobuf field string new_issue_uri = 101; + */ + protected $new_issue_uri = ''; + /** + * Link to product home page. Example: + * https://cloud.google.com/asset-inventory/docs/overview + * + * Generated from protobuf field string documentation_uri = 102; + */ + protected $documentation_uri = ''; + /** + * Used as a tracking tag when collecting data about the APIs developer + * relations artifacts like docs, packages delivered to package managers, + * etc. Example: "speech". + * + * Generated from protobuf field string api_short_name = 103; + */ + protected $api_short_name = ''; + /** + * GitHub label to apply to issues and pull requests opened for this API. + * + * Generated from protobuf field string github_label = 104; + */ + protected $github_label = ''; + /** + * GitHub teams to be added to CODEOWNERS in the directory in GitHub + * containing source code for the client libraries for this API. + * + * Generated from protobuf field repeated string codeowner_github_teams = 105; + */ + private $codeowner_github_teams; + /** + * A prefix used in sample code when demarking regions to be included in + * documentation. + * + * Generated from protobuf field string doc_tag_prefix = 106; + */ + protected $doc_tag_prefix = ''; + /** + * For whom the client library is being published. + * + * Generated from protobuf field .google.api.ClientLibraryOrganization organization = 107; + */ + protected $organization = 0; + /** + * Client library settings. If the same version string appears multiple + * times in this list, then the last one wins. Settings from earlier + * settings with the same version string are discarded. + * + * Generated from protobuf field repeated .google.api.ClientLibrarySettings library_settings = 109; + */ + private $library_settings; + /** + * Optional link to proto reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rpc + * + * Generated from protobuf field string proto_reference_documentation_uri = 110; + */ + protected $proto_reference_documentation_uri = ''; + /** + * Optional link to REST reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rest + * + * Generated from protobuf field string rest_reference_documentation_uri = 111; + */ + protected $rest_reference_documentation_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\MethodSettings>|\Google\Protobuf\Internal\RepeatedField $method_settings + * A list of API method settings, e.g. the behavior for methods that use the + * long-running operation pattern. + * @type string $new_issue_uri + * Link to a *public* URI where users can report issues. Example: + * https://issuetracker.google.com/issues/new?component=190865&template=1161103 + * @type string $documentation_uri + * Link to product home page. Example: + * https://cloud.google.com/asset-inventory/docs/overview + * @type string $api_short_name + * Used as a tracking tag when collecting data about the APIs developer + * relations artifacts like docs, packages delivered to package managers, + * etc. Example: "speech". + * @type string $github_label + * GitHub label to apply to issues and pull requests opened for this API. + * @type array|\Google\Protobuf\Internal\RepeatedField $codeowner_github_teams + * GitHub teams to be added to CODEOWNERS in the directory in GitHub + * containing source code for the client libraries for this API. + * @type string $doc_tag_prefix + * A prefix used in sample code when demarking regions to be included in + * documentation. + * @type int $organization + * For whom the client library is being published. + * @type array<\Google\Api\ClientLibrarySettings>|\Google\Protobuf\Internal\RepeatedField $library_settings + * Client library settings. If the same version string appears multiple + * times in this list, then the last one wins. Settings from earlier + * settings with the same version string are discarded. + * @type string $proto_reference_documentation_uri + * Optional link to proto reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rpc + * @type string $rest_reference_documentation_uri + * Optional link to REST reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rest + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * A list of API method settings, e.g. the behavior for methods that use the + * long-running operation pattern. + * + * Generated from protobuf field repeated .google.api.MethodSettings method_settings = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethodSettings() + { + return $this->method_settings; + } + + /** + * A list of API method settings, e.g. the behavior for methods that use the + * long-running operation pattern. + * + * Generated from protobuf field repeated .google.api.MethodSettings method_settings = 2; + * @param array<\Google\Api\MethodSettings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethodSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MethodSettings::class); + $this->method_settings = $arr; + + return $this; + } + + /** + * Link to a *public* URI where users can report issues. Example: + * https://issuetracker.google.com/issues/new?component=190865&template=1161103 + * + * Generated from protobuf field string new_issue_uri = 101; + * @return string + */ + public function getNewIssueUri() + { + return $this->new_issue_uri; + } + + /** + * Link to a *public* URI where users can report issues. Example: + * https://issuetracker.google.com/issues/new?component=190865&template=1161103 + * + * Generated from protobuf field string new_issue_uri = 101; + * @param string $var + * @return $this + */ + public function setNewIssueUri($var) + { + GPBUtil::checkString($var, True); + $this->new_issue_uri = $var; + + return $this; + } + + /** + * Link to product home page. Example: + * https://cloud.google.com/asset-inventory/docs/overview + * + * Generated from protobuf field string documentation_uri = 102; + * @return string + */ + public function getDocumentationUri() + { + return $this->documentation_uri; + } + + /** + * Link to product home page. Example: + * https://cloud.google.com/asset-inventory/docs/overview + * + * Generated from protobuf field string documentation_uri = 102; + * @param string $var + * @return $this + */ + public function setDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->documentation_uri = $var; + + return $this; + } + + /** + * Used as a tracking tag when collecting data about the APIs developer + * relations artifacts like docs, packages delivered to package managers, + * etc. Example: "speech". + * + * Generated from protobuf field string api_short_name = 103; + * @return string + */ + public function getApiShortName() + { + return $this->api_short_name; + } + + /** + * Used as a tracking tag when collecting data about the APIs developer + * relations artifacts like docs, packages delivered to package managers, + * etc. Example: "speech". + * + * Generated from protobuf field string api_short_name = 103; + * @param string $var + * @return $this + */ + public function setApiShortName($var) + { + GPBUtil::checkString($var, True); + $this->api_short_name = $var; + + return $this; + } + + /** + * GitHub label to apply to issues and pull requests opened for this API. + * + * Generated from protobuf field string github_label = 104; + * @return string + */ + public function getGithubLabel() + { + return $this->github_label; + } + + /** + * GitHub label to apply to issues and pull requests opened for this API. + * + * Generated from protobuf field string github_label = 104; + * @param string $var + * @return $this + */ + public function setGithubLabel($var) + { + GPBUtil::checkString($var, True); + $this->github_label = $var; + + return $this; + } + + /** + * GitHub teams to be added to CODEOWNERS in the directory in GitHub + * containing source code for the client libraries for this API. + * + * Generated from protobuf field repeated string codeowner_github_teams = 105; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCodeownerGithubTeams() + { + return $this->codeowner_github_teams; + } + + /** + * GitHub teams to be added to CODEOWNERS in the directory in GitHub + * containing source code for the client libraries for this API. + * + * Generated from protobuf field repeated string codeowner_github_teams = 105; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCodeownerGithubTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->codeowner_github_teams = $arr; + + return $this; + } + + /** + * A prefix used in sample code when demarking regions to be included in + * documentation. + * + * Generated from protobuf field string doc_tag_prefix = 106; + * @return string + */ + public function getDocTagPrefix() + { + return $this->doc_tag_prefix; + } + + /** + * A prefix used in sample code when demarking regions to be included in + * documentation. + * + * Generated from protobuf field string doc_tag_prefix = 106; + * @param string $var + * @return $this + */ + public function setDocTagPrefix($var) + { + GPBUtil::checkString($var, True); + $this->doc_tag_prefix = $var; + + return $this; + } + + /** + * For whom the client library is being published. + * + * Generated from protobuf field .google.api.ClientLibraryOrganization organization = 107; + * @return int + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * For whom the client library is being published. + * + * Generated from protobuf field .google.api.ClientLibraryOrganization organization = 107; + * @param int $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkEnum($var, \Google\Api\ClientLibraryOrganization::class); + $this->organization = $var; + + return $this; + } + + /** + * Client library settings. If the same version string appears multiple + * times in this list, then the last one wins. Settings from earlier + * settings with the same version string are discarded. + * + * Generated from protobuf field repeated .google.api.ClientLibrarySettings library_settings = 109; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLibrarySettings() + { + return $this->library_settings; + } + + /** + * Client library settings. If the same version string appears multiple + * times in this list, then the last one wins. Settings from earlier + * settings with the same version string are discarded. + * + * Generated from protobuf field repeated .google.api.ClientLibrarySettings library_settings = 109; + * @param array<\Google\Api\ClientLibrarySettings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLibrarySettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\ClientLibrarySettings::class); + $this->library_settings = $arr; + + return $this; + } + + /** + * Optional link to proto reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rpc + * + * Generated from protobuf field string proto_reference_documentation_uri = 110; + * @return string + */ + public function getProtoReferenceDocumentationUri() + { + return $this->proto_reference_documentation_uri; + } + + /** + * Optional link to proto reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rpc + * + * Generated from protobuf field string proto_reference_documentation_uri = 110; + * @param string $var + * @return $this + */ + public function setProtoReferenceDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->proto_reference_documentation_uri = $var; + + return $this; + } + + /** + * Optional link to REST reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rest + * + * Generated from protobuf field string rest_reference_documentation_uri = 111; + * @return string + */ + public function getRestReferenceDocumentationUri() + { + return $this->rest_reference_documentation_uri; + } + + /** + * Optional link to REST reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rest + * + * Generated from protobuf field string rest_reference_documentation_uri = 111; + * @param string $var + * @return $this + */ + public function setRestReferenceDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->rest_reference_documentation_uri = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/PythonSettings.php b/vendor/google/common-protos/src/Api/PythonSettings.php new file mode 100644 index 0000000..e502c74 --- /dev/null +++ b/vendor/google/common-protos/src/Api/PythonSettings.php @@ -0,0 +1,121 @@ +google.api.PythonSettings + */ +class PythonSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + protected $experimental_features = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * @type \Google\Api\PythonSettings\ExperimentalFeatures $experimental_features + * Experimental features to be included during client library generation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * @return \Google\Api\PythonSettings\ExperimentalFeatures|null + */ + public function getExperimentalFeatures() + { + return $this->experimental_features; + } + + public function hasExperimentalFeatures() + { + return isset($this->experimental_features); + } + + public function clearExperimentalFeatures() + { + unset($this->experimental_features); + } + + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * @param \Google\Api\PythonSettings\ExperimentalFeatures $var + * @return $this + */ + public function setExperimentalFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Api\PythonSettings\ExperimentalFeatures::class); + $this->experimental_features = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php b/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php new file mode 100644 index 0000000..200d477 --- /dev/null +++ b/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php @@ -0,0 +1,174 @@ +google.api.PythonSettings.ExperimentalFeatures + */ +class ExperimentalFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + */ + protected $rest_async_io_enabled = false; + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + */ + protected $protobuf_pythonic_types_enabled = false; + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + */ + protected $unversioned_package_disabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $rest_async_io_enabled + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * @type bool $protobuf_pythonic_types_enabled + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * @type bool $unversioned_package_disabled + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + * @return bool + */ + public function getRestAsyncIoEnabled() + { + return $this->rest_async_io_enabled; + } + + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + * @param bool $var + * @return $this + */ + public function setRestAsyncIoEnabled($var) + { + GPBUtil::checkBool($var); + $this->rest_async_io_enabled = $var; + + return $this; + } + + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + * @return bool + */ + public function getProtobufPythonicTypesEnabled() + { + return $this->protobuf_pythonic_types_enabled; + } + + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + * @param bool $var + * @return $this + */ + public function setProtobufPythonicTypesEnabled($var) + { + GPBUtil::checkBool($var); + $this->protobuf_pythonic_types_enabled = $var; + + return $this; + } + + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + * @return bool + */ + public function getUnversionedPackageDisabled() + { + return $this->unversioned_package_disabled; + } + + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + * @param bool $var + * @return $this + */ + public function setUnversionedPackageDisabled($var) + { + GPBUtil::checkBool($var); + $this->unversioned_package_disabled = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Api/Quota.php b/vendor/google/common-protos/src/Api/Quota.php new file mode 100644 index 0000000..a4d5db9 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Quota.php @@ -0,0 +1,144 @@ +google.api.Quota + */ +class Quota extends \Google\Protobuf\Internal\Message +{ + /** + * List of QuotaLimit definitions for the service. + * + * Generated from protobuf field repeated .google.api.QuotaLimit limits = 3; + */ + private $limits; + /** + * List of MetricRule definitions, each one mapping a selected method to one + * or more metrics. + * + * Generated from protobuf field repeated .google.api.MetricRule metric_rules = 4; + */ + private $metric_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\QuotaLimit>|\Google\Protobuf\Internal\RepeatedField $limits + * List of QuotaLimit definitions for the service. + * @type array<\Google\Api\MetricRule>|\Google\Protobuf\Internal\RepeatedField $metric_rules + * List of MetricRule definitions, each one mapping a selected method to one + * or more metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Quota::initOnce(); + parent::__construct($data); + } + + /** + * List of QuotaLimit definitions for the service. + * + * Generated from protobuf field repeated .google.api.QuotaLimit limits = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLimits() + { + return $this->limits; + } + + /** + * List of QuotaLimit definitions for the service. + * + * Generated from protobuf field repeated .google.api.QuotaLimit limits = 3; + * @param array<\Google\Api\QuotaLimit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLimits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\QuotaLimit::class); + $this->limits = $arr; + + return $this; + } + + /** + * List of MetricRule definitions, each one mapping a selected method to one + * or more metrics. + * + * Generated from protobuf field repeated .google.api.MetricRule metric_rules = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetricRules() + { + return $this->metric_rules; + } + + /** + * List of MetricRule definitions, each one mapping a selected method to one + * or more metrics. + * + * Generated from protobuf field repeated .google.api.MetricRule metric_rules = 4; + * @param array<\Google\Api\MetricRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetricRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MetricRule::class); + $this->metric_rules = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/QuotaLimit.php b/vendor/google/common-protos/src/Api/QuotaLimit.php new file mode 100644 index 0000000..977cd01 --- /dev/null +++ b/vendor/google/common-protos/src/Api/QuotaLimit.php @@ -0,0 +1,527 @@ +google.api.QuotaLimit + */ +class QuotaLimit extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the quota limit. + * The name must be provided, and it must be unique within the service. The + * name can only include alphanumeric characters as well as '-'. + * The maximum length of the limit name is 64 characters. + * + * Generated from protobuf field string name = 6; + */ + protected $name = ''; + /** + * Optional. User-visible, extended description for this quota limit. + * Should be used only when more context is needed to understand this limit + * than provided by the limit's display name (see: `display_name`). + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client + * application developer activates the service for his/her project. + * Specifying a value of 0 will block all requests. This can be used if you + * are provisioning quota to selected consumers and blocking others. + * Similarly, a value of -1 will indicate an unlimited quota. No other + * negative values are allowed. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 default_limit = 3; + */ + protected $default_limit = 0; + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 max_limit = 4; + */ + protected $max_limit = 0; + /** + * Free tier value displayed in the Developers Console for this limit. + * The free tier is the number of tokens that will be subtracted from the + * billed amount when billing is enabled. + * This field can only be set on a limit with duration "1d", in a billable + * group; it is invalid on any other limit. If this field is not set, it + * defaults to 0, indicating that there is no free tier for this service. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 free_tier = 7; + */ + protected $free_tier = 0; + /** + * Duration of this limit in textual notation. Must be "100s" or "1d". + * Used by group-based quotas only. + * + * Generated from protobuf field string duration = 5; + */ + protected $duration = ''; + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must be + * defined within the service config. + * + * Generated from protobuf field string metric = 8; + */ + protected $metric = ''; + /** + * Specify the unit of the quota limit. It uses the same syntax as + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. + * Here are some examples: + * * "1/min/{project}" for quota per minute per project. + * Note: the order of unit components is insignificant. + * The "1" at the beginning is required to follow the metric unit syntax. + * + * Generated from protobuf field string unit = 9; + */ + protected $unit = ''; + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + * + * Generated from protobuf field map values = 10; + */ + private $values; + /** + * User-visible display name for this limit. + * Optional. If not set, the UI will provide a default display name based on + * the quota configuration. This field can be used to override the default + * display name generated from the configuration. + * + * Generated from protobuf field string display_name = 12; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the quota limit. + * The name must be provided, and it must be unique within the service. The + * name can only include alphanumeric characters as well as '-'. + * The maximum length of the limit name is 64 characters. + * @type string $description + * Optional. User-visible, extended description for this quota limit. + * Should be used only when more context is needed to understand this limit + * than provided by the limit's display name (see: `display_name`). + * @type int|string $default_limit + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client + * application developer activates the service for his/her project. + * Specifying a value of 0 will block all requests. This can be used if you + * are provisioning quota to selected consumers and blocking others. + * Similarly, a value of -1 will indicate an unlimited quota. No other + * negative values are allowed. + * Used by group-based quotas only. + * @type int|string $max_limit + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. + * Used by group-based quotas only. + * @type int|string $free_tier + * Free tier value displayed in the Developers Console for this limit. + * The free tier is the number of tokens that will be subtracted from the + * billed amount when billing is enabled. + * This field can only be set on a limit with duration "1d", in a billable + * group; it is invalid on any other limit. If this field is not set, it + * defaults to 0, indicating that there is no free tier for this service. + * Used by group-based quotas only. + * @type string $duration + * Duration of this limit in textual notation. Must be "100s" or "1d". + * Used by group-based quotas only. + * @type string $metric + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must be + * defined within the service config. + * @type string $unit + * Specify the unit of the quota limit. It uses the same syntax as + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. + * Here are some examples: + * * "1/min/{project}" for quota per minute per project. + * Note: the order of unit components is insignificant. + * The "1" at the beginning is required to follow the metric unit syntax. + * @type array|\Google\Protobuf\Internal\MapField $values + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + * @type string $display_name + * User-visible display name for this limit. + * Optional. If not set, the UI will provide a default display name based on + * the quota configuration. This field can be used to override the default + * display name generated from the configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Quota::initOnce(); + parent::__construct($data); + } + + /** + * Name of the quota limit. + * The name must be provided, and it must be unique within the service. The + * name can only include alphanumeric characters as well as '-'. + * The maximum length of the limit name is 64 characters. + * + * Generated from protobuf field string name = 6; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the quota limit. + * The name must be provided, and it must be unique within the service. The + * name can only include alphanumeric characters as well as '-'. + * The maximum length of the limit name is 64 characters. + * + * Generated from protobuf field string name = 6; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. User-visible, extended description for this quota limit. + * Should be used only when more context is needed to understand this limit + * than provided by the limit's display name (see: `display_name`). + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-visible, extended description for this quota limit. + * Should be used only when more context is needed to understand this limit + * than provided by the limit's display name (see: `display_name`). + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client + * application developer activates the service for his/her project. + * Specifying a value of 0 will block all requests. This can be used if you + * are provisioning quota to selected consumers and blocking others. + * Similarly, a value of -1 will indicate an unlimited quota. No other + * negative values are allowed. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 default_limit = 3; + * @return int|string + */ + public function getDefaultLimit() + { + return $this->default_limit; + } + + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client + * application developer activates the service for his/her project. + * Specifying a value of 0 will block all requests. This can be used if you + * are provisioning quota to selected consumers and blocking others. + * Similarly, a value of -1 will indicate an unlimited quota. No other + * negative values are allowed. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 default_limit = 3; + * @param int|string $var + * @return $this + */ + public function setDefaultLimit($var) + { + GPBUtil::checkInt64($var); + $this->default_limit = $var; + + return $this; + } + + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 max_limit = 4; + * @return int|string + */ + public function getMaxLimit() + { + return $this->max_limit; + } + + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 max_limit = 4; + * @param int|string $var + * @return $this + */ + public function setMaxLimit($var) + { + GPBUtil::checkInt64($var); + $this->max_limit = $var; + + return $this; + } + + /** + * Free tier value displayed in the Developers Console for this limit. + * The free tier is the number of tokens that will be subtracted from the + * billed amount when billing is enabled. + * This field can only be set on a limit with duration "1d", in a billable + * group; it is invalid on any other limit. If this field is not set, it + * defaults to 0, indicating that there is no free tier for this service. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 free_tier = 7; + * @return int|string + */ + public function getFreeTier() + { + return $this->free_tier; + } + + /** + * Free tier value displayed in the Developers Console for this limit. + * The free tier is the number of tokens that will be subtracted from the + * billed amount when billing is enabled. + * This field can only be set on a limit with duration "1d", in a billable + * group; it is invalid on any other limit. If this field is not set, it + * defaults to 0, indicating that there is no free tier for this service. + * Used by group-based quotas only. + * + * Generated from protobuf field int64 free_tier = 7; + * @param int|string $var + * @return $this + */ + public function setFreeTier($var) + { + GPBUtil::checkInt64($var); + $this->free_tier = $var; + + return $this; + } + + /** + * Duration of this limit in textual notation. Must be "100s" or "1d". + * Used by group-based quotas only. + * + * Generated from protobuf field string duration = 5; + * @return string + */ + public function getDuration() + { + return $this->duration; + } + + /** + * Duration of this limit in textual notation. Must be "100s" or "1d". + * Used by group-based quotas only. + * + * Generated from protobuf field string duration = 5; + * @param string $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkString($var, True); + $this->duration = $var; + + return $this; + } + + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must be + * defined within the service config. + * + * Generated from protobuf field string metric = 8; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must be + * defined within the service config. + * + * Generated from protobuf field string metric = 8; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * Specify the unit of the quota limit. It uses the same syntax as + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. + * Here are some examples: + * * "1/min/{project}" for quota per minute per project. + * Note: the order of unit components is insignificant. + * The "1" at the beginning is required to follow the metric unit syntax. + * + * Generated from protobuf field string unit = 9; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Specify the unit of the quota limit. It uses the same syntax as + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. + * Here are some examples: + * * "1/min/{project}" for quota per minute per project. + * Note: the order of unit components is insignificant. + * The "1" at the beginning is required to follow the metric unit syntax. + * + * Generated from protobuf field string unit = 9; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + * + * Generated from protobuf field map values = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getValues() + { + return $this->values; + } + + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + * + * Generated from protobuf field map values = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64); + $this->values = $arr; + + return $this; + } + + /** + * User-visible display name for this limit. + * Optional. If not set, the UI will provide a default display name based on + * the quota configuration. This field can be used to override the default + * display name generated from the configuration. + * + * Generated from protobuf field string display_name = 12; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-visible display name for this limit. + * Optional. If not set, the UI will provide a default display name based on + * the quota configuration. This field can be used to override the default + * display name generated from the configuration. + * + * Generated from protobuf field string display_name = 12; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ResourceDescriptor.php b/vendor/google/common-protos/src/Api/ResourceDescriptor.php new file mode 100644 index 0000000..f2c9f73 --- /dev/null +++ b/vendor/google/common-protos/src/Api/ResourceDescriptor.php @@ -0,0 +1,495 @@ +google.api.ResourceDescriptor + */ +class ResourceDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The resource type. It must be in the format of + * {service_name}/{resource_type_kind}. The `resource_type_kind` must be + * singular and must not include version numbers. + * Example: `storage.googleapis.com/Bucket` + * The value of the resource_type_kind must follow the regular expression + * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + * should use PascalCase (UpperCamelCase). The maximum number of + * characters allowed for the `resource_type_kind` is 100. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Optional. The relative resource name pattern associated with this resource + * type. The DNS prefix of the full resource name shouldn't be specified here. + * The path pattern must follow the syntax, which aligns with HTTP binding + * syntax: + * Template = Segment { "/" Segment } ; + * Segment = LITERAL | Variable ; + * Variable = "{" LITERAL "}" ; + * Examples: + * - "projects/{project}/topics/{topic}" + * - "projects/{project}/knowledgeBases/{knowledge_base}" + * The components in braces correspond to the IDs for each resource in the + * hierarchy. It is expected that, if multiple patterns are provided, + * the same component name (e.g. "project") refers to IDs of the same + * type of resource. + * + * Generated from protobuf field repeated string pattern = 2; + */ + private $pattern; + /** + * Optional. The field on the resource that designates the resource name + * field. If omitted, this is assumed to be "name". + * + * Generated from protobuf field string name_field = 3; + */ + protected $name_field = ''; + /** + * Optional. The historical or future-looking state of the resource pattern. + * Example: + * // The InspectTemplate message originally only supported resource + * // names with organization, and project was added later. + * message InspectTemplate { + * option (google.api.resource) = { + * type: "dlp.googleapis.com/InspectTemplate" + * pattern: + * "organizations/{organization}/inspectTemplates/{inspect_template}" + * pattern: "projects/{project}/inspectTemplates/{inspect_template}" + * history: ORIGINALLY_SINGLE_PATTERN + * }; + * } + * + * Generated from protobuf field .google.api.ResourceDescriptor.History history = 4; + */ + protected $history = 0; + /** + * The plural name used in the resource name and permission names, such as + * 'projects' for the resource name of 'projects/{project}' and the permission + * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + * to this is for Nested Collections that have stuttering names, as defined + * in [AIP-122](https://google.aip.dev/122#nested-collections), where the + * collection ID in the resource name pattern does not necessarily directly + * match the `plural` value. + * It is the same concept of the `plural` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Note: The plural form is required even for singleton resources. See + * https://aip.dev/156 + * + * Generated from protobuf field string plural = 5; + */ + protected $plural = ''; + /** + * The same concept of the `singular` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Such as "project" for the `resourcemanager.googleapis.com/Project` type. + * + * Generated from protobuf field string singular = 6; + */ + protected $singular = ''; + /** + * Style flag(s) for this resource. + * These indicate that a resource is expected to conform to a given + * style. See the specific style flags for additional information. + * + * Generated from protobuf field repeated .google.api.ResourceDescriptor.Style style = 10; + */ + private $style; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The resource type. It must be in the format of + * {service_name}/{resource_type_kind}. The `resource_type_kind` must be + * singular and must not include version numbers. + * Example: `storage.googleapis.com/Bucket` + * The value of the resource_type_kind must follow the regular expression + * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + * should use PascalCase (UpperCamelCase). The maximum number of + * characters allowed for the `resource_type_kind` is 100. + * @type array|\Google\Protobuf\Internal\RepeatedField $pattern + * Optional. The relative resource name pattern associated with this resource + * type. The DNS prefix of the full resource name shouldn't be specified here. + * The path pattern must follow the syntax, which aligns with HTTP binding + * syntax: + * Template = Segment { "/" Segment } ; + * Segment = LITERAL | Variable ; + * Variable = "{" LITERAL "}" ; + * Examples: + * - "projects/{project}/topics/{topic}" + * - "projects/{project}/knowledgeBases/{knowledge_base}" + * The components in braces correspond to the IDs for each resource in the + * hierarchy. It is expected that, if multiple patterns are provided, + * the same component name (e.g. "project") refers to IDs of the same + * type of resource. + * @type string $name_field + * Optional. The field on the resource that designates the resource name + * field. If omitted, this is assumed to be "name". + * @type int $history + * Optional. The historical or future-looking state of the resource pattern. + * Example: + * // The InspectTemplate message originally only supported resource + * // names with organization, and project was added later. + * message InspectTemplate { + * option (google.api.resource) = { + * type: "dlp.googleapis.com/InspectTemplate" + * pattern: + * "organizations/{organization}/inspectTemplates/{inspect_template}" + * pattern: "projects/{project}/inspectTemplates/{inspect_template}" + * history: ORIGINALLY_SINGLE_PATTERN + * }; + * } + * @type string $plural + * The plural name used in the resource name and permission names, such as + * 'projects' for the resource name of 'projects/{project}' and the permission + * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + * to this is for Nested Collections that have stuttering names, as defined + * in [AIP-122](https://google.aip.dev/122#nested-collections), where the + * collection ID in the resource name pattern does not necessarily directly + * match the `plural` value. + * It is the same concept of the `plural` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Note: The plural form is required even for singleton resources. See + * https://aip.dev/156 + * @type string $singular + * The same concept of the `singular` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Such as "project" for the `resourcemanager.googleapis.com/Project` type. + * @type array|\Google\Protobuf\Internal\RepeatedField $style + * Style flag(s) for this resource. + * These indicate that a resource is expected to conform to a given + * style. See the specific style flags for additional information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Resource::initOnce(); + parent::__construct($data); + } + + /** + * The resource type. It must be in the format of + * {service_name}/{resource_type_kind}. The `resource_type_kind` must be + * singular and must not include version numbers. + * Example: `storage.googleapis.com/Bucket` + * The value of the resource_type_kind must follow the regular expression + * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + * should use PascalCase (UpperCamelCase). The maximum number of + * characters allowed for the `resource_type_kind` is 100. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The resource type. It must be in the format of + * {service_name}/{resource_type_kind}. The `resource_type_kind` must be + * singular and must not include version numbers. + * Example: `storage.googleapis.com/Bucket` + * The value of the resource_type_kind must follow the regular expression + * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + * should use PascalCase (UpperCamelCase). The maximum number of + * characters allowed for the `resource_type_kind` is 100. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Optional. The relative resource name pattern associated with this resource + * type. The DNS prefix of the full resource name shouldn't be specified here. + * The path pattern must follow the syntax, which aligns with HTTP binding + * syntax: + * Template = Segment { "/" Segment } ; + * Segment = LITERAL | Variable ; + * Variable = "{" LITERAL "}" ; + * Examples: + * - "projects/{project}/topics/{topic}" + * - "projects/{project}/knowledgeBases/{knowledge_base}" + * The components in braces correspond to the IDs for each resource in the + * hierarchy. It is expected that, if multiple patterns are provided, + * the same component name (e.g. "project") refers to IDs of the same + * type of resource. + * + * Generated from protobuf field repeated string pattern = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPattern() + { + return $this->pattern; + } + + /** + * Optional. The relative resource name pattern associated with this resource + * type. The DNS prefix of the full resource name shouldn't be specified here. + * The path pattern must follow the syntax, which aligns with HTTP binding + * syntax: + * Template = Segment { "/" Segment } ; + * Segment = LITERAL | Variable ; + * Variable = "{" LITERAL "}" ; + * Examples: + * - "projects/{project}/topics/{topic}" + * - "projects/{project}/knowledgeBases/{knowledge_base}" + * The components in braces correspond to the IDs for each resource in the + * hierarchy. It is expected that, if multiple patterns are provided, + * the same component name (e.g. "project") refers to IDs of the same + * type of resource. + * + * Generated from protobuf field repeated string pattern = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPattern($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pattern = $arr; + + return $this; + } + + /** + * Optional. The field on the resource that designates the resource name + * field. If omitted, this is assumed to be "name". + * + * Generated from protobuf field string name_field = 3; + * @return string + */ + public function getNameField() + { + return $this->name_field; + } + + /** + * Optional. The field on the resource that designates the resource name + * field. If omitted, this is assumed to be "name". + * + * Generated from protobuf field string name_field = 3; + * @param string $var + * @return $this + */ + public function setNameField($var) + { + GPBUtil::checkString($var, True); + $this->name_field = $var; + + return $this; + } + + /** + * Optional. The historical or future-looking state of the resource pattern. + * Example: + * // The InspectTemplate message originally only supported resource + * // names with organization, and project was added later. + * message InspectTemplate { + * option (google.api.resource) = { + * type: "dlp.googleapis.com/InspectTemplate" + * pattern: + * "organizations/{organization}/inspectTemplates/{inspect_template}" + * pattern: "projects/{project}/inspectTemplates/{inspect_template}" + * history: ORIGINALLY_SINGLE_PATTERN + * }; + * } + * + * Generated from protobuf field .google.api.ResourceDescriptor.History history = 4; + * @return int + */ + public function getHistory() + { + return $this->history; + } + + /** + * Optional. The historical or future-looking state of the resource pattern. + * Example: + * // The InspectTemplate message originally only supported resource + * // names with organization, and project was added later. + * message InspectTemplate { + * option (google.api.resource) = { + * type: "dlp.googleapis.com/InspectTemplate" + * pattern: + * "organizations/{organization}/inspectTemplates/{inspect_template}" + * pattern: "projects/{project}/inspectTemplates/{inspect_template}" + * history: ORIGINALLY_SINGLE_PATTERN + * }; + * } + * + * Generated from protobuf field .google.api.ResourceDescriptor.History history = 4; + * @param int $var + * @return $this + */ + public function setHistory($var) + { + GPBUtil::checkEnum($var, \Google\Api\ResourceDescriptor\History::class); + $this->history = $var; + + return $this; + } + + /** + * The plural name used in the resource name and permission names, such as + * 'projects' for the resource name of 'projects/{project}' and the permission + * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + * to this is for Nested Collections that have stuttering names, as defined + * in [AIP-122](https://google.aip.dev/122#nested-collections), where the + * collection ID in the resource name pattern does not necessarily directly + * match the `plural` value. + * It is the same concept of the `plural` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Note: The plural form is required even for singleton resources. See + * https://aip.dev/156 + * + * Generated from protobuf field string plural = 5; + * @return string + */ + public function getPlural() + { + return $this->plural; + } + + /** + * The plural name used in the resource name and permission names, such as + * 'projects' for the resource name of 'projects/{project}' and the permission + * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + * to this is for Nested Collections that have stuttering names, as defined + * in [AIP-122](https://google.aip.dev/122#nested-collections), where the + * collection ID in the resource name pattern does not necessarily directly + * match the `plural` value. + * It is the same concept of the `plural` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Note: The plural form is required even for singleton resources. See + * https://aip.dev/156 + * + * Generated from protobuf field string plural = 5; + * @param string $var + * @return $this + */ + public function setPlural($var) + { + GPBUtil::checkString($var, True); + $this->plural = $var; + + return $this; + } + + /** + * The same concept of the `singular` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Such as "project" for the `resourcemanager.googleapis.com/Project` type. + * + * Generated from protobuf field string singular = 6; + * @return string + */ + public function getSingular() + { + return $this->singular; + } + + /** + * The same concept of the `singular` field in k8s CRD spec + * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + * Such as "project" for the `resourcemanager.googleapis.com/Project` type. + * + * Generated from protobuf field string singular = 6; + * @param string $var + * @return $this + */ + public function setSingular($var) + { + GPBUtil::checkString($var, True); + $this->singular = $var; + + return $this; + } + + /** + * Style flag(s) for this resource. + * These indicate that a resource is expected to conform to a given + * style. See the specific style flags for additional information. + * + * Generated from protobuf field repeated .google.api.ResourceDescriptor.Style style = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStyle() + { + return $this->style; + } + + /** + * Style flag(s) for this resource. + * These indicate that a resource is expected to conform to a given + * style. See the specific style flags for additional information. + * + * Generated from protobuf field repeated .google.api.ResourceDescriptor.Style style = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStyle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Api\ResourceDescriptor\Style::class); + $this->style = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/ResourceDescriptor/History.php b/vendor/google/common-protos/src/Api/ResourceDescriptor/History.php new file mode 100644 index 0000000..5005eb2 --- /dev/null +++ b/vendor/google/common-protos/src/Api/ResourceDescriptor/History.php @@ -0,0 +1,66 @@ +google.api.ResourceDescriptor.History + */ +class History +{ + /** + * The "unset" value. + * + * Generated from protobuf enum HISTORY_UNSPECIFIED = 0; + */ + const HISTORY_UNSPECIFIED = 0; + /** + * The resource originally had one pattern and launched as such, and + * additional patterns were added later. + * + * Generated from protobuf enum ORIGINALLY_SINGLE_PATTERN = 1; + */ + const ORIGINALLY_SINGLE_PATTERN = 1; + /** + * The resource has one pattern, but the API owner expects to add more + * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + * that from being necessary once there are multiple patterns.) + * + * Generated from protobuf enum FUTURE_MULTI_PATTERN = 2; + */ + const FUTURE_MULTI_PATTERN = 2; + + private static $valueToName = [ + self::HISTORY_UNSPECIFIED => 'HISTORY_UNSPECIFIED', + self::ORIGINALLY_SINGLE_PATTERN => 'ORIGINALLY_SINGLE_PATTERN', + self::FUTURE_MULTI_PATTERN => 'FUTURE_MULTI_PATTERN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/ResourceDescriptor/Style.php b/vendor/google/common-protos/src/Api/ResourceDescriptor/Style.php new file mode 100644 index 0000000..4d0c56e --- /dev/null +++ b/vendor/google/common-protos/src/Api/ResourceDescriptor/Style.php @@ -0,0 +1,60 @@ +google.api.ResourceDescriptor.Style + */ +class Style +{ + /** + * The unspecified value. Do not use. + * + * Generated from protobuf enum STYLE_UNSPECIFIED = 0; + */ + const STYLE_UNSPECIFIED = 0; + /** + * This resource is intended to be "declarative-friendly". + * Declarative-friendly resources must be more strictly consistent, and + * setting this to true communicates to tools that this resource should + * adhere to declarative-friendly expectations. + * Note: This is used by the API linter (linter.aip.dev) to enable + * additional checks. + * + * Generated from protobuf enum DECLARATIVE_FRIENDLY = 1; + */ + const DECLARATIVE_FRIENDLY = 1; + + private static $valueToName = [ + self::STYLE_UNSPECIFIED => 'STYLE_UNSPECIFIED', + self::DECLARATIVE_FRIENDLY => 'DECLARATIVE_FRIENDLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Api/ResourceReference.php b/vendor/google/common-protos/src/Api/ResourceReference.php new file mode 100644 index 0000000..c4c282d --- /dev/null +++ b/vendor/google/common-protos/src/Api/ResourceReference.php @@ -0,0 +1,190 @@ +google.api.ResourceReference + */ +class ResourceReference extends \Google\Protobuf\Internal\Message +{ + /** + * The resource type that the annotated field references. + * Example: + * message Subscription { + * string topic = 2 [(google.api.resource_reference) = { + * type: "pubsub.googleapis.com/Topic" + * }]; + * } + * Occasionally, a field may reference an arbitrary resource. In this case, + * APIs use the special value * in their resource reference. + * Example: + * message GetIamPolicyRequest { + * string resource = 2 [(google.api.resource_reference) = { + * type: "*" + * }]; + * } + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The resource type of a child collection that the annotated field + * references. This is useful for annotating the `parent` field that + * doesn't have a fixed resource type. + * Example: + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } + * + * Generated from protobuf field string child_type = 2; + */ + protected $child_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The resource type that the annotated field references. + * Example: + * message Subscription { + * string topic = 2 [(google.api.resource_reference) = { + * type: "pubsub.googleapis.com/Topic" + * }]; + * } + * Occasionally, a field may reference an arbitrary resource. In this case, + * APIs use the special value * in their resource reference. + * Example: + * message GetIamPolicyRequest { + * string resource = 2 [(google.api.resource_reference) = { + * type: "*" + * }]; + * } + * @type string $child_type + * The resource type of a child collection that the annotated field + * references. This is useful for annotating the `parent` field that + * doesn't have a fixed resource type. + * Example: + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Resource::initOnce(); + parent::__construct($data); + } + + /** + * The resource type that the annotated field references. + * Example: + * message Subscription { + * string topic = 2 [(google.api.resource_reference) = { + * type: "pubsub.googleapis.com/Topic" + * }]; + * } + * Occasionally, a field may reference an arbitrary resource. In this case, + * APIs use the special value * in their resource reference. + * Example: + * message GetIamPolicyRequest { + * string resource = 2 [(google.api.resource_reference) = { + * type: "*" + * }]; + * } + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The resource type that the annotated field references. + * Example: + * message Subscription { + * string topic = 2 [(google.api.resource_reference) = { + * type: "pubsub.googleapis.com/Topic" + * }]; + * } + * Occasionally, a field may reference an arbitrary resource. In this case, + * APIs use the special value * in their resource reference. + * Example: + * message GetIamPolicyRequest { + * string resource = 2 [(google.api.resource_reference) = { + * type: "*" + * }]; + * } + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The resource type of a child collection that the annotated field + * references. This is useful for annotating the `parent` field that + * doesn't have a fixed resource type. + * Example: + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } + * + * Generated from protobuf field string child_type = 2; + * @return string + */ + public function getChildType() + { + return $this->child_type; + } + + /** + * The resource type of a child collection that the annotated field + * references. This is useful for annotating the `parent` field that + * doesn't have a fixed resource type. + * Example: + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } + * + * Generated from protobuf field string child_type = 2; + * @param string $var + * @return $this + */ + public function setChildType($var) + { + GPBUtil::checkString($var, True); + $this->child_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/RoutingParameter.php b/vendor/google/common-protos/src/Api/RoutingParameter.php new file mode 100644 index 0000000..1b32a8f --- /dev/null +++ b/vendor/google/common-protos/src/Api/RoutingParameter.php @@ -0,0 +1,281 @@ +google.api.RoutingParameter + */ +class RoutingParameter extends \Google\Protobuf\Internal\Message +{ + /** + * A request field to extract the header key-value pair from. + * + * Generated from protobuf field string field = 1; + */ + protected $field = ''; + /** + * A pattern matching the key-value field. Optional. + * If not specified, the whole field specified in the `field` field will be + * taken as value, and its name used as key. If specified, it MUST contain + * exactly one named segment (along with any number of unnamed segments) The + * pattern will be matched over the field specified in the `field` field, then + * if the match is successful: + * - the name of the single named segment will be used as a header name, + * - the match value of the segment will be used as a header value; + * if the match is NOT successful, nothing will be sent. + * Example: + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * When looking at this specific example, we can see that: + * - A key-value pair with the key `table_location` + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. + * - The value is extracted from the request message's `table_name` field + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * **NB:** If the `path_template` field is not provided, the key name is + * equal to the field name, and the whole field should be sent as a value. + * This makes the pattern for the field and the value functionally equivalent + * to `**`, and the configuration + * { + * field: "table_name" + * } + * is a functionally equivalent shorthand to: + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * See Example 1 for more details. + * + * Generated from protobuf field string path_template = 2; + */ + protected $path_template = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field + * A request field to extract the header key-value pair from. + * @type string $path_template + * A pattern matching the key-value field. Optional. + * If not specified, the whole field specified in the `field` field will be + * taken as value, and its name used as key. If specified, it MUST contain + * exactly one named segment (along with any number of unnamed segments) The + * pattern will be matched over the field specified in the `field` field, then + * if the match is successful: + * - the name of the single named segment will be used as a header name, + * - the match value of the segment will be used as a header value; + * if the match is NOT successful, nothing will be sent. + * Example: + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * When looking at this specific example, we can see that: + * - A key-value pair with the key `table_location` + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. + * - The value is extracted from the request message's `table_name` field + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * **NB:** If the `path_template` field is not provided, the key name is + * equal to the field name, and the whole field should be sent as a value. + * This makes the pattern for the field and the value functionally equivalent + * to `**`, and the configuration + * { + * field: "table_name" + * } + * is a functionally equivalent shorthand to: + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * See Example 1 for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Routing::initOnce(); + parent::__construct($data); + } + + /** + * A request field to extract the header key-value pair from. + * + * Generated from protobuf field string field = 1; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * A request field to extract the header key-value pair from. + * + * Generated from protobuf field string field = 1; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * A pattern matching the key-value field. Optional. + * If not specified, the whole field specified in the `field` field will be + * taken as value, and its name used as key. If specified, it MUST contain + * exactly one named segment (along with any number of unnamed segments) The + * pattern will be matched over the field specified in the `field` field, then + * if the match is successful: + * - the name of the single named segment will be used as a header name, + * - the match value of the segment will be used as a header value; + * if the match is NOT successful, nothing will be sent. + * Example: + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * When looking at this specific example, we can see that: + * - A key-value pair with the key `table_location` + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. + * - The value is extracted from the request message's `table_name` field + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * **NB:** If the `path_template` field is not provided, the key name is + * equal to the field name, and the whole field should be sent as a value. + * This makes the pattern for the field and the value functionally equivalent + * to `**`, and the configuration + * { + * field: "table_name" + * } + * is a functionally equivalent shorthand to: + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * See Example 1 for more details. + * + * Generated from protobuf field string path_template = 2; + * @return string + */ + public function getPathTemplate() + { + return $this->path_template; + } + + /** + * A pattern matching the key-value field. Optional. + * If not specified, the whole field specified in the `field` field will be + * taken as value, and its name used as key. If specified, it MUST contain + * exactly one named segment (along with any number of unnamed segments) The + * pattern will be matched over the field specified in the `field` field, then + * if the match is successful: + * - the name of the single named segment will be used as a header name, + * - the match value of the segment will be used as a header value; + * if the match is NOT successful, nothing will be sent. + * Example: + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * When looking at this specific example, we can see that: + * - A key-value pair with the key `table_location` + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. + * - The value is extracted from the request message's `table_name` field + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * **NB:** If the `path_template` field is not provided, the key name is + * equal to the field name, and the whole field should be sent as a value. + * This makes the pattern for the field and the value functionally equivalent + * to `**`, and the configuration + * { + * field: "table_name" + * } + * is a functionally equivalent shorthand to: + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * See Example 1 for more details. + * + * Generated from protobuf field string path_template = 2; + * @param string $var + * @return $this + */ + public function setPathTemplate($var) + { + GPBUtil::checkString($var, True); + $this->path_template = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/RoutingRule.php b/vendor/google/common-protos/src/Api/RoutingRule.php new file mode 100644 index 0000000..b5dab18 --- /dev/null +++ b/vendor/google/common-protos/src/Api/RoutingRule.php @@ -0,0 +1,353 @@ +/tables/` + * // - `projects//instances//tables/
` + * // - `region//zones//tables/
` + * string table_name = 1; + * // This value specifies routing for replication. + * // It can be in the following formats: + * // - `profiles/` + * // - a legacy `profile_id` that can be any string + * string app_profile_id = 2; + * } + * Example message: + * { + * table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + * app_profile_id: profiles/prof_qux + * } + * The routing header consists of one or multiple key-value pairs. Every key + * and value must be percent-encoded, and joined together in the format of + * `key1=value1&key2=value2`. + * The examples below skip the percent-encoding for readability. + * Example 1 + * Extracting a field from the request to put into the routing header + * unchanged, with the key equal to the field name. + * annotation: + * option (google.api.routing) = { + * // Take the `app_profile_id`. + * routing_parameters { + * field: "app_profile_id" + * } + * }; + * result: + * x-goog-request-params: app_profile_id=profiles/prof_qux + * Example 2 + * Extracting a field from the request to put into the routing header + * unchanged, with the key different from the field name. + * annotation: + * option (google.api.routing) = { + * // Take the `app_profile_id`, but name it `routing_id` in the header. + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * result: + * x-goog-request-params: routing_id=profiles/prof_qux + * Example 3 + * Extracting a field from the request to put into the routing + * header, while matching a path template syntax on the field's value. + * NB: it is more useful to send nothing than to send garbage for the purpose + * of dynamic routing, since garbage pollutes cache. Thus the matching. + * Sub-example 3a + * The field matches the template. + * annotation: + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with project-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * result: + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * Sub-example 3b + * The field does not match the template. + * annotation: + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with region-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * }; + * result: + * + * Sub-example 3c + * Multiple alternative conflictingly named path templates are + * specified. The one that matches is used to construct the header. + * annotation: + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed, whether + * // using the region- or projects-based syntax. + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * result: + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * Example 4 + * Extracting a single routing header key-value pair by matching a + * template syntax on (a part of) a single request field. + * annotation: + * option (google.api.routing) = { + * // Take just the project id from the `table_name` field. + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * }; + * result: + * x-goog-request-params: routing_id=projects/proj_foo + * Example 5 + * Extracting a single routing header key-value pair by matching + * several conflictingly named path templates on (parts of) a single request + * field. The last template to match "wins" the conflict. + * annotation: + * option (google.api.routing) = { + * // If the `table_name` does not have instances information, + * // take just the project id for routing. + * // Otherwise take project + instance. + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*/instances/*}/**" + * } + * }; + * result: + * x-goog-request-params: + * routing_id=projects/proj_foo/instances/instance_bar + * Example 6 + * Extracting multiple routing header key-value pairs by matching + * several non-conflicting path templates on (parts of) a single request field. + * Sub-example 6a + * Make the templates strict, so that if the `table_name` does not + * have an instance information, nothing is sent. + * annotation: + * option (google.api.routing) = { + * // The routing code needs two keys instead of one composite + * // but works only for the tables with the "project-instance" name + * // syntax. + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/instances/*/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * result: + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * Sub-example 6b + * Make the templates loose, so that if the `table_name` does not + * have an instance information, just the project id part is sent. + * annotation: + * option (google.api.routing) = { + * // The routing code wants two keys instead of one composite + * // but will work with just the `project_id` for tables without + * // an instance in the `table_name`. + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * result (is the same as 6a for our example message because it has the instance + * information): + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * Example 7 + * Extracting multiple routing header key-value pairs by matching + * several path templates on multiple request fields. + * NB: note that here there is no way to specify sending nothing if one of the + * fields does not match its template. E.g. if the `table_name` is in the wrong + * format, the `project_id` will not be sent, but the `routing_id` will be. + * The backend routing code has to be aware of that and be prepared to not + * receive a full complement of keys if it expects multiple. + * annotation: + * option (google.api.routing) = { + * // The routing needs both `project_id` and `routing_id` + * // (from the `app_profile_id` field) for routing. + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * result: + * x-goog-request-params: + * project_id=projects/proj_foo&routing_id=profiles/prof_qux + * Example 8 + * Extracting a single routing header key-value pair by matching + * several conflictingly named path templates on several request fields. The + * last template to match "wins" the conflict. + * annotation: + * option (google.api.routing) = { + * // The `routing_id` can be a project id or a region id depending on + * // the table name format, but only if the `app_profile_id` is not set. + * // If `app_profile_id` is set it should be used instead. + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=regions/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * result: + * x-goog-request-params: routing_id=profiles/prof_qux + * Example 9 + * Bringing it all together. + * annotation: + * option (google.api.routing) = { + * // For routing both `table_location` and a `routing_id` are needed. + * // + * // table_location can be either an instance id or a region+zone id. + * // + * // For `routing_id`, take the value of `app_profile_id` + * // - If it's in the format `profiles/`, send + * // just the `` part. + * // - If it's any other literal, send it as is. + * // If the `app_profile_id` is empty, and the `table_name` starts with + * // the project_id, send that instead. + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_location=regions/*/zones/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "profiles/{routing_id=*}" + * } + * }; + * result: + * x-goog-request-params: + * table_location=instances/instance_bar&routing_id=prof_qux + * + * Generated from protobuf message google.api.RoutingRule + */ +class RoutingRule extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of Routing Parameter specifications. + * **NOTE:** If multiple Routing Parameters describe the same key + * (via the `path_template` field or via the `field` field when + * `path_template` is not provided), "last one wins" rule + * determines which Parameter gets used. + * See the examples for more details. + * + * Generated from protobuf field repeated .google.api.RoutingParameter routing_parameters = 2; + */ + private $routing_parameters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\RoutingParameter>|\Google\Protobuf\Internal\RepeatedField $routing_parameters + * A collection of Routing Parameter specifications. + * **NOTE:** If multiple Routing Parameters describe the same key + * (via the `path_template` field or via the `field` field when + * `path_template` is not provided), "last one wins" rule + * determines which Parameter gets used. + * See the examples for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Routing::initOnce(); + parent::__construct($data); + } + + /** + * A collection of Routing Parameter specifications. + * **NOTE:** If multiple Routing Parameters describe the same key + * (via the `path_template` field or via the `field` field when + * `path_template` is not provided), "last one wins" rule + * determines which Parameter gets used. + * See the examples for more details. + * + * Generated from protobuf field repeated .google.api.RoutingParameter routing_parameters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutingParameters() + { + return $this->routing_parameters; + } + + /** + * A collection of Routing Parameter specifications. + * **NOTE:** If multiple Routing Parameters describe the same key + * (via the `path_template` field or via the `field` field when + * `path_template` is not provided), "last one wins" rule + * determines which Parameter gets used. + * See the examples for more details. + * + * Generated from protobuf field repeated .google.api.RoutingParameter routing_parameters = 2; + * @param array<\Google\Api\RoutingParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutingParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\RoutingParameter::class); + $this->routing_parameters = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/RubySettings.php b/vendor/google/common-protos/src/Api/RubySettings.php new file mode 100644 index 0000000..2ca343c --- /dev/null +++ b/vendor/google/common-protos/src/Api/RubySettings.php @@ -0,0 +1,77 @@ +google.api.RubySettings + */ +class RubySettings extends \Google\Protobuf\Internal\Message +{ + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + */ + protected $common = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\CommonLanguageSettings $common + * Some settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @return \Google\Api\CommonLanguageSettings|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Some settings. + * + * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; + * @param \Google\Api\CommonLanguageSettings $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Api\CommonLanguageSettings::class); + $this->common = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php b/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php new file mode 100644 index 0000000..c6ababa --- /dev/null +++ b/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php @@ -0,0 +1,126 @@ +google.api.SelectiveGapicGeneration + */ +class SelectiveGapicGeneration extends \Google\Protobuf\Internal\Message +{ + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + */ + private $methods; + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + */ + protected $generate_omitted_as_internal = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $methods + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * @type bool $generate_omitted_as_internal + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethods() + { + return $this->methods; + } + + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->methods = $arr; + + return $this; + } + + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + * @return bool + */ + public function getGenerateOmittedAsInternal() + { + return $this->generate_omitted_as_internal; + } + + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + * @param bool $var + * @return $this + */ + public function setGenerateOmittedAsInternal($var) + { + GPBUtil::checkBool($var); + $this->generate_omitted_as_internal = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Service.php b/vendor/google/common-protos/src/Api/Service.php new file mode 100644 index 0000000..c7ec18e --- /dev/null +++ b/vendor/google/common-protos/src/Api/Service.php @@ -0,0 +1,1246 @@ +google.api.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * The service name, which is a DNS-like logical identifier for the + * service, such as `calendar.googleapis.com`. The service name + * typically goes through DNS verification to make sure the owner + * of the service also owns the DNS name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The product title for this service, it is the name displayed in Google + * Cloud Console. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * The Google project that owns this service. + * + * Generated from protobuf field string producer_project_id = 22; + */ + protected $producer_project_id = ''; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. Must be no longer than 63 characters + * and only lower case letters, digits, '.', '_' and '-' are allowed. If + * empty, the server may choose to generate one instead. + * + * Generated from protobuf field string id = 33; + */ + protected $id = ''; + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by + * the configuration author, as the remaining fields will be derived from the + * IDL during the normalization process. It is an error to specify an API + * interface here which cannot be resolved against the associated IDL files. + * + * Generated from protobuf field repeated .google.protobuf.Api apis = 3; + */ + private $apis; + /** + * A list of all proto message types included in this API service. + * Types referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such as + * types used by the `google.protobuf.Any` type, should be listed here by + * name by the configuration author. Example: + * types: + * - name: google.protobuf.Int32 + * + * Generated from protobuf field repeated .google.protobuf.Type types = 4; + */ + private $types; + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name by the configuration author. Example: + * enums: + * - name: google.someapi.v1.SomeEnum + * + * Generated from protobuf field repeated .google.protobuf.Enum enums = 5; + */ + private $enums; + /** + * Additional API documentation. + * + * Generated from protobuf field .google.api.Documentation documentation = 6; + */ + protected $documentation = null; + /** + * API backend configuration. + * + * Generated from protobuf field .google.api.Backend backend = 8; + */ + protected $backend = null; + /** + * HTTP configuration. + * + * Generated from protobuf field .google.api.Http http = 9; + */ + protected $http = null; + /** + * Quota configuration. + * + * Generated from protobuf field .google.api.Quota quota = 10; + */ + protected $quota = null; + /** + * Auth configuration. + * + * Generated from protobuf field .google.api.Authentication authentication = 11; + */ + protected $authentication = null; + /** + * Context configuration. + * + * Generated from protobuf field .google.api.Context context = 12; + */ + protected $context = null; + /** + * Configuration controlling usage of this service. + * + * Generated from protobuf field .google.api.Usage usage = 15; + */ + protected $usage = null; + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service all + * defined APIs. + * + * Generated from protobuf field repeated .google.api.Endpoint endpoints = 18; + */ + private $endpoints; + /** + * Configuration for the service control plane. + * + * Generated from protobuf field .google.api.Control control = 21; + */ + protected $control = null; + /** + * Defines the logs used by this service. + * + * Generated from protobuf field repeated .google.api.LogDescriptor logs = 23; + */ + private $logs; + /** + * Defines the metrics used by this service. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24; + */ + private $metrics; + /** + * Defines the monitored resources used by this service. This is required + * by the [Service.monitoring][google.api.Service.monitoring] and + * [Service.logging][google.api.Service.logging] configurations. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; + */ + private $monitored_resources; + /** + * Billing configuration. + * + * Generated from protobuf field .google.api.Billing billing = 26; + */ + protected $billing = null; + /** + * Logging configuration. + * + * Generated from protobuf field .google.api.Logging logging = 27; + */ + protected $logging = null; + /** + * Monitoring configuration. + * + * Generated from protobuf field .google.api.Monitoring monitoring = 28; + */ + protected $monitoring = null; + /** + * System parameter configuration. + * + * Generated from protobuf field .google.api.SystemParameters system_parameters = 29; + */ + protected $system_parameters = null; + /** + * Output only. The source information for this configuration if available. + * + * Generated from protobuf field .google.api.SourceInfo source_info = 37; + */ + protected $source_info = null; + /** + * Settings for [Google Cloud Client + * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + * generated from APIs defined as protocol buffers. + * + * Generated from protobuf field .google.api.Publishing publishing = 45; + */ + protected $publishing = null; + /** + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * + * Generated from protobuf field .google.protobuf.UInt32Value config_version = 20; + */ + protected $config_version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The service name, which is a DNS-like logical identifier for the + * service, such as `calendar.googleapis.com`. The service name + * typically goes through DNS verification to make sure the owner + * of the service also owns the DNS name. + * @type string $title + * The product title for this service, it is the name displayed in Google + * Cloud Console. + * @type string $producer_project_id + * The Google project that owns this service. + * @type string $id + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. Must be no longer than 63 characters + * and only lower case letters, digits, '.', '_' and '-' are allowed. If + * empty, the server may choose to generate one instead. + * @type array<\Google\Protobuf\Api>|\Google\Protobuf\Internal\RepeatedField $apis + * A list of API interfaces exported by this service. Only the `name` field + * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by + * the configuration author, as the remaining fields will be derived from the + * IDL during the normalization process. It is an error to specify an API + * interface here which cannot be resolved against the associated IDL files. + * @type array<\Google\Protobuf\Type>|\Google\Protobuf\Internal\RepeatedField $types + * A list of all proto message types included in this API service. + * Types referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such as + * types used by the `google.protobuf.Any` type, should be listed here by + * name by the configuration author. Example: + * types: + * - name: google.protobuf.Int32 + * @type array<\Google\Protobuf\Enum>|\Google\Protobuf\Internal\RepeatedField $enums + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name by the configuration author. Example: + * enums: + * - name: google.someapi.v1.SomeEnum + * @type \Google\Api\Documentation $documentation + * Additional API documentation. + * @type \Google\Api\Backend $backend + * API backend configuration. + * @type \Google\Api\Http $http + * HTTP configuration. + * @type \Google\Api\Quota $quota + * Quota configuration. + * @type \Google\Api\Authentication $authentication + * Auth configuration. + * @type \Google\Api\Context $context + * Context configuration. + * @type \Google\Api\Usage $usage + * Configuration controlling usage of this service. + * @type array<\Google\Api\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service all + * defined APIs. + * @type \Google\Api\Control $control + * Configuration for the service control plane. + * @type array<\Google\Api\LogDescriptor>|\Google\Protobuf\Internal\RepeatedField $logs + * Defines the logs used by this service. + * @type array<\Google\Api\MetricDescriptor>|\Google\Protobuf\Internal\RepeatedField $metrics + * Defines the metrics used by this service. + * @type array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $monitored_resources + * Defines the monitored resources used by this service. This is required + * by the [Service.monitoring][google.api.Service.monitoring] and + * [Service.logging][google.api.Service.logging] configurations. + * @type \Google\Api\Billing $billing + * Billing configuration. + * @type \Google\Api\Logging $logging + * Logging configuration. + * @type \Google\Api\Monitoring $monitoring + * Monitoring configuration. + * @type \Google\Api\SystemParameters $system_parameters + * System parameter configuration. + * @type \Google\Api\SourceInfo $source_info + * Output only. The source information for this configuration if available. + * @type \Google\Api\Publishing $publishing + * Settings for [Google Cloud Client + * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + * generated from APIs defined as protocol buffers. + * @type \Google\Protobuf\UInt32Value $config_version + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * The service name, which is a DNS-like logical identifier for the + * service, such as `calendar.googleapis.com`. The service name + * typically goes through DNS verification to make sure the owner + * of the service also owns the DNS name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The service name, which is a DNS-like logical identifier for the + * service, such as `calendar.googleapis.com`. The service name + * typically goes through DNS verification to make sure the owner + * of the service also owns the DNS name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The product title for this service, it is the name displayed in Google + * Cloud Console. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The product title for this service, it is the name displayed in Google + * Cloud Console. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The Google project that owns this service. + * + * Generated from protobuf field string producer_project_id = 22; + * @return string + */ + public function getProducerProjectId() + { + return $this->producer_project_id; + } + + /** + * The Google project that owns this service. + * + * Generated from protobuf field string producer_project_id = 22; + * @param string $var + * @return $this + */ + public function setProducerProjectId($var) + { + GPBUtil::checkString($var, True); + $this->producer_project_id = $var; + + return $this; + } + + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. Must be no longer than 63 characters + * and only lower case letters, digits, '.', '_' and '-' are allowed. If + * empty, the server may choose to generate one instead. + * + * Generated from protobuf field string id = 33; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. Must be no longer than 63 characters + * and only lower case letters, digits, '.', '_' and '-' are allowed. If + * empty, the server may choose to generate one instead. + * + * Generated from protobuf field string id = 33; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by + * the configuration author, as the remaining fields will be derived from the + * IDL during the normalization process. It is an error to specify an API + * interface here which cannot be resolved against the associated IDL files. + * + * Generated from protobuf field repeated .google.protobuf.Api apis = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApis() + { + return $this->apis; + } + + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by + * the configuration author, as the remaining fields will be derived from the + * IDL during the normalization process. It is an error to specify an API + * interface here which cannot be resolved against the associated IDL files. + * + * Generated from protobuf field repeated .google.protobuf.Api apis = 3; + * @param array<\Google\Protobuf\Api>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApis($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Api::class); + $this->apis = $arr; + + return $this; + } + + /** + * A list of all proto message types included in this API service. + * Types referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such as + * types used by the `google.protobuf.Any` type, should be listed here by + * name by the configuration author. Example: + * types: + * - name: google.protobuf.Int32 + * + * Generated from protobuf field repeated .google.protobuf.Type types = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * A list of all proto message types included in this API service. + * Types referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such as + * types used by the `google.protobuf.Any` type, should be listed here by + * name by the configuration author. Example: + * types: + * - name: google.protobuf.Int32 + * + * Generated from protobuf field repeated .google.protobuf.Type types = 4; + * @param array<\Google\Protobuf\Type>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Type::class); + $this->types = $arr; + + return $this; + } + + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name by the configuration author. Example: + * enums: + * - name: google.someapi.v1.SomeEnum + * + * Generated from protobuf field repeated .google.protobuf.Enum enums = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnums() + { + return $this->enums; + } + + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name by the configuration author. Example: + * enums: + * - name: google.someapi.v1.SomeEnum + * + * Generated from protobuf field repeated .google.protobuf.Enum enums = 5; + * @param array<\Google\Protobuf\Enum>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnums($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Enum::class); + $this->enums = $arr; + + return $this; + } + + /** + * Additional API documentation. + * + * Generated from protobuf field .google.api.Documentation documentation = 6; + * @return \Google\Api\Documentation|null + */ + public function getDocumentation() + { + return $this->documentation; + } + + public function hasDocumentation() + { + return isset($this->documentation); + } + + public function clearDocumentation() + { + unset($this->documentation); + } + + /** + * Additional API documentation. + * + * Generated from protobuf field .google.api.Documentation documentation = 6; + * @param \Google\Api\Documentation $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkMessage($var, \Google\Api\Documentation::class); + $this->documentation = $var; + + return $this; + } + + /** + * API backend configuration. + * + * Generated from protobuf field .google.api.Backend backend = 8; + * @return \Google\Api\Backend|null + */ + public function getBackend() + { + return $this->backend; + } + + public function hasBackend() + { + return isset($this->backend); + } + + public function clearBackend() + { + unset($this->backend); + } + + /** + * API backend configuration. + * + * Generated from protobuf field .google.api.Backend backend = 8; + * @param \Google\Api\Backend $var + * @return $this + */ + public function setBackend($var) + { + GPBUtil::checkMessage($var, \Google\Api\Backend::class); + $this->backend = $var; + + return $this; + } + + /** + * HTTP configuration. + * + * Generated from protobuf field .google.api.Http http = 9; + * @return \Google\Api\Http|null + */ + public function getHttp() + { + return $this->http; + } + + public function hasHttp() + { + return isset($this->http); + } + + public function clearHttp() + { + unset($this->http); + } + + /** + * HTTP configuration. + * + * Generated from protobuf field .google.api.Http http = 9; + * @param \Google\Api\Http $var + * @return $this + */ + public function setHttp($var) + { + GPBUtil::checkMessage($var, \Google\Api\Http::class); + $this->http = $var; + + return $this; + } + + /** + * Quota configuration. + * + * Generated from protobuf field .google.api.Quota quota = 10; + * @return \Google\Api\Quota|null + */ + public function getQuota() + { + return $this->quota; + } + + public function hasQuota() + { + return isset($this->quota); + } + + public function clearQuota() + { + unset($this->quota); + } + + /** + * Quota configuration. + * + * Generated from protobuf field .google.api.Quota quota = 10; + * @param \Google\Api\Quota $var + * @return $this + */ + public function setQuota($var) + { + GPBUtil::checkMessage($var, \Google\Api\Quota::class); + $this->quota = $var; + + return $this; + } + + /** + * Auth configuration. + * + * Generated from protobuf field .google.api.Authentication authentication = 11; + * @return \Google\Api\Authentication|null + */ + public function getAuthentication() + { + return $this->authentication; + } + + public function hasAuthentication() + { + return isset($this->authentication); + } + + public function clearAuthentication() + { + unset($this->authentication); + } + + /** + * Auth configuration. + * + * Generated from protobuf field .google.api.Authentication authentication = 11; + * @param \Google\Api\Authentication $var + * @return $this + */ + public function setAuthentication($var) + { + GPBUtil::checkMessage($var, \Google\Api\Authentication::class); + $this->authentication = $var; + + return $this; + } + + /** + * Context configuration. + * + * Generated from protobuf field .google.api.Context context = 12; + * @return \Google\Api\Context|null + */ + public function getContext() + { + return $this->context; + } + + public function hasContext() + { + return isset($this->context); + } + + public function clearContext() + { + unset($this->context); + } + + /** + * Context configuration. + * + * Generated from protobuf field .google.api.Context context = 12; + * @param \Google\Api\Context $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Api\Context::class); + $this->context = $var; + + return $this; + } + + /** + * Configuration controlling usage of this service. + * + * Generated from protobuf field .google.api.Usage usage = 15; + * @return \Google\Api\Usage|null + */ + public function getUsage() + { + return $this->usage; + } + + public function hasUsage() + { + return isset($this->usage); + } + + public function clearUsage() + { + unset($this->usage); + } + + /** + * Configuration controlling usage of this service. + * + * Generated from protobuf field .google.api.Usage usage = 15; + * @param \Google\Api\Usage $var + * @return $this + */ + public function setUsage($var) + { + GPBUtil::checkMessage($var, \Google\Api\Usage::class); + $this->usage = $var; + + return $this; + } + + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service all + * defined APIs. + * + * Generated from protobuf field repeated .google.api.Endpoint endpoints = 18; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service all + * defined APIs. + * + * Generated from protobuf field repeated .google.api.Endpoint endpoints = 18; + * @param array<\Google\Api\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\Endpoint::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Configuration for the service control plane. + * + * Generated from protobuf field .google.api.Control control = 21; + * @return \Google\Api\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Configuration for the service control plane. + * + * Generated from protobuf field .google.api.Control control = 21; + * @param \Google\Api\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Api\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Defines the logs used by this service. + * + * Generated from protobuf field repeated .google.api.LogDescriptor logs = 23; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogs() + { + return $this->logs; + } + + /** + * Defines the logs used by this service. + * + * Generated from protobuf field repeated .google.api.LogDescriptor logs = 23; + * @param array<\Google\Api\LogDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LogDescriptor::class); + $this->logs = $arr; + + return $this; + } + + /** + * Defines the metrics used by this service. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * Defines the metrics used by this service. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24; + * @param array<\Google\Api\MetricDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MetricDescriptor::class); + $this->metrics = $arr; + + return $this; + } + + /** + * Defines the monitored resources used by this service. This is required + * by the [Service.monitoring][google.api.Service.monitoring] and + * [Service.logging][google.api.Service.logging] configurations. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMonitoredResources() + { + return $this->monitored_resources; + } + + /** + * Defines the monitored resources used by this service. This is required + * by the [Service.monitoring][google.api.Service.monitoring] and + * [Service.logging][google.api.Service.logging] configurations. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; + * @param array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMonitoredResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); + $this->monitored_resources = $arr; + + return $this; + } + + /** + * Billing configuration. + * + * Generated from protobuf field .google.api.Billing billing = 26; + * @return \Google\Api\Billing|null + */ + public function getBilling() + { + return $this->billing; + } + + public function hasBilling() + { + return isset($this->billing); + } + + public function clearBilling() + { + unset($this->billing); + } + + /** + * Billing configuration. + * + * Generated from protobuf field .google.api.Billing billing = 26; + * @param \Google\Api\Billing $var + * @return $this + */ + public function setBilling($var) + { + GPBUtil::checkMessage($var, \Google\Api\Billing::class); + $this->billing = $var; + + return $this; + } + + /** + * Logging configuration. + * + * Generated from protobuf field .google.api.Logging logging = 27; + * @return \Google\Api\Logging|null + */ + public function getLogging() + { + return $this->logging; + } + + public function hasLogging() + { + return isset($this->logging); + } + + public function clearLogging() + { + unset($this->logging); + } + + /** + * Logging configuration. + * + * Generated from protobuf field .google.api.Logging logging = 27; + * @param \Google\Api\Logging $var + * @return $this + */ + public function setLogging($var) + { + GPBUtil::checkMessage($var, \Google\Api\Logging::class); + $this->logging = $var; + + return $this; + } + + /** + * Monitoring configuration. + * + * Generated from protobuf field .google.api.Monitoring monitoring = 28; + * @return \Google\Api\Monitoring|null + */ + public function getMonitoring() + { + return $this->monitoring; + } + + public function hasMonitoring() + { + return isset($this->monitoring); + } + + public function clearMonitoring() + { + unset($this->monitoring); + } + + /** + * Monitoring configuration. + * + * Generated from protobuf field .google.api.Monitoring monitoring = 28; + * @param \Google\Api\Monitoring $var + * @return $this + */ + public function setMonitoring($var) + { + GPBUtil::checkMessage($var, \Google\Api\Monitoring::class); + $this->monitoring = $var; + + return $this; + } + + /** + * System parameter configuration. + * + * Generated from protobuf field .google.api.SystemParameters system_parameters = 29; + * @return \Google\Api\SystemParameters|null + */ + public function getSystemParameters() + { + return $this->system_parameters; + } + + public function hasSystemParameters() + { + return isset($this->system_parameters); + } + + public function clearSystemParameters() + { + unset($this->system_parameters); + } + + /** + * System parameter configuration. + * + * Generated from protobuf field .google.api.SystemParameters system_parameters = 29; + * @param \Google\Api\SystemParameters $var + * @return $this + */ + public function setSystemParameters($var) + { + GPBUtil::checkMessage($var, \Google\Api\SystemParameters::class); + $this->system_parameters = $var; + + return $this; + } + + /** + * Output only. The source information for this configuration if available. + * + * Generated from protobuf field .google.api.SourceInfo source_info = 37; + * @return \Google\Api\SourceInfo|null + */ + public function getSourceInfo() + { + return $this->source_info; + } + + public function hasSourceInfo() + { + return isset($this->source_info); + } + + public function clearSourceInfo() + { + unset($this->source_info); + } + + /** + * Output only. The source information for this configuration if available. + * + * Generated from protobuf field .google.api.SourceInfo source_info = 37; + * @param \Google\Api\SourceInfo $var + * @return $this + */ + public function setSourceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Api\SourceInfo::class); + $this->source_info = $var; + + return $this; + } + + /** + * Settings for [Google Cloud Client + * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + * generated from APIs defined as protocol buffers. + * + * Generated from protobuf field .google.api.Publishing publishing = 45; + * @return \Google\Api\Publishing|null + */ + public function getPublishing() + { + return $this->publishing; + } + + public function hasPublishing() + { + return isset($this->publishing); + } + + public function clearPublishing() + { + unset($this->publishing); + } + + /** + * Settings for [Google Cloud Client + * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + * generated from APIs defined as protocol buffers. + * + * Generated from protobuf field .google.api.Publishing publishing = 45; + * @param \Google\Api\Publishing $var + * @return $this + */ + public function setPublishing($var) + { + GPBUtil::checkMessage($var, \Google\Api\Publishing::class); + $this->publishing = $var; + + return $this; + } + + /** + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * + * Generated from protobuf field .google.protobuf.UInt32Value config_version = 20; + * @return \Google\Protobuf\UInt32Value|null + */ + public function getConfigVersion() + { + return $this->config_version; + } + + public function hasConfigVersion() + { + return isset($this->config_version); + } + + public function clearConfigVersion() + { + unset($this->config_version); + } + + /** + * Returns the unboxed value from getConfigVersion() + + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * + * Generated from protobuf field .google.protobuf.UInt32Value config_version = 20; + * @return int|null + */ + public function getConfigVersionUnwrapped() + { + return $this->readWrapperValue("config_version"); + } + + /** + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * + * Generated from protobuf field .google.protobuf.UInt32Value config_version = 20; + * @param \Google\Protobuf\UInt32Value $var + * @return $this + */ + public function setConfigVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\UInt32Value::class); + $this->config_version = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\UInt32Value object. + + * Obsolete. Do not use. + * This field has no semantic meaning. The service config compiler always + * sets this field to `3`. + * + * Generated from protobuf field .google.protobuf.UInt32Value config_version = 20; + * @param int|null $var + * @return $this + */ + public function setConfigVersionUnwrapped($var) + { + $this->writeWrapperValue("config_version", $var); + return $this;} + +} + diff --git a/vendor/google/common-protos/src/Api/SourceInfo.php b/vendor/google/common-protos/src/Api/SourceInfo.php new file mode 100644 index 0000000..503f317 --- /dev/null +++ b/vendor/google/common-protos/src/Api/SourceInfo.php @@ -0,0 +1,67 @@ +google.api.SourceInfo + */ +class SourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * All files used during config generation. + * + * Generated from protobuf field repeated .google.protobuf.Any source_files = 1; + */ + private $source_files; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $source_files + * All files used during config generation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\SourceInfo::initOnce(); + parent::__construct($data); + } + + /** + * All files used during config generation. + * + * Generated from protobuf field repeated .google.protobuf.Any source_files = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceFiles() + { + return $this->source_files; + } + + /** + * All files used during config generation. + * + * Generated from protobuf field repeated .google.protobuf.Any source_files = 1; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceFiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->source_files = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/SystemParameter.php b/vendor/google/common-protos/src/Api/SystemParameter.php new file mode 100644 index 0000000..e6828a2 --- /dev/null +++ b/vendor/google/common-protos/src/Api/SystemParameter.php @@ -0,0 +1,145 @@ +google.api.SystemParameter + */ +class SystemParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Define the name of the parameter, such as "api_key" . It is case sensitive. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + * + * Generated from protobuf field string http_header = 2; + */ + protected $http_header = ''; + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + * + * Generated from protobuf field string url_query_parameter = 3; + */ + protected $url_query_parameter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Define the name of the parameter, such as "api_key" . It is case sensitive. + * @type string $http_header + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + * @type string $url_query_parameter + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\SystemParameter::initOnce(); + parent::__construct($data); + } + + /** + * Define the name of the parameter, such as "api_key" . It is case sensitive. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Define the name of the parameter, such as "api_key" . It is case sensitive. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + * + * Generated from protobuf field string http_header = 2; + * @return string + */ + public function getHttpHeader() + { + return $this->http_header; + } + + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + * + * Generated from protobuf field string http_header = 2; + * @param string $var + * @return $this + */ + public function setHttpHeader($var) + { + GPBUtil::checkString($var, True); + $this->http_header = $var; + + return $this; + } + + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + * + * Generated from protobuf field string url_query_parameter = 3; + * @return string + */ + public function getUrlQueryParameter() + { + return $this->url_query_parameter; + } + + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + * + * Generated from protobuf field string url_query_parameter = 3; + * @param string $var + * @return $this + */ + public function setUrlQueryParameter($var) + { + GPBUtil::checkString($var, True); + $this->url_query_parameter = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/SystemParameterRule.php b/vendor/google/common-protos/src/Api/SystemParameterRule.php new file mode 100644 index 0000000..b2b475c --- /dev/null +++ b/vendor/google/common-protos/src/Api/SystemParameterRule.php @@ -0,0 +1,130 @@ +google.api.SystemParameterRule + */ +class SystemParameterRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * Define parameters. Multiple names may be defined for a parameter. + * For a given method call, only one of them should be used. If multiple + * names are used the behavior is implementation-dependent. + * If none of the specified names are present the behavior is + * parameter-dependent. + * + * Generated from protobuf field repeated .google.api.SystemParameter parameters = 2; + */ + private $parameters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type array<\Google\Api\SystemParameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * Define parameters. Multiple names may be defined for a parameter. + * For a given method call, only one of them should be used. If multiple + * names are used the behavior is implementation-dependent. + * If none of the specified names are present the behavior is + * parameter-dependent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\SystemParameter::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * Define parameters. Multiple names may be defined for a parameter. + * For a given method call, only one of them should be used. If multiple + * names are used the behavior is implementation-dependent. + * If none of the specified names are present the behavior is + * parameter-dependent. + * + * Generated from protobuf field repeated .google.api.SystemParameter parameters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Define parameters. Multiple names may be defined for a parameter. + * For a given method call, only one of them should be used. If multiple + * names are used the behavior is implementation-dependent. + * If none of the specified names are present the behavior is + * parameter-dependent. + * + * Generated from protobuf field repeated .google.api.SystemParameter parameters = 2; + * @param array<\Google\Api\SystemParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\SystemParameter::class); + $this->parameters = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/SystemParameters.php b/vendor/google/common-protos/src/Api/SystemParameters.php new file mode 100644 index 0000000..04a674c --- /dev/null +++ b/vendor/google/common-protos/src/Api/SystemParameters.php @@ -0,0 +1,155 @@ +google.api.SystemParameters + */ +class SystemParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Define system parameters. + * The parameters defined here will override the default parameters + * implemented by the system. If this field is missing from the service + * config, default system parameters will be used. Default system parameters + * and names is implementation-dependent. + * Example: define api key for all methods + * system_parameters + * rules: + * - selector: "*" + * parameters: + * - name: api_key + * url_query_parameter: api_key + * Example: define 2 api key names for a specific method. + * system_parameters + * rules: + * - selector: "/ListShelves" + * parameters: + * - name: api_key + * http_header: Api-Key1 + * - name: api_key + * http_header: Api-Key2 + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.SystemParameterRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\SystemParameterRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Define system parameters. + * The parameters defined here will override the default parameters + * implemented by the system. If this field is missing from the service + * config, default system parameters will be used. Default system parameters + * and names is implementation-dependent. + * Example: define api key for all methods + * system_parameters + * rules: + * - selector: "*" + * parameters: + * - name: api_key + * url_query_parameter: api_key + * Example: define 2 api key names for a specific method. + * system_parameters + * rules: + * - selector: "/ListShelves" + * parameters: + * - name: api_key + * http_header: Api-Key1 + * - name: api_key + * http_header: Api-Key2 + * **NOTE:** All service configuration rules follow "last one wins" order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\SystemParameter::initOnce(); + parent::__construct($data); + } + + /** + * Define system parameters. + * The parameters defined here will override the default parameters + * implemented by the system. If this field is missing from the service + * config, default system parameters will be used. Default system parameters + * and names is implementation-dependent. + * Example: define api key for all methods + * system_parameters + * rules: + * - selector: "*" + * parameters: + * - name: api_key + * url_query_parameter: api_key + * Example: define 2 api key names for a specific method. + * system_parameters + * rules: + * - selector: "/ListShelves" + * parameters: + * - name: api_key + * http_header: Api-Key1 + * - name: api_key + * http_header: Api-Key2 + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.SystemParameterRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Define system parameters. + * The parameters defined here will override the default parameters + * implemented by the system. If this field is missing from the service + * config, default system parameters will be used. Default system parameters + * and names is implementation-dependent. + * Example: define api key for all methods + * system_parameters + * rules: + * - selector: "*" + * parameters: + * - name: api_key + * url_query_parameter: api_key + * Example: define 2 api key names for a specific method. + * system_parameters + * rules: + * - selector: "/ListShelves" + * parameters: + * - name: api_key + * http_header: Api-Key1 + * - name: api_key + * http_header: Api-Key2 + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.SystemParameterRule rules = 1; + * @param array<\Google\Api\SystemParameterRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\SystemParameterRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/TypeReference.php b/vendor/google/common-protos/src/Api/TypeReference.php new file mode 100644 index 0000000..1ce287b --- /dev/null +++ b/vendor/google/common-protos/src/Api/TypeReference.php @@ -0,0 +1,91 @@ +google.api.TypeReference + */ +class TypeReference extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the type that the annotated, generic field may represent. + * If the type is in the same protobuf package, the value can be the simple + * message name e.g., `"MyMessage"`. Otherwise, the value must be the + * fully-qualified message name e.g., `"google.library.v1.Book"`. + * If the type(s) are unknown to the service (e.g. the field accepts generic + * user input), use the wildcard `"*"` to denote this behavior. + * See [AIP-202](https://google.aip.dev/202#type-references) for more details. + * + * Generated from protobuf field string type_name = 1; + */ + protected $type_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type_name + * The name of the type that the annotated, generic field may represent. + * If the type is in the same protobuf package, the value can be the simple + * message name e.g., `"MyMessage"`. Otherwise, the value must be the + * fully-qualified message name e.g., `"google.library.v1.Book"`. + * If the type(s) are unknown to the service (e.g. the field accepts generic + * user input), use the wildcard `"*"` to denote this behavior. + * See [AIP-202](https://google.aip.dev/202#type-references) for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\FieldInfo::initOnce(); + parent::__construct($data); + } + + /** + * The name of the type that the annotated, generic field may represent. + * If the type is in the same protobuf package, the value can be the simple + * message name e.g., `"MyMessage"`. Otherwise, the value must be the + * fully-qualified message name e.g., `"google.library.v1.Book"`. + * If the type(s) are unknown to the service (e.g. the field accepts generic + * user input), use the wildcard `"*"` to denote this behavior. + * See [AIP-202](https://google.aip.dev/202#type-references) for more details. + * + * Generated from protobuf field string type_name = 1; + * @return string + */ + public function getTypeName() + { + return $this->type_name; + } + + /** + * The name of the type that the annotated, generic field may represent. + * If the type is in the same protobuf package, the value can be the simple + * message name e.g., `"MyMessage"`. Otherwise, the value must be the + * fully-qualified message name e.g., `"google.library.v1.Book"`. + * If the type(s) are unknown to the service (e.g. the field accepts generic + * user input), use the wildcard `"*"` to denote this behavior. + * See [AIP-202](https://google.aip.dev/202#type-references) for more details. + * + * Generated from protobuf field string type_name = 1; + * @param string $var + * @return $this + */ + public function setTypeName($var) + { + GPBUtil::checkString($var, True); + $this->type_name = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Usage.php b/vendor/google/common-protos/src/Api/Usage.php new file mode 100644 index 0000000..0ebe664 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Usage.php @@ -0,0 +1,191 @@ +google.api.Usage + */ +class Usage extends \Google\Protobuf\Internal\Message +{ + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form /; + * for example 'serviceusage.googleapis.com/billing-enabled'. + * For Google APIs, a Terms of Service requirement must be included here. + * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + * Other Google APIs should include + * "serviceusage.googleapis.com/tos/universal". Additional ToS can be + * included based on the business needs. + * + * Generated from protobuf field repeated string requirements = 1; + */ + private $requirements; + /** + * A list of usage rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.UsageRule rules = 6; + */ + private $rules; + /** + * The full resource name of a channel used for sending notifications to the + * service producer. + * Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the name + * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + * documented in https://cloud.google.com/pubsub/docs/overview. + * + * Generated from protobuf field string producer_notification_channel = 7; + */ + protected $producer_notification_channel = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $requirements + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form /; + * for example 'serviceusage.googleapis.com/billing-enabled'. + * For Google APIs, a Terms of Service requirement must be included here. + * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + * Other Google APIs should include + * "serviceusage.googleapis.com/tos/universal". Additional ToS can be + * included based on the business needs. + * @type array<\Google\Api\UsageRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of usage rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * @type string $producer_notification_channel + * The full resource name of a channel used for sending notifications to the + * service producer. + * Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the name + * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + * documented in https://cloud.google.com/pubsub/docs/overview. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Usage::initOnce(); + parent::__construct($data); + } + + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form /; + * for example 'serviceusage.googleapis.com/billing-enabled'. + * For Google APIs, a Terms of Service requirement must be included here. + * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + * Other Google APIs should include + * "serviceusage.googleapis.com/tos/universal". Additional ToS can be + * included based on the business needs. + * + * Generated from protobuf field repeated string requirements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequirements() + { + return $this->requirements; + } + + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form /; + * for example 'serviceusage.googleapis.com/billing-enabled'. + * For Google APIs, a Terms of Service requirement must be included here. + * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + * Other Google APIs should include + * "serviceusage.googleapis.com/tos/universal". Additional ToS can be + * included based on the business needs. + * + * Generated from protobuf field repeated string requirements = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequirements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->requirements = $arr; + + return $this; + } + + /** + * A list of usage rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.UsageRule rules = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of usage rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.UsageRule rules = 6; + * @param array<\Google\Api\UsageRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\UsageRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * The full resource name of a channel used for sending notifications to the + * service producer. + * Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the name + * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + * documented in https://cloud.google.com/pubsub/docs/overview. + * + * Generated from protobuf field string producer_notification_channel = 7; + * @return string + */ + public function getProducerNotificationChannel() + { + return $this->producer_notification_channel; + } + + /** + * The full resource name of a channel used for sending notifications to the + * service producer. + * Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the name + * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + * documented in https://cloud.google.com/pubsub/docs/overview. + * + * Generated from protobuf field string producer_notification_channel = 7; + * @param string $var + * @return $this + */ + public function setProducerNotificationChannel($var) + { + GPBUtil::checkString($var, True); + $this->producer_notification_channel = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/UsageRule.php b/vendor/google/common-protos/src/Api/UsageRule.php new file mode 100644 index 0000000..fcd4f54 --- /dev/null +++ b/vendor/google/common-protos/src/Api/UsageRule.php @@ -0,0 +1,180 @@ +google.api.UsageRule + */ +class UsageRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * If true, the selected method allows unregistered calls, e.g. calls + * that don't identify any user or application. + * + * Generated from protobuf field bool allow_unregistered_calls = 2; + */ + protected $allow_unregistered_calls = false; + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. + * This flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + * + * Generated from protobuf field bool skip_service_control = 3; + */ + protected $skip_service_control = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type bool $allow_unregistered_calls + * If true, the selected method allows unregistered calls, e.g. calls + * that don't identify any user or application. + * @type bool $skip_service_control + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. + * This flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Usage::initOnce(); + parent::__construct($data); + } + + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects the methods to which this rule applies. Use '*' to indicate all + * methods in all APIs. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * If true, the selected method allows unregistered calls, e.g. calls + * that don't identify any user or application. + * + * Generated from protobuf field bool allow_unregistered_calls = 2; + * @return bool + */ + public function getAllowUnregisteredCalls() + { + return $this->allow_unregistered_calls; + } + + /** + * If true, the selected method allows unregistered calls, e.g. calls + * that don't identify any user or application. + * + * Generated from protobuf field bool allow_unregistered_calls = 2; + * @param bool $var + * @return $this + */ + public function setAllowUnregisteredCalls($var) + { + GPBUtil::checkBool($var); + $this->allow_unregistered_calls = $var; + + return $this; + } + + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. + * This flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + * + * Generated from protobuf field bool skip_service_control = 3; + * @return bool + */ + public function getSkipServiceControl() + { + return $this->skip_service_control; + } + + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. + * This flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + * + * Generated from protobuf field bool skip_service_control = 3; + * @param bool $var + * @return $this + */ + public function setSkipServiceControl($var) + { + GPBUtil::checkBool($var); + $this->skip_service_control = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/Visibility.php b/vendor/google/common-protos/src/Api/Visibility.php new file mode 100644 index 0000000..b232df6 --- /dev/null +++ b/vendor/google/common-protos/src/Api/Visibility.php @@ -0,0 +1,88 @@ +google.api.Visibility + */ +class Visibility extends \Google\Protobuf\Internal\Message +{ + /** + * A list of visibility rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.VisibilityRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Api\VisibilityRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of visibility rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Visibility::initOnce(); + parent::__construct($data); + } + + /** + * A list of visibility rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.VisibilityRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of visibility rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * Generated from protobuf field repeated .google.api.VisibilityRule rules = 1; + * @param array<\Google\Api\VisibilityRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\VisibilityRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Api/VisibilityRule.php b/vendor/google/common-protos/src/Api/VisibilityRule.php new file mode 100644 index 0000000..74c522f --- /dev/null +++ b/vendor/google/common-protos/src/Api/VisibilityRule.php @@ -0,0 +1,150 @@ +google.api.VisibilityRule + */ +class VisibilityRule extends \Google\Protobuf\Internal\Message +{ + /** + * Selects methods, messages, fields, enums, etc. to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + */ + protected $selector = ''; + /** + * A comma-separated list of visibility labels that apply to the `selector`. + * Any of the listed labels can be used to grant the visibility. + * If a rule has multiple labels, removing one of the labels but not all of + * them can break clients. + * Example: + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: INTERNAL, PREVIEW + * Removing INTERNAL from this restriction will break clients that rely on + * this method and only had access to it through INTERNAL. + * + * Generated from protobuf field string restriction = 2; + */ + protected $restriction = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $selector + * Selects methods, messages, fields, enums, etc. to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * @type string $restriction + * A comma-separated list of visibility labels that apply to the `selector`. + * Any of the listed labels can be used to grant the visibility. + * If a rule has multiple labels, removing one of the labels but not all of + * them can break clients. + * Example: + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: INTERNAL, PREVIEW + * Removing INTERNAL from this restriction will break clients that rely on + * this method and only had access to it through INTERNAL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Visibility::initOnce(); + parent::__construct($data); + } + + /** + * Selects methods, messages, fields, enums, etc. to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @return string + */ + public function getSelector() + { + return $this->selector; + } + + /** + * Selects methods, messages, fields, enums, etc. to which this rule applies. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * Generated from protobuf field string selector = 1; + * @param string $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkString($var, True); + $this->selector = $var; + + return $this; + } + + /** + * A comma-separated list of visibility labels that apply to the `selector`. + * Any of the listed labels can be used to grant the visibility. + * If a rule has multiple labels, removing one of the labels but not all of + * them can break clients. + * Example: + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: INTERNAL, PREVIEW + * Removing INTERNAL from this restriction will break clients that rely on + * this method and only had access to it through INTERNAL. + * + * Generated from protobuf field string restriction = 2; + * @return string + */ + public function getRestriction() + { + return $this->restriction; + } + + /** + * A comma-separated list of visibility labels that apply to the `selector`. + * Any of the listed labels can be used to grant the visibility. + * If a rule has multiple labels, removing one of the labels but not all of + * them can break clients. + * Example: + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: INTERNAL, PREVIEW + * Removing INTERNAL from this restriction will break clients that rely on + * this method and only had access to it through INTERNAL. + * + * Generated from protobuf field string restriction = 2; + * @param string $var + * @return $this + */ + public function setRestriction($var) + { + GPBUtil::checkString($var, True); + $this->restriction = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfig.php b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfig.php new file mode 100644 index 0000000..b259431 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfig.php @@ -0,0 +1,155 @@ +google.iam.v1.AuditConfig + */ +class AuditConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; + */ + private $audit_log_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * @type array<\Google\Cloud\Iam\V1\AuditLogConfig>|\Google\Protobuf\Internal\RepeatedField $audit_log_configs + * The configuration for logging of each type of permission. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuditLogConfigs() + { + return $this->audit_log_configs; + } + + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; + * @param array<\Google\Cloud\Iam\V1\AuditLogConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuditLogConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\AuditLogConfig::class); + $this->audit_log_configs = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta.php b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta.php new file mode 100644 index 0000000..02c622e --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta.php @@ -0,0 +1,202 @@ +google.iam.v1.AuditConfigDelta + */ +class AuditConfigDelta extends \Google\Protobuf\Internal\Message +{ + /** + * The action that was performed on an audit configuration in a policy. + * Required + * + * Generated from protobuf field .google.iam.v1.AuditConfigDelta.Action action = 1; + */ + protected $action = 0; + /** + * Specifies a service that was configured for Cloud Audit Logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * Required + * + * Generated from protobuf field string service = 2; + */ + protected $service = ''; + /** + * A single identity that is exempted from "data access" audit + * logging for the `service` specified above. + * Follows the same format of Binding.members. + * + * Generated from protobuf field string exempted_member = 3; + */ + protected $exempted_member = ''; + /** + * Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + * enabled, and cannot be configured. + * Required + * + * Generated from protobuf field string log_type = 4; + */ + protected $log_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $action + * The action that was performed on an audit configuration in a policy. + * Required + * @type string $service + * Specifies a service that was configured for Cloud Audit Logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * Required + * @type string $exempted_member + * A single identity that is exempted from "data access" audit + * logging for the `service` specified above. + * Follows the same format of Binding.members. + * @type string $log_type + * Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + * enabled, and cannot be configured. + * Required + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * The action that was performed on an audit configuration in a policy. + * Required + * + * Generated from protobuf field .google.iam.v1.AuditConfigDelta.Action action = 1; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * The action that was performed on an audit configuration in a policy. + * Required + * + * Generated from protobuf field .google.iam.v1.AuditConfigDelta.Action action = 1; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Iam\V1\AuditConfigDelta\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Specifies a service that was configured for Cloud Audit Logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * Required + * + * Generated from protobuf field string service = 2; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Specifies a service that was configured for Cloud Audit Logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + * Required + * + * Generated from protobuf field string service = 2; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * A single identity that is exempted from "data access" audit + * logging for the `service` specified above. + * Follows the same format of Binding.members. + * + * Generated from protobuf field string exempted_member = 3; + * @return string + */ + public function getExemptedMember() + { + return $this->exempted_member; + } + + /** + * A single identity that is exempted from "data access" audit + * logging for the `service` specified above. + * Follows the same format of Binding.members. + * + * Generated from protobuf field string exempted_member = 3; + * @param string $var + * @return $this + */ + public function setExemptedMember($var) + { + GPBUtil::checkString($var, True); + $this->exempted_member = $var; + + return $this; + } + + /** + * Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + * enabled, and cannot be configured. + * Required + * + * Generated from protobuf field string log_type = 4; + * @return string + */ + public function getLogType() + { + return $this->log_type; + } + + /** + * Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + * enabled, and cannot be configured. + * Required + * + * Generated from protobuf field string log_type = 4; + * @param string $var + * @return $this + */ + public function setLogType($var) + { + GPBUtil::checkString($var, True); + $this->log_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta/Action.php b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta/Action.php new file mode 100644 index 0000000..ffce349 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditConfigDelta/Action.php @@ -0,0 +1,62 @@ +google.iam.v1.AuditConfigDelta.Action + */ +class Action +{ + /** + * Unspecified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Addition of an audit configuration. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * Removal of an audit configuration. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig.php b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig.php new file mode 100644 index 0000000..83b9940 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig.php @@ -0,0 +1,129 @@ +google.iam.v1.AuditLogConfig + */ +class AuditLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The log type that this config enables. + * + * Generated from protobuf field .google.iam.v1.AuditLogConfig.LogType log_type = 1; + */ + protected $log_type = 0; + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of + * [Binding.members][google.iam.v1.Binding.members]. + * + * Generated from protobuf field repeated string exempted_members = 2; + */ + private $exempted_members; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $log_type + * The log type that this config enables. + * @type array|\Google\Protobuf\Internal\RepeatedField $exempted_members + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of + * [Binding.members][google.iam.v1.Binding.members]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * The log type that this config enables. + * + * Generated from protobuf field .google.iam.v1.AuditLogConfig.LogType log_type = 1; + * @return int + */ + public function getLogType() + { + return $this->log_type; + } + + /** + * The log type that this config enables. + * + * Generated from protobuf field .google.iam.v1.AuditLogConfig.LogType log_type = 1; + * @param int $var + * @return $this + */ + public function setLogType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Iam\V1\AuditLogConfig\LogType::class); + $this->log_type = $var; + + return $this; + } + + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of + * [Binding.members][google.iam.v1.Binding.members]. + * + * Generated from protobuf field repeated string exempted_members = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemptedMembers() + { + return $this->exempted_members; + } + + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of + * [Binding.members][google.iam.v1.Binding.members]. + * + * Generated from protobuf field repeated string exempted_members = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemptedMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->exempted_members = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig/LogType.php b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig/LogType.php new file mode 100644 index 0000000..f78a01b --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/AuditLogConfig/LogType.php @@ -0,0 +1,70 @@ +google.iam.v1.AuditLogConfig.LogType + */ +class LogType +{ + /** + * Default case. Should never be this. + * + * Generated from protobuf enum LOG_TYPE_UNSPECIFIED = 0; + */ + const LOG_TYPE_UNSPECIFIED = 0; + /** + * Admin reads. Example: CloudIAM getIamPolicy + * + * Generated from protobuf enum ADMIN_READ = 1; + */ + const ADMIN_READ = 1; + /** + * Data writes. Example: CloudSQL Users create + * + * Generated from protobuf enum DATA_WRITE = 2; + */ + const DATA_WRITE = 2; + /** + * Data reads. Example: CloudSQL Users list + * + * Generated from protobuf enum DATA_READ = 3; + */ + const DATA_READ = 3; + + private static $valueToName = [ + self::LOG_TYPE_UNSPECIFIED => 'LOG_TYPE_UNSPECIFIED', + self::ADMIN_READ => 'ADMIN_READ', + self::DATA_WRITE => 'DATA_WRITE', + self::DATA_READ => 'DATA_READ', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/Binding.php b/vendor/google/common-protos/src/Cloud/Iam/V1/Binding.php new file mode 100644 index 0000000..af64546 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/Binding.php @@ -0,0 +1,301 @@ +google.iam.v1.Binding + */ +class Binding extends \Google\Protobuf\Internal\Message +{ + /** + * Role that is assigned to the list of `members`, or principals. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * + * Generated from protobuf field string role = 1; + */ + protected $role = ''; + /** + * Specifies the principals requesting access for a Google Cloud resource. + * `members` can have the following values: + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@example.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a user that has been recently deleted. For + * example, `alice@example.com?uid=123456789012345678901`. If the user is + * recovered, this value reverts to `user:{emailid}` and the recovered user + * retains the role in the binding. + * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + * unique identifier) representing a service account that has been recently + * deleted. For example, + * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + * If the service account is undeleted, this value reverts to + * `serviceAccount:{emailid}` and the undeleted service account retains the + * role in the binding. + * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a Google group that has been recently + * deleted. For example, `admins@example.com?uid=123456789012345678901`. If + * the group is recovered, this value reverts to `group:{emailid}` and the + * recovered group retains the role in the binding. + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * Generated from protobuf field repeated string members = 2; + */ + private $members; + /** + * The condition that is associated with this binding. + * If the condition evaluates to `true`, then this binding applies to the + * current request. + * If the condition evaluates to `false`, then this binding does not apply to + * the current request. However, a different role binding might grant the same + * role to one or more of the principals in this binding. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field .google.type.Expr condition = 3; + */ + protected $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $role + * Role that is assigned to the list of `members`, or principals. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * @type array|\Google\Protobuf\Internal\RepeatedField $members + * Specifies the principals requesting access for a Google Cloud resource. + * `members` can have the following values: + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@example.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a user that has been recently deleted. For + * example, `alice@example.com?uid=123456789012345678901`. If the user is + * recovered, this value reverts to `user:{emailid}` and the recovered user + * retains the role in the binding. + * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + * unique identifier) representing a service account that has been recently + * deleted. For example, + * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + * If the service account is undeleted, this value reverts to + * `serviceAccount:{emailid}` and the undeleted service account retains the + * role in the binding. + * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a Google group that has been recently + * deleted. For example, `admins@example.com?uid=123456789012345678901`. If + * the group is recovered, this value reverts to `group:{emailid}` and the + * recovered group retains the role in the binding. + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * @type \Google\Type\Expr $condition + * The condition that is associated with this binding. + * If the condition evaluates to `true`, then this binding applies to the + * current request. + * If the condition evaluates to `false`, then this binding does not apply to + * the current request. However, a different role binding might grant the same + * role to one or more of the principals in this binding. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * Role that is assigned to the list of `members`, or principals. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * + * Generated from protobuf field string role = 1; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * Role that is assigned to the list of `members`, or principals. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * + * Generated from protobuf field string role = 1; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Specifies the principals requesting access for a Google Cloud resource. + * `members` can have the following values: + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@example.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a user that has been recently deleted. For + * example, `alice@example.com?uid=123456789012345678901`. If the user is + * recovered, this value reverts to `user:{emailid}` and the recovered user + * retains the role in the binding. + * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + * unique identifier) representing a service account that has been recently + * deleted. For example, + * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + * If the service account is undeleted, this value reverts to + * `serviceAccount:{emailid}` and the undeleted service account retains the + * role in the binding. + * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a Google group that has been recently + * deleted. For example, `admins@example.com?uid=123456789012345678901`. If + * the group is recovered, this value reverts to `group:{emailid}` and the + * recovered group retains the role in the binding. + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * Generated from protobuf field repeated string members = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMembers() + { + return $this->members; + } + + /** + * Specifies the principals requesting access for a Google Cloud resource. + * `members` can have the following values: + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@example.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a user that has been recently deleted. For + * example, `alice@example.com?uid=123456789012345678901`. If the user is + * recovered, this value reverts to `user:{emailid}` and the recovered user + * retains the role in the binding. + * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + * unique identifier) representing a service account that has been recently + * deleted. For example, + * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + * If the service account is undeleted, this value reverts to + * `serviceAccount:{emailid}` and the undeleted service account retains the + * role in the binding. + * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + * identifier) representing a Google group that has been recently + * deleted. For example, `admins@example.com?uid=123456789012345678901`. If + * the group is recovered, this value reverts to `group:{emailid}` and the + * recovered group retains the role in the binding. + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * Generated from protobuf field repeated string members = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->members = $arr; + + return $this; + } + + /** + * The condition that is associated with this binding. + * If the condition evaluates to `true`, then this binding applies to the + * current request. + * If the condition evaluates to `false`, then this binding does not apply to + * the current request. However, a different role binding might grant the same + * role to one or more of the principals in this binding. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field .google.type.Expr condition = 3; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * The condition that is associated with this binding. + * If the condition evaluates to `true`, then this binding applies to the + * current request. + * If the condition evaluates to `false`, then this binding does not apply to + * the current request. However, a different role binding might grant the same + * role to one or more of the principals in this binding. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field .google.type.Expr condition = 3; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta.php b/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta.php new file mode 100644 index 0000000..3993a7f --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta.php @@ -0,0 +1,200 @@ +google.iam.v1.BindingDelta + */ +class BindingDelta extends \Google\Protobuf\Internal\Message +{ + /** + * The action that was performed on a Binding. + * Required + * + * Generated from protobuf field .google.iam.v1.BindingDelta.Action action = 1; + */ + protected $action = 0; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * Generated from protobuf field string role = 2; + */ + protected $role = ''; + /** + * A single identity requesting access for a Google Cloud resource. + * Follows the same format of Binding.members. + * Required + * + * Generated from protobuf field string member = 3; + */ + protected $member = ''; + /** + * The condition that is associated with this binding. + * + * Generated from protobuf field .google.type.Expr condition = 4; + */ + protected $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $action + * The action that was performed on a Binding. + * Required + * @type string $role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * @type string $member + * A single identity requesting access for a Google Cloud resource. + * Follows the same format of Binding.members. + * Required + * @type \Google\Type\Expr $condition + * The condition that is associated with this binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * The action that was performed on a Binding. + * Required + * + * Generated from protobuf field .google.iam.v1.BindingDelta.Action action = 1; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * The action that was performed on a Binding. + * Required + * + * Generated from protobuf field .google.iam.v1.BindingDelta.Action action = 1; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Iam\V1\BindingDelta\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * Generated from protobuf field string role = 2; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * Generated from protobuf field string role = 2; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * A single identity requesting access for a Google Cloud resource. + * Follows the same format of Binding.members. + * Required + * + * Generated from protobuf field string member = 3; + * @return string + */ + public function getMember() + { + return $this->member; + } + + /** + * A single identity requesting access for a Google Cloud resource. + * Follows the same format of Binding.members. + * Required + * + * Generated from protobuf field string member = 3; + * @param string $var + * @return $this + */ + public function setMember($var) + { + GPBUtil::checkString($var, True); + $this->member = $var; + + return $this; + } + + /** + * The condition that is associated with this binding. + * + * Generated from protobuf field .google.type.Expr condition = 4; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * The condition that is associated with this binding. + * + * Generated from protobuf field .google.type.Expr condition = 4; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta/Action.php b/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta/Action.php new file mode 100644 index 0000000..f119696 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/BindingDelta/Action.php @@ -0,0 +1,62 @@ +google.iam.v1.BindingDelta.Action + */ +class Action +{ + /** + * Unspecified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Addition of a Binding. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * Removal of a Binding. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/GetIamPolicyRequest.php b/vendor/google/common-protos/src/Cloud/Iam/V1/GetIamPolicyRequest.php new file mode 100644 index 0000000..d74e0e8 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/GetIamPolicyRequest.php @@ -0,0 +1,119 @@ +google.iam.v1.GetIamPolicyRequest + */ +class GetIamPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $resource = ''; + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * + * Generated from protobuf field .google.iam.v1.GetPolicyOptions options = 2; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @type \Google\Cloud\Iam\V1\GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\IamPolicy::initOnce(); + parent::__construct($data); + } + + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * + * Generated from protobuf field .google.iam.v1.GetPolicyOptions options = 2; + * @return \Google\Cloud\Iam\V1\GetPolicyOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * + * Generated from protobuf field .google.iam.v1.GetPolicyOptions options = 2; + * @param \Google\Cloud\Iam\V1\GetPolicyOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\GetPolicyOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/GetPolicyOptions.php b/vendor/google/common-protos/src/Cloud/Iam/V1/GetPolicyOptions.php new file mode 100644 index 0000000..a2600d0 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/GetPolicyOptions.php @@ -0,0 +1,119 @@ +google.iam.v1.GetPolicyOptions + */ +class GetPolicyOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum policy version that will be used to format the + * policy. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * Requests for policies with any conditional role bindings must specify + * version 3. Policies with no conditional role bindings may specify any valid + * value or leave the field unset. + * The policy in the response might use the policy version that you specified, + * or it might use a lower policy version. For example, if you specify version + * 3, but the policy has no conditional role bindings, the response uses + * version 1. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 requested_policy_version = 1; + */ + protected $requested_policy_version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $requested_policy_version + * Optional. The maximum policy version that will be used to format the + * policy. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * Requests for policies with any conditional role bindings must specify + * version 3. Policies with no conditional role bindings may specify any valid + * value or leave the field unset. + * The policy in the response might use the policy version that you specified, + * or it might use a lower policy version. For example, if you specify version + * 3, but the policy has no conditional role bindings, the response uses + * version 1. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Options::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum policy version that will be used to format the + * policy. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * Requests for policies with any conditional role bindings must specify + * version 3. Policies with no conditional role bindings may specify any valid + * value or leave the field unset. + * The policy in the response might use the policy version that you specified, + * or it might use a lower policy version. For example, if you specify version + * 3, but the policy has no conditional role bindings, the response uses + * version 1. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 requested_policy_version = 1; + * @return int + */ + public function getRequestedPolicyVersion() + { + return $this->requested_policy_version; + } + + /** + * Optional. The maximum policy version that will be used to format the + * policy. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * Requests for policies with any conditional role bindings must specify + * version 3. Policies with no conditional role bindings may specify any valid + * value or leave the field unset. + * The policy in the response might use the policy version that you specified, + * or it might use a lower policy version. For example, if you specify version + * 3, but the policy has no conditional role bindings, the response uses + * version 1. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 requested_policy_version = 1; + * @param int $var + * @return $this + */ + public function setRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->requested_policy_version = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/Policy.php b/vendor/google/common-protos/src/Cloud/Iam/V1/Policy.php new file mode 100644 index 0000000..8b4633b --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/Policy.php @@ -0,0 +1,377 @@ +google.iam.v1.Policy + */ +class Policy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the format of the policy. + * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + * are rejected. + * Any operation that affects conditional role bindings must specify version + * `3`. This requirement applies to the following operations: + * * Getting a policy that includes a conditional role binding + * * Adding a conditional role binding to a policy + * * Changing a conditional role binding in a policy + * * Removing any role binding, with or without a condition, from a policy + * that includes conditions + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * If a policy does not include any conditions, operations on that policy may + * specify any valid version or leave the field unset. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 version = 1; + */ + protected $version = 0; + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, + * may specify a `condition` that determines how and when the `bindings` are + * applied. Each of the `bindings` must contain at least one principal. + * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + * of these principals can be Google groups. Each occurrence of a principal + * counts towards these limits. For example, if the `bindings` grant 50 + * different roles to `user:alice@example.com`, and not to any other + * principal, then you can add another 1,450 principals to the `bindings` in + * the `Policy`. + * + * Generated from protobuf field repeated .google.iam.v1.Binding bindings = 4; + */ + private $bindings; + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfig audit_configs = 6; + */ + private $audit_configs; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * + * Generated from protobuf field bytes etag = 3; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $version + * Specifies the format of the policy. + * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + * are rejected. + * Any operation that affects conditional role bindings must specify version + * `3`. This requirement applies to the following operations: + * * Getting a policy that includes a conditional role binding + * * Adding a conditional role binding to a policy + * * Changing a conditional role binding in a policy + * * Removing any role binding, with or without a condition, from a policy + * that includes conditions + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * If a policy does not include any conditions, operations on that policy may + * specify any valid version or leave the field unset. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * @type array<\Google\Cloud\Iam\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Associates a list of `members`, or principals, with a `role`. Optionally, + * may specify a `condition` that determines how and when the `bindings` are + * applied. Each of the `bindings` must contain at least one principal. + * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + * of these principals can be Google groups. Each occurrence of a principal + * counts towards these limits. For example, if the `bindings` grant 50 + * different roles to `user:alice@example.com`, and not to any other + * principal, then you can add another 1,450 principals to the `bindings` in + * the `Policy`. + * @type array<\Google\Cloud\Iam\V1\AuditConfig>|\Google\Protobuf\Internal\RepeatedField $audit_configs + * Specifies cloud audit logging configuration for this policy. + * @type string $etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the format of the policy. + * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + * are rejected. + * Any operation that affects conditional role bindings must specify version + * `3`. This requirement applies to the following operations: + * * Getting a policy that includes a conditional role binding + * * Adding a conditional role binding to a policy + * * Changing a conditional role binding in a policy + * * Removing any role binding, with or without a condition, from a policy + * that includes conditions + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * If a policy does not include any conditions, operations on that policy may + * specify any valid version or leave the field unset. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 version = 1; + * @return int + */ + public function getVersion() + { + return $this->version; + } + + /** + * Specifies the format of the policy. + * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + * are rejected. + * Any operation that affects conditional role bindings must specify version + * `3`. This requirement applies to the following operations: + * * Getting a policy that includes a conditional role binding + * * Adding a conditional role binding to a policy + * * Changing a conditional role binding in a policy + * * Removing any role binding, with or without a condition, from a policy + * that includes conditions + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * If a policy does not include any conditions, operations on that policy may + * specify any valid version or leave the field unset. + * To learn which resources support conditions in their IAM policies, see the + * [IAM + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field int32 version = 1; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkInt32($var); + $this->version = $var; + + return $this; + } + + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, + * may specify a `condition` that determines how and when the `bindings` are + * applied. Each of the `bindings` must contain at least one principal. + * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + * of these principals can be Google groups. Each occurrence of a principal + * counts towards these limits. For example, if the `bindings` grant 50 + * different roles to `user:alice@example.com`, and not to any other + * principal, then you can add another 1,450 principals to the `bindings` in + * the `Policy`. + * + * Generated from protobuf field repeated .google.iam.v1.Binding bindings = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, + * may specify a `condition` that determines how and when the `bindings` are + * applied. Each of the `bindings` must contain at least one principal. + * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + * of these principals can be Google groups. Each occurrence of a principal + * counts towards these limits. For example, if the `bindings` grant 50 + * different roles to `user:alice@example.com`, and not to any other + * principal, then you can add another 1,450 principals to the `bindings` in + * the `Policy`. + * + * Generated from protobuf field repeated .google.iam.v1.Binding bindings = 4; + * @param array<\Google\Cloud\Iam\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfig audit_configs = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuditConfigs() + { + return $this->audit_configs; + } + + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfig audit_configs = 6; + * @param array<\Google\Cloud\Iam\V1\AuditConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuditConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\AuditConfig::class); + $this->audit_configs = $arr; + + return $this; + } + + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * + * Generated from protobuf field bytes etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * **Important:** If you use IAM Conditions, you must include the `etag` field + * whenever you call `setIamPolicy`. If you omit this field, then IAM allows + * you to overwrite a version `3` policy with a version `1` policy, and all of + * the conditions in the version `3` policy are lost. + * + * Generated from protobuf field bytes etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, False); + $this->etag = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/PolicyDelta.php b/vendor/google/common-protos/src/Cloud/Iam/V1/PolicyDelta.php new file mode 100644 index 0000000..dde1c0f --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/PolicyDelta.php @@ -0,0 +1,101 @@ +google.iam.v1.PolicyDelta + */ +class PolicyDelta extends \Google\Protobuf\Internal\Message +{ + /** + * The delta for Bindings between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.BindingDelta binding_deltas = 1; + */ + private $binding_deltas; + /** + * The delta for AuditConfigs between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; + */ + private $audit_config_deltas; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Iam\V1\BindingDelta>|\Google\Protobuf\Internal\RepeatedField $binding_deltas + * The delta for Bindings between two policies. + * @type array<\Google\Cloud\Iam\V1\AuditConfigDelta>|\Google\Protobuf\Internal\RepeatedField $audit_config_deltas + * The delta for AuditConfigs between two policies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Policy::initOnce(); + parent::__construct($data); + } + + /** + * The delta for Bindings between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.BindingDelta binding_deltas = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindingDeltas() + { + return $this->binding_deltas; + } + + /** + * The delta for Bindings between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.BindingDelta binding_deltas = 1; + * @param array<\Google\Cloud\Iam\V1\BindingDelta>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindingDeltas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\BindingDelta::class); + $this->binding_deltas = $arr; + + return $this; + } + + /** + * The delta for AuditConfigs between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuditConfigDeltas() + { + return $this->audit_config_deltas; + } + + /** + * The delta for AuditConfigs between two policies. + * + * Generated from protobuf field repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; + * @param array<\Google\Cloud\Iam\V1\AuditConfigDelta>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuditConfigDeltas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V1\AuditConfigDelta::class); + $this->audit_config_deltas = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php b/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 0000000..88fbd7b --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,142 @@ +google.iam.v1.ResourcePolicyMember + */ +class ResourcePolicyMember extends \Google\Protobuf\Internal\Message +{ + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $iam_policy_name_principal = ''; + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $iam_policy_uid_principal = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $iam_policy_name_principal + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * @type string $iam_policy_uid_principal + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\ResourcePolicyMember::initOnce(); + parent::__construct($data); + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIamPolicyNamePrincipal() + { + return $this->iam_policy_name_principal; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIamPolicyNamePrincipal($var) + { + GPBUtil::checkString($var, True); + $this->iam_policy_name_principal = $var; + + return $this; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIamPolicyUidPrincipal() + { + return $this->iam_policy_uid_principal; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIamPolicyUidPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->iam_policy_uid_principal = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/SetIamPolicyRequest.php b/vendor/google/common-protos/src/Cloud/Iam/V1/SetIamPolicyRequest.php new file mode 100644 index 0000000..3bc7a5a --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/SetIamPolicyRequest.php @@ -0,0 +1,183 @@ +google.iam.v1.SetIamPolicyRequest + */ +class SetIamPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $resource = ''; + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $policy = null; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @type \Google\Cloud\Iam\V1\Policy $policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @type \Google\Protobuf\FieldMask $update_mask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\IamPolicy::initOnce(); + parent::__construct($data); + } + + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsRequest.php b/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsRequest.php new file mode 100644 index 0000000..dba237c --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsRequest.php @@ -0,0 +1,117 @@ +google.iam.v1.TestIamPermissionsRequest + */ +class TestIamPermissionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $resource = ''; + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\IamPolicy::initOnce(); + parent::__construct($data); + } + + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsResponse.php b/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsResponse.php new file mode 100644 index 0000000..fe3a85e --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Iam/V1/TestIamPermissionsResponse.php @@ -0,0 +1,71 @@ +google.iam.v1.TestIamPermissionsResponse + */ +class TestIamPermissionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * Generated from protobuf field repeated string permissions = 1; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\IamPolicy::initOnce(); + parent::__construct($data); + } + + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * Generated from protobuf field repeated string permissions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * Generated from protobuf field repeated string permissions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Location/GetLocationRequest.php b/vendor/google/common-protos/src/Cloud/Location/GetLocationRequest.php new file mode 100644 index 0000000..cb43058 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Location/GetLocationRequest.php @@ -0,0 +1,67 @@ +google.cloud.location.GetLocationRequest + */ +class GetLocationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for the location. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for the location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Location\Locations::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for the location. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for the location. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Location/ListLocationsRequest.php b/vendor/google/common-protos/src/Cloud/Location/ListLocationsRequest.php new file mode 100644 index 0000000..9279872 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Location/ListLocationsRequest.php @@ -0,0 +1,169 @@ +google.cloud.location.ListLocationsRequest + */ +class ListLocationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The resource that owns the locations collection, if applicable. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $page_size + * The standard list page size. + * @type string $page_token + * The standard list page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Location\Locations::initOnce(); + parent::__construct($data); + } + + /** + * The resource that owns the locations collection, if applicable. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource that owns the locations collection, if applicable. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Location/ListLocationsResponse.php b/vendor/google/common-protos/src/Cloud/Location/ListLocationsResponse.php new file mode 100644 index 0000000..169a8e7 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Location/ListLocationsResponse.php @@ -0,0 +1,101 @@ +google.cloud.location.ListLocationsResponse + */ +class ListLocationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of locations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.cloud.location.Location locations = 1; + */ + private $locations; + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Location\Location>|\Google\Protobuf\Internal\RepeatedField $locations + * A list of locations that matches the specified filter in the request. + * @type string $next_page_token + * The standard List next-page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Location\Locations::initOnce(); + parent::__construct($data); + } + + /** + * A list of locations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.cloud.location.Location locations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocations() + { + return $this->locations; + } + + /** + * A list of locations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.cloud.location.Location locations = 1; + * @param array<\Google\Cloud\Location\Location>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Location\Location::class); + $this->locations = $arr; + + return $this; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Location/Location.php b/vendor/google/common-protos/src/Cloud/Location/Location.php new file mode 100644 index 0000000..f953e2e --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Location/Location.php @@ -0,0 +1,229 @@ +google.cloud.location.Location + */ +class Location extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The canonical id for this location. For example: `"us-east1"`. + * + * Generated from protobuf field string location_id = 4; + */ + protected $location_id = ''; + /** + * The friendly name for this location, typically a nearby city name. + * For example, "Tokyo". + * + * Generated from protobuf field string display_name = 5; + */ + protected $display_name = ''; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + * + * Generated from protobuf field .google.protobuf.Any metadata = 3; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + * @type string $location_id + * The canonical id for this location. For example: `"us-east1"`. + * @type string $display_name + * The friendly name for this location, typically a nearby city name. + * For example, "Tokyo". + * @type array|\Google\Protobuf\Internal\MapField $labels + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + * @type \Google\Protobuf\Any $metadata + * Service-specific metadata. For example the available capacity at the given + * location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Location\Locations::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The canonical id for this location. For example: `"us-east1"`. + * + * Generated from protobuf field string location_id = 4; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * The canonical id for this location. For example: `"us-east1"`. + * + * Generated from protobuf field string location_id = 4; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + + /** + * The friendly name for this location, typically a nearby city name. + * For example, "Tokyo". + * + * Generated from protobuf field string display_name = 5; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The friendly name for this location, typically a nearby city name. + * For example, "Tokyo". + * + * Generated from protobuf field string display_name = 5; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + * + * Generated from protobuf field map labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Service-specific metadata. For example the available capacity at the given + * location. + * + * Generated from protobuf field .google.protobuf.Any metadata = 3; + * @return \Google\Protobuf\Any|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Service-specific metadata. For example the available capacity at the given + * location. + * + * Generated from protobuf field .google.protobuf.Any metadata = 3; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Logging/Type/HttpRequest.php b/vendor/google/common-protos/src/Cloud/Logging/Type/HttpRequest.php new file mode 100644 index 0000000..0907340 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Logging/Type/HttpRequest.php @@ -0,0 +1,627 @@ +google.logging.type.HttpRequest + */ +class HttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + * + * Generated from protobuf field string request_method = 1; + */ + protected $request_method = ''; + /** + * The scheme (http, https), the host name, the path and the query + * portion of the URL that was requested. + * Example: `"http://example.com/some/info?color=red"`. + * + * Generated from protobuf field string request_url = 2; + */ + protected $request_url = ''; + /** + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + * + * Generated from protobuf field int64 request_size = 3; + */ + protected $request_size = 0; + /** + * The response code indicating the status of response. + * Examples: 200, 404. + * + * Generated from protobuf field int32 status = 4; + */ + protected $status = 0; + /** + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + * + * Generated from protobuf field int64 response_size = 5; + */ + protected $response_size = 0; + /** + * The user agent sent by the client. Example: + * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + * CLR 1.0.3705)"`. + * + * Generated from protobuf field string user_agent = 6; + */ + protected $user_agent = ''; + /** + * The IP address (IPv4 or IPv6) of the client that issued the HTTP + * request. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string remote_ip = 7; + */ + protected $remote_ip = ''; + /** + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string server_ip = 13; + */ + protected $server_ip = ''; + /** + * The referer URL of the request, as defined in + * [HTTP/1.1 Header Field + * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). + * + * Generated from protobuf field string referer = 8; + */ + protected $referer = ''; + /** + * The request processing latency on the server, from the time the request was + * received until the response was sent. + * + * Generated from protobuf field .google.protobuf.Duration latency = 14; + */ + protected $latency = null; + /** + * Whether or not a cache lookup was attempted. + * + * Generated from protobuf field bool cache_lookup = 11; + */ + protected $cache_lookup = false; + /** + * Whether or not an entity was served from cache + * (with or without validation). + * + * Generated from protobuf field bool cache_hit = 9; + */ + protected $cache_hit = false; + /** + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if `cache_hit` is + * True. + * + * Generated from protobuf field bool cache_validated_with_origin_server = 10; + */ + protected $cache_validated_with_origin_server = false; + /** + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + * + * Generated from protobuf field int64 cache_fill_bytes = 12; + */ + protected $cache_fill_bytes = 0; + /** + * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + * + * Generated from protobuf field string protocol = 15; + */ + protected $protocol = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $request_method + * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + * @type string $request_url + * The scheme (http, https), the host name, the path and the query + * portion of the URL that was requested. + * Example: `"http://example.com/some/info?color=red"`. + * @type int|string $request_size + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + * @type int $status + * The response code indicating the status of response. + * Examples: 200, 404. + * @type int|string $response_size + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + * @type string $user_agent + * The user agent sent by the client. Example: + * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + * CLR 1.0.3705)"`. + * @type string $remote_ip + * The IP address (IPv4 or IPv6) of the client that issued the HTTP + * request. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * @type string $server_ip + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * @type string $referer + * The referer URL of the request, as defined in + * [HTTP/1.1 Header Field + * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). + * @type \Google\Protobuf\Duration $latency + * The request processing latency on the server, from the time the request was + * received until the response was sent. + * @type bool $cache_lookup + * Whether or not a cache lookup was attempted. + * @type bool $cache_hit + * Whether or not an entity was served from cache + * (with or without validation). + * @type bool $cache_validated_with_origin_server + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if `cache_hit` is + * True. + * @type int|string $cache_fill_bytes + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + * @type string $protocol + * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\Type\HttpRequest::initOnce(); + parent::__construct($data); + } + + /** + * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + * + * Generated from protobuf field string request_method = 1; + * @return string + */ + public function getRequestMethod() + { + return $this->request_method; + } + + /** + * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + * + * Generated from protobuf field string request_method = 1; + * @param string $var + * @return $this + */ + public function setRequestMethod($var) + { + GPBUtil::checkString($var, True); + $this->request_method = $var; + + return $this; + } + + /** + * The scheme (http, https), the host name, the path and the query + * portion of the URL that was requested. + * Example: `"http://example.com/some/info?color=red"`. + * + * Generated from protobuf field string request_url = 2; + * @return string + */ + public function getRequestUrl() + { + return $this->request_url; + } + + /** + * The scheme (http, https), the host name, the path and the query + * portion of the URL that was requested. + * Example: `"http://example.com/some/info?color=red"`. + * + * Generated from protobuf field string request_url = 2; + * @param string $var + * @return $this + */ + public function setRequestUrl($var) + { + GPBUtil::checkString($var, True); + $this->request_url = $var; + + return $this; + } + + /** + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + * + * Generated from protobuf field int64 request_size = 3; + * @return int|string + */ + public function getRequestSize() + { + return $this->request_size; + } + + /** + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + * + * Generated from protobuf field int64 request_size = 3; + * @param int|string $var + * @return $this + */ + public function setRequestSize($var) + { + GPBUtil::checkInt64($var); + $this->request_size = $var; + + return $this; + } + + /** + * The response code indicating the status of response. + * Examples: 200, 404. + * + * Generated from protobuf field int32 status = 4; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * The response code indicating the status of response. + * Examples: 200, 404. + * + * Generated from protobuf field int32 status = 4; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkInt32($var); + $this->status = $var; + + return $this; + } + + /** + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + * + * Generated from protobuf field int64 response_size = 5; + * @return int|string + */ + public function getResponseSize() + { + return $this->response_size; + } + + /** + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + * + * Generated from protobuf field int64 response_size = 5; + * @param int|string $var + * @return $this + */ + public function setResponseSize($var) + { + GPBUtil::checkInt64($var); + $this->response_size = $var; + + return $this; + } + + /** + * The user agent sent by the client. Example: + * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + * CLR 1.0.3705)"`. + * + * Generated from protobuf field string user_agent = 6; + * @return string + */ + public function getUserAgent() + { + return $this->user_agent; + } + + /** + * The user agent sent by the client. Example: + * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + * CLR 1.0.3705)"`. + * + * Generated from protobuf field string user_agent = 6; + * @param string $var + * @return $this + */ + public function setUserAgent($var) + { + GPBUtil::checkString($var, True); + $this->user_agent = $var; + + return $this; + } + + /** + * The IP address (IPv4 or IPv6) of the client that issued the HTTP + * request. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string remote_ip = 7; + * @return string + */ + public function getRemoteIp() + { + return $this->remote_ip; + } + + /** + * The IP address (IPv4 or IPv6) of the client that issued the HTTP + * request. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string remote_ip = 7; + * @param string $var + * @return $this + */ + public function setRemoteIp($var) + { + GPBUtil::checkString($var, True); + $this->remote_ip = $var; + + return $this; + } + + /** + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string server_ip = 13; + * @return string + */ + public function getServerIp() + { + return $this->server_ip; + } + + /** + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. This field can include port information. Examples: + * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + * + * Generated from protobuf field string server_ip = 13; + * @param string $var + * @return $this + */ + public function setServerIp($var) + { + GPBUtil::checkString($var, True); + $this->server_ip = $var; + + return $this; + } + + /** + * The referer URL of the request, as defined in + * [HTTP/1.1 Header Field + * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). + * + * Generated from protobuf field string referer = 8; + * @return string + */ + public function getReferer() + { + return $this->referer; + } + + /** + * The referer URL of the request, as defined in + * [HTTP/1.1 Header Field + * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). + * + * Generated from protobuf field string referer = 8; + * @param string $var + * @return $this + */ + public function setReferer($var) + { + GPBUtil::checkString($var, True); + $this->referer = $var; + + return $this; + } + + /** + * The request processing latency on the server, from the time the request was + * received until the response was sent. + * + * Generated from protobuf field .google.protobuf.Duration latency = 14; + * @return \Google\Protobuf\Duration|null + */ + public function getLatency() + { + return $this->latency; + } + + public function hasLatency() + { + return isset($this->latency); + } + + public function clearLatency() + { + unset($this->latency); + } + + /** + * The request processing latency on the server, from the time the request was + * received until the response was sent. + * + * Generated from protobuf field .google.protobuf.Duration latency = 14; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setLatency($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->latency = $var; + + return $this; + } + + /** + * Whether or not a cache lookup was attempted. + * + * Generated from protobuf field bool cache_lookup = 11; + * @return bool + */ + public function getCacheLookup() + { + return $this->cache_lookup; + } + + /** + * Whether or not a cache lookup was attempted. + * + * Generated from protobuf field bool cache_lookup = 11; + * @param bool $var + * @return $this + */ + public function setCacheLookup($var) + { + GPBUtil::checkBool($var); + $this->cache_lookup = $var; + + return $this; + } + + /** + * Whether or not an entity was served from cache + * (with or without validation). + * + * Generated from protobuf field bool cache_hit = 9; + * @return bool + */ + public function getCacheHit() + { + return $this->cache_hit; + } + + /** + * Whether or not an entity was served from cache + * (with or without validation). + * + * Generated from protobuf field bool cache_hit = 9; + * @param bool $var + * @return $this + */ + public function setCacheHit($var) + { + GPBUtil::checkBool($var); + $this->cache_hit = $var; + + return $this; + } + + /** + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if `cache_hit` is + * True. + * + * Generated from protobuf field bool cache_validated_with_origin_server = 10; + * @return bool + */ + public function getCacheValidatedWithOriginServer() + { + return $this->cache_validated_with_origin_server; + } + + /** + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if `cache_hit` is + * True. + * + * Generated from protobuf field bool cache_validated_with_origin_server = 10; + * @param bool $var + * @return $this + */ + public function setCacheValidatedWithOriginServer($var) + { + GPBUtil::checkBool($var); + $this->cache_validated_with_origin_server = $var; + + return $this; + } + + /** + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + * + * Generated from protobuf field int64 cache_fill_bytes = 12; + * @return int|string + */ + public function getCacheFillBytes() + { + return $this->cache_fill_bytes; + } + + /** + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + * + * Generated from protobuf field int64 cache_fill_bytes = 12; + * @param int|string $var + * @return $this + */ + public function setCacheFillBytes($var) + { + GPBUtil::checkInt64($var); + $this->cache_fill_bytes = $var; + + return $this; + } + + /** + * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + * + * Generated from protobuf field string protocol = 15; + * @return string + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + * + * Generated from protobuf field string protocol = 15; + * @param string $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkString($var, True); + $this->protocol = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Cloud/Logging/Type/LogSeverity.php b/vendor/google/common-protos/src/Cloud/Logging/Type/LogSeverity.php new file mode 100644 index 0000000..dc64792 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/Logging/Type/LogSeverity.php @@ -0,0 +1,119 @@ + DEBUG AND severity <= WARNING + * If you are writing log entries, you should map other severity encodings to + * one of these standard levels. For example, you might map all of Java's FINE, + * FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the + * original severity level in the log entry payload if you wish. + * + * Protobuf type google.logging.type.LogSeverity + */ +class LogSeverity +{ + /** + * (0) The log entry has no assigned severity level. + * + * Generated from protobuf enum DEFAULT = 0; + */ + const PBDEFAULT = 0; + /** + * (100) Debug or trace information. + * + * Generated from protobuf enum DEBUG = 100; + */ + const DEBUG = 100; + /** + * (200) Routine information, such as ongoing status or performance. + * + * Generated from protobuf enum INFO = 200; + */ + const INFO = 200; + /** + * (300) Normal but significant events, such as start up, shut down, or + * a configuration change. + * + * Generated from protobuf enum NOTICE = 300; + */ + const NOTICE = 300; + /** + * (400) Warning events might cause problems. + * + * Generated from protobuf enum WARNING = 400; + */ + const WARNING = 400; + /** + * (500) Error events are likely to cause problems. + * + * Generated from protobuf enum ERROR = 500; + */ + const ERROR = 500; + /** + * (600) Critical events cause more severe problems or outages. + * + * Generated from protobuf enum CRITICAL = 600; + */ + const CRITICAL = 600; + /** + * (700) A person must take an action immediately. + * + * Generated from protobuf enum ALERT = 700; + */ + const ALERT = 700; + /** + * (800) One or more systems are unusable. + * + * Generated from protobuf enum EMERGENCY = 800; + */ + const EMERGENCY = 800; + + private static $valueToName = [ + self::PBDEFAULT => 'DEFAULT', + self::DEBUG => 'DEBUG', + self::INFO => 'INFO', + self::NOTICE => 'NOTICE', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + self::CRITICAL => 'CRITICAL', + self::ALERT => 'ALERT', + self::EMERGENCY => 'EMERGENCY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Cloud/OperationResponseMapping.php b/vendor/google/common-protos/src/Cloud/OperationResponseMapping.php new file mode 100644 index 0000000..c21c294 --- /dev/null +++ b/vendor/google/common-protos/src/Cloud/OperationResponseMapping.php @@ -0,0 +1,86 @@ +google.cloud.OperationResponseMapping + */ +class OperationResponseMapping +{ + /** + * Do not use. + * + * Generated from protobuf enum UNDEFINED = 0; + */ + const UNDEFINED = 0; + /** + * A field in an API-specific (custom) Operation object which carries the same + * meaning as google.longrunning.Operation.name. + * + * Generated from protobuf enum NAME = 1; + */ + const NAME = 1; + /** + * A field in an API-specific (custom) Operation object which carries the same + * meaning as google.longrunning.Operation.done. If the annotated field is of + * an enum type, `annotated_field_name == EnumType.DONE` semantics should be + * equivalent to `Operation.done == true`. If the annotated field is of type + * boolean, then it should follow the same semantics as Operation.done. + * Otherwise, a non-empty value should be treated as `Operation.done == true`. + * + * Generated from protobuf enum STATUS = 2; + */ + const STATUS = 2; + /** + * A field in an API-specific (custom) Operation object which carries the same + * meaning as google.longrunning.Operation.error.code. + * + * Generated from protobuf enum ERROR_CODE = 3; + */ + const ERROR_CODE = 3; + /** + * A field in an API-specific (custom) Operation object which carries the same + * meaning as google.longrunning.Operation.error.message. + * + * Generated from protobuf enum ERROR_MESSAGE = 4; + */ + const ERROR_MESSAGE = 4; + + private static $valueToName = [ + self::UNDEFINED => 'UNDEFINED', + self::NAME => 'NAME', + self::STATUS => 'STATUS', + self::ERROR_CODE => 'ERROR_CODE', + self::ERROR_MESSAGE => 'ERROR_MESSAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Iam/V1/Logging/AuditData.php b/vendor/google/common-protos/src/Iam/V1/Logging/AuditData.php new file mode 100644 index 0000000..447ed72 --- /dev/null +++ b/vendor/google/common-protos/src/Iam/V1/Logging/AuditData.php @@ -0,0 +1,79 @@ +google.iam.v1.logging.AuditData + */ +class AuditData extends \Google\Protobuf\Internal\Message +{ + /** + * Policy delta between the original policy and the newly set policy. + * + * Generated from protobuf field .google.iam.v1.PolicyDelta policy_delta = 2; + */ + protected $policy_delta = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Iam\V1\PolicyDelta $policy_delta + * Policy delta between the original policy and the newly set policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\Logging\AuditData::initOnce(); + parent::__construct($data); + } + + /** + * Policy delta between the original policy and the newly set policy. + * + * Generated from protobuf field .google.iam.v1.PolicyDelta policy_delta = 2; + * @return \Google\Cloud\Iam\V1\PolicyDelta|null + */ + public function getPolicyDelta() + { + return $this->policy_delta; + } + + public function hasPolicyDelta() + { + return isset($this->policy_delta); + } + + public function clearPolicyDelta() + { + unset($this->policy_delta); + } + + /** + * Policy delta between the original policy and the newly set policy. + * + * Generated from protobuf field .google.iam.v1.PolicyDelta policy_delta = 2; + * @param \Google\Cloud\Iam\V1\PolicyDelta $var + * @return $this + */ + public function setPolicyDelta($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\PolicyDelta::class); + $this->policy_delta = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/BadRequest.php b/vendor/google/common-protos/src/Rpc/BadRequest.php new file mode 100644 index 0000000..03e55d6 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/BadRequest.php @@ -0,0 +1,68 @@ +google.rpc.BadRequest + */ +class BadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Describes all violations in a client request. + * + * Generated from protobuf field repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + private $field_violations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\BadRequest\FieldViolation>|\Google\Protobuf\Internal\RepeatedField $field_violations + * Describes all violations in a client request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Describes all violations in a client request. + * + * Generated from protobuf field repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFieldViolations() + { + return $this->field_violations; + } + + /** + * Describes all violations in a client request. + * + * Generated from protobuf field repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + * @param array<\Google\Rpc\BadRequest\FieldViolation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFieldViolations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\BadRequest\FieldViolation::class); + $this->field_violations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php b/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php new file mode 100644 index 0000000..51d5843 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php @@ -0,0 +1,316 @@ +google.rpc.BadRequest.FieldViolation + */ +class FieldViolation extends \Google\Protobuf\Internal\Message +{ + /** + * A path that leads to a field in the request body. The value will be a + * sequence of dot-separated identifiers that identify a protocol buffer + * field. + * Consider the following: + * message CreateContactRequest { + * message EmailAddress { + * enum Type { + * TYPE_UNSPECIFIED = 0; + * HOME = 1; + * WORK = 2; + * } + * optional string email = 1; + * repeated EmailType type = 2; + * } + * string full_name = 1; + * repeated EmailAddress email_addresses = 2; + * } + * In this example, in proto `field` could take one of the following values: + * * `full_name` for a violation in the `full_name` value + * * `email_addresses[1].email` for a violation in the `email` field of the + * first `email_addresses` message + * * `email_addresses[3].type[2]` for a violation in the second `type` + * value in the third `email_addresses` message. + * In JSON, the same values are represented as: + * * `fullName` for a violation in the `fullName` value + * * `emailAddresses[1].email` for a violation in the `email` field of the + * first `emailAddresses` message + * * `emailAddresses[3].type[2]` for a violation in the second `type` + * value in the third `emailAddresses` message. + * + * Generated from protobuf field string field = 1; + */ + protected $field = ''; + /** + * A description of why the request element is bad. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + */ + protected $reason = ''; + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + */ + protected $localized_message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field + * A path that leads to a field in the request body. The value will be a + * sequence of dot-separated identifiers that identify a protocol buffer + * field. + * Consider the following: + * message CreateContactRequest { + * message EmailAddress { + * enum Type { + * TYPE_UNSPECIFIED = 0; + * HOME = 1; + * WORK = 2; + * } + * optional string email = 1; + * repeated EmailType type = 2; + * } + * string full_name = 1; + * repeated EmailAddress email_addresses = 2; + * } + * In this example, in proto `field` could take one of the following values: + * * `full_name` for a violation in the `full_name` value + * * `email_addresses[1].email` for a violation in the `email` field of the + * first `email_addresses` message + * * `email_addresses[3].type[2]` for a violation in the second `type` + * value in the third `email_addresses` message. + * In JSON, the same values are represented as: + * * `fullName` for a violation in the `fullName` value + * * `emailAddresses[1].email` for a violation in the `email` field of the + * first `emailAddresses` message + * * `emailAddresses[3].type[2]` for a violation in the second `type` + * value in the third `emailAddresses` message. + * @type string $description + * A description of why the request element is bad. + * @type string $reason + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * @type \Google\Rpc\LocalizedMessage $localized_message + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * A path that leads to a field in the request body. The value will be a + * sequence of dot-separated identifiers that identify a protocol buffer + * field. + * Consider the following: + * message CreateContactRequest { + * message EmailAddress { + * enum Type { + * TYPE_UNSPECIFIED = 0; + * HOME = 1; + * WORK = 2; + * } + * optional string email = 1; + * repeated EmailType type = 2; + * } + * string full_name = 1; + * repeated EmailAddress email_addresses = 2; + * } + * In this example, in proto `field` could take one of the following values: + * * `full_name` for a violation in the `full_name` value + * * `email_addresses[1].email` for a violation in the `email` field of the + * first `email_addresses` message + * * `email_addresses[3].type[2]` for a violation in the second `type` + * value in the third `email_addresses` message. + * In JSON, the same values are represented as: + * * `fullName` for a violation in the `fullName` value + * * `emailAddresses[1].email` for a violation in the `email` field of the + * first `emailAddresses` message + * * `emailAddresses[3].type[2]` for a violation in the second `type` + * value in the third `emailAddresses` message. + * + * Generated from protobuf field string field = 1; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * A path that leads to a field in the request body. The value will be a + * sequence of dot-separated identifiers that identify a protocol buffer + * field. + * Consider the following: + * message CreateContactRequest { + * message EmailAddress { + * enum Type { + * TYPE_UNSPECIFIED = 0; + * HOME = 1; + * WORK = 2; + * } + * optional string email = 1; + * repeated EmailType type = 2; + * } + * string full_name = 1; + * repeated EmailAddress email_addresses = 2; + * } + * In this example, in proto `field` could take one of the following values: + * * `full_name` for a violation in the `full_name` value + * * `email_addresses[1].email` for a violation in the `email` field of the + * first `email_addresses` message + * * `email_addresses[3].type[2]` for a violation in the second `type` + * value in the third `email_addresses` message. + * In JSON, the same values are represented as: + * * `fullName` for a violation in the `fullName` value + * * `emailAddresses[1].email` for a violation in the `email` field of the + * first `emailAddresses` message + * * `emailAddresses[3].type[2]` for a violation in the second `type` + * value in the third `emailAddresses` message. + * + * Generated from protobuf field string field = 1; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * A description of why the request element is bad. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A description of why the request element is bad. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + * @return \Google\Rpc\LocalizedMessage|null + */ + public function getLocalizedMessage() + { + return $this->localized_message; + } + + public function hasLocalizedMessage() + { + return isset($this->localized_message); + } + + public function clearLocalizedMessage() + { + unset($this->localized_message); + } + + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + * @param \Google\Rpc\LocalizedMessage $var + * @return $this + */ + public function setLocalizedMessage($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\LocalizedMessage::class); + $this->localized_message = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Code.php b/vendor/google/common-protos/src/Rpc/Code.php new file mode 100644 index 0000000..b82e88f --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Code.php @@ -0,0 +1,243 @@ +google.rpc.Code + */ +class Code +{ + /** + * Not an error; returned on success. + * HTTP Mapping: 200 OK + * + * Generated from protobuf enum OK = 0; + */ + const OK = 0; + /** + * The operation was cancelled, typically by the caller. + * HTTP Mapping: 499 Client Closed Request + * + * Generated from protobuf enum CANCELLED = 1; + */ + const CANCELLED = 1; + /** + * Unknown error. For example, this error may be returned when + * a `Status` value received from another address space belongs to + * an error space that is not known in this address space. Also + * errors raised by APIs that do not return enough error information + * may be converted to this error. + * HTTP Mapping: 500 Internal Server Error + * + * Generated from protobuf enum UNKNOWN = 2; + */ + const UNKNOWN = 2; + /** + * The client specified an invalid argument. Note that this differs + * from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + * that are problematic regardless of the state of the system + * (e.g., a malformed file name). + * HTTP Mapping: 400 Bad Request + * + * Generated from protobuf enum INVALID_ARGUMENT = 3; + */ + const INVALID_ARGUMENT = 3; + /** + * The deadline expired before the operation could complete. For operations + * that change the state of the system, this error may be returned + * even if the operation has completed successfully. For example, a + * successful response from a server could have been delayed long + * enough for the deadline to expire. + * HTTP Mapping: 504 Gateway Timeout + * + * Generated from protobuf enum DEADLINE_EXCEEDED = 4; + */ + const DEADLINE_EXCEEDED = 4; + /** + * Some requested entity (e.g., file or directory) was not found. + * Note to server developers: if a request is denied for an entire class + * of users, such as gradual feature rollout or undocumented allowlist, + * `NOT_FOUND` may be used. If a request is denied for some users within + * a class of users, such as user-based access control, `PERMISSION_DENIED` + * must be used. + * HTTP Mapping: 404 Not Found + * + * Generated from protobuf enum NOT_FOUND = 5; + */ + const NOT_FOUND = 5; + /** + * The entity that a client attempted to create (e.g., file or directory) + * already exists. + * HTTP Mapping: 409 Conflict + * + * Generated from protobuf enum ALREADY_EXISTS = 6; + */ + const ALREADY_EXISTS = 6; + /** + * The caller does not have permission to execute the specified + * operation. `PERMISSION_DENIED` must not be used for rejections + * caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + * instead for those errors). `PERMISSION_DENIED` must not be + * used if the caller can not be identified (use `UNAUTHENTICATED` + * instead for those errors). This error code does not imply the + * request is valid or the requested entity exists or satisfies + * other pre-conditions. + * HTTP Mapping: 403 Forbidden + * + * Generated from protobuf enum PERMISSION_DENIED = 7; + */ + const PERMISSION_DENIED = 7; + /** + * The request does not have valid authentication credentials for the + * operation. + * HTTP Mapping: 401 Unauthorized + * + * Generated from protobuf enum UNAUTHENTICATED = 16; + */ + const UNAUTHENTICATED = 16; + /** + * Some resource has been exhausted, perhaps a per-user quota, or + * perhaps the entire file system is out of space. + * HTTP Mapping: 429 Too Many Requests + * + * Generated from protobuf enum RESOURCE_EXHAUSTED = 8; + */ + const RESOURCE_EXHAUSTED = 8; + /** + * The operation was rejected because the system is not in a state + * required for the operation's execution. For example, the directory + * to be deleted is non-empty, an rmdir operation is applied to + * a non-directory, etc. + * Service implementors can use the following guidelines to decide + * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + * (a) Use `UNAVAILABLE` if the client can retry just the failing call. + * (b) Use `ABORTED` if the client should retry at a higher level. For + * example, when a client-specified test-and-set fails, indicating the + * client should restart a read-modify-write sequence. + * (c) Use `FAILED_PRECONDITION` if the client should not retry until + * the system state has been explicitly fixed. For example, if an "rmdir" + * fails because the directory is non-empty, `FAILED_PRECONDITION` + * should be returned since the client should not retry unless + * the files are deleted from the directory. + * HTTP Mapping: 400 Bad Request + * + * Generated from protobuf enum FAILED_PRECONDITION = 9; + */ + const FAILED_PRECONDITION = 9; + /** + * The operation was aborted, typically due to a concurrency issue such as + * a sequencer check failure or transaction abort. + * See the guidelines above for deciding between `FAILED_PRECONDITION`, + * `ABORTED`, and `UNAVAILABLE`. + * HTTP Mapping: 409 Conflict + * + * Generated from protobuf enum ABORTED = 10; + */ + const ABORTED = 10; + /** + * The operation was attempted past the valid range. E.g., seeking or + * reading past end-of-file. + * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + * be fixed if the system state changes. For example, a 32-bit file + * system will generate `INVALID_ARGUMENT` if asked to read at an + * offset that is not in the range [0,2^32-1], but it will generate + * `OUT_OF_RANGE` if asked to read from an offset past the current + * file size. + * There is a fair bit of overlap between `FAILED_PRECONDITION` and + * `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + * error) when it applies so that callers who are iterating through + * a space can easily look for an `OUT_OF_RANGE` error to detect when + * they are done. + * HTTP Mapping: 400 Bad Request + * + * Generated from protobuf enum OUT_OF_RANGE = 11; + */ + const OUT_OF_RANGE = 11; + /** + * The operation is not implemented or is not supported/enabled in this + * service. + * HTTP Mapping: 501 Not Implemented + * + * Generated from protobuf enum UNIMPLEMENTED = 12; + */ + const UNIMPLEMENTED = 12; + /** + * Internal errors. This means that some invariants expected by the + * underlying system have been broken. This error code is reserved + * for serious errors. + * HTTP Mapping: 500 Internal Server Error + * + * Generated from protobuf enum INTERNAL = 13; + */ + const INTERNAL = 13; + /** + * The service is currently unavailable. This is most likely a + * transient condition, which can be corrected by retrying with + * a backoff. Note that it is not always safe to retry + * non-idempotent operations. + * See the guidelines above for deciding between `FAILED_PRECONDITION`, + * `ABORTED`, and `UNAVAILABLE`. + * HTTP Mapping: 503 Service Unavailable + * + * Generated from protobuf enum UNAVAILABLE = 14; + */ + const UNAVAILABLE = 14; + /** + * Unrecoverable data loss or corruption. + * HTTP Mapping: 500 Internal Server Error + * + * Generated from protobuf enum DATA_LOSS = 15; + */ + const DATA_LOSS = 15; + + private static $valueToName = [ + self::OK => 'OK', + self::CANCELLED => 'CANCELLED', + self::UNKNOWN => 'UNKNOWN', + self::INVALID_ARGUMENT => 'INVALID_ARGUMENT', + self::DEADLINE_EXCEEDED => 'DEADLINE_EXCEEDED', + self::NOT_FOUND => 'NOT_FOUND', + self::ALREADY_EXISTS => 'ALREADY_EXISTS', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + self::UNAUTHENTICATED => 'UNAUTHENTICATED', + self::RESOURCE_EXHAUSTED => 'RESOURCE_EXHAUSTED', + self::FAILED_PRECONDITION => 'FAILED_PRECONDITION', + self::ABORTED => 'ABORTED', + self::OUT_OF_RANGE => 'OUT_OF_RANGE', + self::UNIMPLEMENTED => 'UNIMPLEMENTED', + self::INTERNAL => 'INTERNAL', + self::UNAVAILABLE => 'UNAVAILABLE', + self::DATA_LOSS => 'DATA_LOSS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext.php new file mode 100644 index 0000000..a18f303 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext.php @@ -0,0 +1,419 @@ +google.rpc.context.AttributeContext + */ +class AttributeContext extends \Google\Protobuf\Internal\Message +{ + /** + * The origin of a network activity. In a multi hop network activity, + * the origin represents the sender of the first hop. For the first hop, + * the `source` and the `origin` must have the same content. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer origin = 7; + */ + protected $origin = null; + /** + * The source of a network activity, such as starting a TCP connection. + * In a multi hop network activity, the source represents the sender of the + * last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer source = 1; + */ + protected $source = null; + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer destination = 2; + */ + protected $destination = null; + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Request request = 3; + */ + protected $request = null; + /** + * Represents a network response, such as an HTTP response. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Response response = 4; + */ + protected $response = null; + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Resource resource = 5; + */ + protected $resource = null; + /** + * Represents an API operation that is involved to a network activity. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Api api = 6; + */ + protected $api = null; + /** + * Supports extensions for advanced use cases, such as logs and metrics. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 8; + */ + private $extensions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Context\AttributeContext\Peer $origin + * The origin of a network activity. In a multi hop network activity, + * the origin represents the sender of the first hop. For the first hop, + * the `source` and the `origin` must have the same content. + * @type \Google\Rpc\Context\AttributeContext\Peer $source + * The source of a network activity, such as starting a TCP connection. + * In a multi hop network activity, the source represents the sender of the + * last hop. + * @type \Google\Rpc\Context\AttributeContext\Peer $destination + * The destination of a network activity, such as accepting a TCP connection. + * In a multi hop network activity, the destination represents the receiver of + * the last hop. + * @type \Google\Rpc\Context\AttributeContext\Request $request + * Represents a network request, such as an HTTP request. + * @type \Google\Rpc\Context\AttributeContext\Response $response + * Represents a network response, such as an HTTP response. + * @type \Google\Rpc\Context\AttributeContext\Resource $resource + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * @type \Google\Rpc\Context\AttributeContext\Api $api + * Represents an API operation that is involved to a network activity. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $extensions + * Supports extensions for advanced use cases, such as logs and metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The origin of a network activity. In a multi hop network activity, + * the origin represents the sender of the first hop. For the first hop, + * the `source` and the `origin` must have the same content. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer origin = 7; + * @return \Google\Rpc\Context\AttributeContext\Peer|null + */ + public function getOrigin() + { + return $this->origin; + } + + public function hasOrigin() + { + return isset($this->origin); + } + + public function clearOrigin() + { + unset($this->origin); + } + + /** + * The origin of a network activity. In a multi hop network activity, + * the origin represents the sender of the first hop. For the first hop, + * the `source` and the `origin` must have the same content. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer origin = 7; + * @param \Google\Rpc\Context\AttributeContext\Peer $var + * @return $this + */ + public function setOrigin($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Peer::class); + $this->origin = $var; + + return $this; + } + + /** + * The source of a network activity, such as starting a TCP connection. + * In a multi hop network activity, the source represents the sender of the + * last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer source = 1; + * @return \Google\Rpc\Context\AttributeContext\Peer|null + */ + public function getSource() + { + return $this->source; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The source of a network activity, such as starting a TCP connection. + * In a multi hop network activity, the source represents the sender of the + * last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer source = 1; + * @param \Google\Rpc\Context\AttributeContext\Peer $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Peer::class); + $this->source = $var; + + return $this; + } + + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer destination = 2; + * @return \Google\Rpc\Context\AttributeContext\Peer|null + */ + public function getDestination() + { + return $this->destination; + } + + public function hasDestination() + { + return isset($this->destination); + } + + public function clearDestination() + { + unset($this->destination); + } + + /** + * The destination of a network activity, such as accepting a TCP connection. + * In a multi hop network activity, the destination represents the receiver of + * the last hop. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Peer destination = 2; + * @param \Google\Rpc\Context\AttributeContext\Peer $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Peer::class); + $this->destination = $var; + + return $this; + } + + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Request request = 3; + * @return \Google\Rpc\Context\AttributeContext\Request|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Represents a network request, such as an HTTP request. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Request request = 3; + * @param \Google\Rpc\Context\AttributeContext\Request $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Request::class); + $this->request = $var; + + return $this; + } + + /** + * Represents a network response, such as an HTTP response. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Response response = 4; + * @return \Google\Rpc\Context\AttributeContext\Response|null + */ + public function getResponse() + { + return $this->response; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Represents a network response, such as an HTTP response. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Response response = 4; + * @param \Google\Rpc\Context\AttributeContext\Response $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Response::class); + $this->response = $var; + + return $this; + } + + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Resource resource = 5; + * @return \Google\Rpc\Context\AttributeContext\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Represents a target resource that is involved with a network activity. + * If multiple resources are involved with an activity, this must be the + * primary one. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Resource resource = 5; + * @param \Google\Rpc\Context\AttributeContext\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * Represents an API operation that is involved to a network activity. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Api api = 6; + * @return \Google\Rpc\Context\AttributeContext\Api|null + */ + public function getApi() + { + return $this->api; + } + + public function hasApi() + { + return isset($this->api); + } + + public function clearApi() + { + unset($this->api); + } + + /** + * Represents an API operation that is involved to a network activity. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Api api = 6; + * @param \Google\Rpc\Context\AttributeContext\Api $var + * @return $this + */ + public function setApi($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Api::class); + $this->api = $var; + + return $this; + } + + /** + * Supports extensions for advanced use cases, such as logs and metrics. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Supports extensions for advanced use cases, such as logs and metrics. + * + * Generated from protobuf field repeated .google.protobuf.Any extensions = 8; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->extensions = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Api.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Api.php new file mode 100644 index 0000000..5cba422 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Api.php @@ -0,0 +1,196 @@ +google.rpc.context.AttributeContext.Api + */ +class Api extends \Google\Protobuf\Internal\Message +{ + /** + * The API service name. It is a logical identifier for a networked API, + * such as "pubsub.googleapis.com". The naming syntax depends on the + * API management system being used for handling the request. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * The API operation name. For gRPC requests, it is the fully qualified API + * method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI + * requests, it is the `operationId`, such as "getPet". + * + * Generated from protobuf field string operation = 2; + */ + protected $operation = ''; + /** + * The API protocol used for sending the request, such as "http", "https", + * "grpc", or "internal". + * + * Generated from protobuf field string protocol = 3; + */ + protected $protocol = ''; + /** + * The API version associated with the API operation above, such as "v1" or + * "v1alpha1". + * + * Generated from protobuf field string version = 4; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The API service name. It is a logical identifier for a networked API, + * such as "pubsub.googleapis.com". The naming syntax depends on the + * API management system being used for handling the request. + * @type string $operation + * The API operation name. For gRPC requests, it is the fully qualified API + * method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI + * requests, it is the `operationId`, such as "getPet". + * @type string $protocol + * The API protocol used for sending the request, such as "http", "https", + * "grpc", or "internal". + * @type string $version + * The API version associated with the API operation above, such as "v1" or + * "v1alpha1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The API service name. It is a logical identifier for a networked API, + * such as "pubsub.googleapis.com". The naming syntax depends on the + * API management system being used for handling the request. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * The API service name. It is a logical identifier for a networked API, + * such as "pubsub.googleapis.com". The naming syntax depends on the + * API management system being used for handling the request. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * The API operation name. For gRPC requests, it is the fully qualified API + * method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI + * requests, it is the `operationId`, such as "getPet". + * + * Generated from protobuf field string operation = 2; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * The API operation name. For gRPC requests, it is the fully qualified API + * method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI + * requests, it is the `operationId`, such as "getPet". + * + * Generated from protobuf field string operation = 2; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + + /** + * The API protocol used for sending the request, such as "http", "https", + * "grpc", or "internal". + * + * Generated from protobuf field string protocol = 3; + * @return string + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * The API protocol used for sending the request, such as "http", "https", + * "grpc", or "internal". + * + * Generated from protobuf field string protocol = 3; + * @param string $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkString($var, True); + $this->protocol = $var; + + return $this; + } + + /** + * The API version associated with the API operation above, such as "v1" or + * "v1alpha1". + * + * Generated from protobuf field string version = 4; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The API version associated with the API operation above, such as "v1" or + * "v1alpha1". + * + * Generated from protobuf field string version = 4; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Auth.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Auth.php new file mode 100644 index 0000000..dd42490 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Auth.php @@ -0,0 +1,356 @@ +google.rpc.context.AttributeContext.Auth + */ +class Auth extends \Google\Protobuf\Internal\Message +{ + /** + * The authenticated principal. Reflects the issuer (`iss`) and subject + * (`sub`) claims within a JWT. The issuer and subject should be `/` + * delimited, with `/` percent-encoded within the subject fragment. For + * Google accounts, the principal format is: + * "https://accounts.google.com/{id}" + * + * Generated from protobuf field string principal = 1; + */ + protected $principal = ''; + /** + * The intended audience(s) for this authentication information. Reflects + * the audience (`aud`) claim within a JWT. The audience + * value(s) depends on the `issuer`, but typically include one or more of + * the following pieces of information: + * * The services intended to receive the credential. For example, + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * * A set of service-based scopes. For example, + * ["https://www.googleapis.com/auth/cloud-platform"]. + * * The client id of an app, such as the Firebase project id for JWTs + * from Firebase Auth. + * Consult the documentation for the credential issuer to determine the + * information provided. + * + * Generated from protobuf field repeated string audiences = 2; + */ + private $audiences; + /** + * The authorized presenter of the credential. Reflects the optional + * Authorized Presenter (`azp`) claim within a JWT or the + * OAuth client id. For example, a Google Cloud Platform client id looks + * as follows: "123456789012.apps.googleusercontent.com". + * + * Generated from protobuf field string presenter = 3; + */ + protected $presenter = ''; + /** + * Structured claims presented with the credential. JWTs include + * `{key: value}` pairs for standard and private claims. The following + * is a subset of the standard required and optional claims that would + * typically be presented for a Google-based JWT: + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * SAML assertions are similarly specified, but with an identity provider + * dependent structure. + * + * Generated from protobuf field .google.protobuf.Struct claims = 4; + */ + protected $claims = null; + /** + * A list of access level resource names that allow resources to be + * accessed by authenticated requester. It is part of Secure GCP processing + * for the incoming request. An access level string has the format: + * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * Example: + * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" + * + * Generated from protobuf field repeated string access_levels = 5; + */ + private $access_levels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $principal + * The authenticated principal. Reflects the issuer (`iss`) and subject + * (`sub`) claims within a JWT. The issuer and subject should be `/` + * delimited, with `/` percent-encoded within the subject fragment. For + * Google accounts, the principal format is: + * "https://accounts.google.com/{id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $audiences + * The intended audience(s) for this authentication information. Reflects + * the audience (`aud`) claim within a JWT. The audience + * value(s) depends on the `issuer`, but typically include one or more of + * the following pieces of information: + * * The services intended to receive the credential. For example, + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * * A set of service-based scopes. For example, + * ["https://www.googleapis.com/auth/cloud-platform"]. + * * The client id of an app, such as the Firebase project id for JWTs + * from Firebase Auth. + * Consult the documentation for the credential issuer to determine the + * information provided. + * @type string $presenter + * The authorized presenter of the credential. Reflects the optional + * Authorized Presenter (`azp`) claim within a JWT or the + * OAuth client id. For example, a Google Cloud Platform client id looks + * as follows: "123456789012.apps.googleusercontent.com". + * @type \Google\Protobuf\Struct $claims + * Structured claims presented with the credential. JWTs include + * `{key: value}` pairs for standard and private claims. The following + * is a subset of the standard required and optional claims that would + * typically be presented for a Google-based JWT: + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * SAML assertions are similarly specified, but with an identity provider + * dependent structure. + * @type array|\Google\Protobuf\Internal\RepeatedField $access_levels + * A list of access level resource names that allow resources to be + * accessed by authenticated requester. It is part of Secure GCP processing + * for the incoming request. An access level string has the format: + * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * Example: + * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The authenticated principal. Reflects the issuer (`iss`) and subject + * (`sub`) claims within a JWT. The issuer and subject should be `/` + * delimited, with `/` percent-encoded within the subject fragment. For + * Google accounts, the principal format is: + * "https://accounts.google.com/{id}" + * + * Generated from protobuf field string principal = 1; + * @return string + */ + public function getPrincipal() + { + return $this->principal; + } + + /** + * The authenticated principal. Reflects the issuer (`iss`) and subject + * (`sub`) claims within a JWT. The issuer and subject should be `/` + * delimited, with `/` percent-encoded within the subject fragment. For + * Google accounts, the principal format is: + * "https://accounts.google.com/{id}" + * + * Generated from protobuf field string principal = 1; + * @param string $var + * @return $this + */ + public function setPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->principal = $var; + + return $this; + } + + /** + * The intended audience(s) for this authentication information. Reflects + * the audience (`aud`) claim within a JWT. The audience + * value(s) depends on the `issuer`, but typically include one or more of + * the following pieces of information: + * * The services intended to receive the credential. For example, + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * * A set of service-based scopes. For example, + * ["https://www.googleapis.com/auth/cloud-platform"]. + * * The client id of an app, such as the Firebase project id for JWTs + * from Firebase Auth. + * Consult the documentation for the credential issuer to determine the + * information provided. + * + * Generated from protobuf field repeated string audiences = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAudiences() + { + return $this->audiences; + } + + /** + * The intended audience(s) for this authentication information. Reflects + * the audience (`aud`) claim within a JWT. The audience + * value(s) depends on the `issuer`, but typically include one or more of + * the following pieces of information: + * * The services intended to receive the credential. For example, + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * * A set of service-based scopes. For example, + * ["https://www.googleapis.com/auth/cloud-platform"]. + * * The client id of an app, such as the Firebase project id for JWTs + * from Firebase Auth. + * Consult the documentation for the credential issuer to determine the + * information provided. + * + * Generated from protobuf field repeated string audiences = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAudiences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->audiences = $arr; + + return $this; + } + + /** + * The authorized presenter of the credential. Reflects the optional + * Authorized Presenter (`azp`) claim within a JWT or the + * OAuth client id. For example, a Google Cloud Platform client id looks + * as follows: "123456789012.apps.googleusercontent.com". + * + * Generated from protobuf field string presenter = 3; + * @return string + */ + public function getPresenter() + { + return $this->presenter; + } + + /** + * The authorized presenter of the credential. Reflects the optional + * Authorized Presenter (`azp`) claim within a JWT or the + * OAuth client id. For example, a Google Cloud Platform client id looks + * as follows: "123456789012.apps.googleusercontent.com". + * + * Generated from protobuf field string presenter = 3; + * @param string $var + * @return $this + */ + public function setPresenter($var) + { + GPBUtil::checkString($var, True); + $this->presenter = $var; + + return $this; + } + + /** + * Structured claims presented with the credential. JWTs include + * `{key: value}` pairs for standard and private claims. The following + * is a subset of the standard required and optional claims that would + * typically be presented for a Google-based JWT: + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * SAML assertions are similarly specified, but with an identity provider + * dependent structure. + * + * Generated from protobuf field .google.protobuf.Struct claims = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getClaims() + { + return $this->claims; + } + + public function hasClaims() + { + return isset($this->claims); + } + + public function clearClaims() + { + unset($this->claims); + } + + /** + * Structured claims presented with the credential. JWTs include + * `{key: value}` pairs for standard and private claims. The following + * is a subset of the standard required and optional claims that would + * typically be presented for a Google-based JWT: + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * SAML assertions are similarly specified, but with an identity provider + * dependent structure. + * + * Generated from protobuf field .google.protobuf.Struct claims = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setClaims($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->claims = $var; + + return $this; + } + + /** + * A list of access level resource names that allow resources to be + * accessed by authenticated requester. It is part of Secure GCP processing + * for the incoming request. An access level string has the format: + * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * Example: + * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" + * + * Generated from protobuf field repeated string access_levels = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessLevels() + { + return $this->access_levels; + } + + /** + * A list of access level resource names that allow resources to be + * accessed by authenticated requester. It is part of Secure GCP processing + * for the incoming request. An access level string has the format: + * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * Example: + * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" + * + * Generated from protobuf field repeated string access_levels = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessLevels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->access_levels = $arr; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Peer.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Peer.php new file mode 100644 index 0000000..9d3e1b6 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Peer.php @@ -0,0 +1,223 @@ +google.rpc.context.AttributeContext.Peer + */ +class Peer extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address of the peer. + * + * Generated from protobuf field string ip = 1; + */ + protected $ip = ''; + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + */ + protected $port = 0; + /** + * The labels associated with the peer. + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * The identity of this peer. Similar to `Request.auth.principal`, but + * relative to the peer instead of the request. For example, the + * identity associated with a load balancer that forwarded the request. + * + * Generated from protobuf field string principal = 7; + */ + protected $principal = ''; + /** + * The CLDR country/region code associated with the above IP address. + * If the IP address is private, the `region_code` should reflect the + * physical location where this peer is running. + * + * Generated from protobuf field string region_code = 8; + */ + protected $region_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip + * The IP address of the peer. + * @type int|string $port + * The network port of the peer. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels associated with the peer. + * @type string $principal + * The identity of this peer. Similar to `Request.auth.principal`, but + * relative to the peer instead of the request. For example, the + * identity associated with a load balancer that forwarded the request. + * @type string $region_code + * The CLDR country/region code associated with the above IP address. + * If the IP address is private, the `region_code` should reflect the + * physical location where this peer is running. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The IP address of the peer. + * + * Generated from protobuf field string ip = 1; + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * The IP address of the peer. + * + * Generated from protobuf field string ip = 1; + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + * @return int|string + */ + public function getPort() + { + return $this->port; + } + + /** + * The network port of the peer. + * + * Generated from protobuf field int64 port = 2; + * @param int|string $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt64($var); + $this->port = $var; + + return $this; + } + + /** + * The labels associated with the peer. + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels associated with the peer. + * + * Generated from protobuf field map labels = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The identity of this peer. Similar to `Request.auth.principal`, but + * relative to the peer instead of the request. For example, the + * identity associated with a load balancer that forwarded the request. + * + * Generated from protobuf field string principal = 7; + * @return string + */ + public function getPrincipal() + { + return $this->principal; + } + + /** + * The identity of this peer. Similar to `Request.auth.principal`, but + * relative to the peer instead of the request. For example, the + * identity associated with a load balancer that forwarded the request. + * + * Generated from protobuf field string principal = 7; + * @param string $var + * @return $this + */ + public function setPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->principal = $var; + + return $this; + } + + /** + * The CLDR country/region code associated with the above IP address. + * If the IP address is private, the `region_code` should reflect the + * physical location where this peer is running. + * + * Generated from protobuf field string region_code = 8; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * The CLDR country/region code associated with the above IP address. + * If the IP address is private, the `region_code` should reflect the + * physical location where this peer is running. + * + * Generated from protobuf field string region_code = 8; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Request.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Request.php new file mode 100644 index 0000000..928794a --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Request.php @@ -0,0 +1,508 @@ +google.rpc.context.AttributeContext.Request + */ +class Request extends \Google\Protobuf\Internal\Message +{ + /** + * The unique ID for a request, which can be propagated to downstream + * systems. The ID should have low probability of collision + * within a single day for a specific service. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The HTTP request method, such as `GET`, `POST`. + * + * Generated from protobuf field string method = 2; + */ + protected $method = ''; + /** + * The HTTP request headers. If multiple headers share the same key, they + * must be merged according to the HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * The HTTP URL path, excluding the query parameters. + * + * Generated from protobuf field string path = 4; + */ + protected $path = ''; + /** + * The HTTP request `Host` header value. + * + * Generated from protobuf field string host = 5; + */ + protected $host = ''; + /** + * The HTTP URL scheme, such as `http` and `https`. + * + * Generated from protobuf field string scheme = 6; + */ + protected $scheme = ''; + /** + * The HTTP URL query in the format of `name1=value1&name2=value2`, as it + * appears in the first line of the HTTP request. No decoding is performed. + * + * Generated from protobuf field string query = 7; + */ + protected $query = ''; + /** + * The timestamp when the `destination` service receives the last byte of + * the request. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 9; + */ + protected $time = null; + /** + * The HTTP request size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 10; + */ + protected $size = 0; + /** + * The network protocol used with the request, such as "http/1.1", + * "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for details. + * + * Generated from protobuf field string protocol = 11; + */ + protected $protocol = ''; + /** + * A special parameter for request reason. It is used by security systems + * to associate auditing information with a request. + * + * Generated from protobuf field string reason = 12; + */ + protected $reason = ''; + /** + * The request authentication. May be absent for unauthenticated requests. + * Derived from the HTTP request `Authorization` header or equivalent. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Auth auth = 13; + */ + protected $auth = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The unique ID for a request, which can be propagated to downstream + * systems. The ID should have low probability of collision + * within a single day for a specific service. + * @type string $method + * The HTTP request method, such as `GET`, `POST`. + * @type array|\Google\Protobuf\Internal\MapField $headers + * The HTTP request headers. If multiple headers share the same key, they + * must be merged according to the HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * @type string $path + * The HTTP URL path, excluding the query parameters. + * @type string $host + * The HTTP request `Host` header value. + * @type string $scheme + * The HTTP URL scheme, such as `http` and `https`. + * @type string $query + * The HTTP URL query in the format of `name1=value1&name2=value2`, as it + * appears in the first line of the HTTP request. No decoding is performed. + * @type \Google\Protobuf\Timestamp $time + * The timestamp when the `destination` service receives the last byte of + * the request. + * @type int|string $size + * The HTTP request size in bytes. If unknown, it must be -1. + * @type string $protocol + * The network protocol used with the request, such as "http/1.1", + * "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for details. + * @type string $reason + * A special parameter for request reason. It is used by security systems + * to associate auditing information with a request. + * @type \Google\Rpc\Context\AttributeContext\Auth $auth + * The request authentication. May be absent for unauthenticated requests. + * Derived from the HTTP request `Authorization` header or equivalent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The unique ID for a request, which can be propagated to downstream + * systems. The ID should have low probability of collision + * within a single day for a specific service. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The unique ID for a request, which can be propagated to downstream + * systems. The ID should have low probability of collision + * within a single day for a specific service. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The HTTP request method, such as `GET`, `POST`. + * + * Generated from protobuf field string method = 2; + * @return string + */ + public function getMethod() + { + return $this->method; + } + + /** + * The HTTP request method, such as `GET`, `POST`. + * + * Generated from protobuf field string method = 2; + * @param string $var + * @return $this + */ + public function setMethod($var) + { + GPBUtil::checkString($var, True); + $this->method = $var; + + return $this; + } + + /** + * The HTTP request headers. If multiple headers share the same key, they + * must be merged according to the HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * The HTTP request headers. If multiple headers share the same key, they + * must be merged according to the HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * The HTTP URL path, excluding the query parameters. + * + * Generated from protobuf field string path = 4; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * The HTTP URL path, excluding the query parameters. + * + * Generated from protobuf field string path = 4; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * The HTTP request `Host` header value. + * + * Generated from protobuf field string host = 5; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * The HTTP request `Host` header value. + * + * Generated from protobuf field string host = 5; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * The HTTP URL scheme, such as `http` and `https`. + * + * Generated from protobuf field string scheme = 6; + * @return string + */ + public function getScheme() + { + return $this->scheme; + } + + /** + * The HTTP URL scheme, such as `http` and `https`. + * + * Generated from protobuf field string scheme = 6; + * @param string $var + * @return $this + */ + public function setScheme($var) + { + GPBUtil::checkString($var, True); + $this->scheme = $var; + + return $this; + } + + /** + * The HTTP URL query in the format of `name1=value1&name2=value2`, as it + * appears in the first line of the HTTP request. No decoding is performed. + * + * Generated from protobuf field string query = 7; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The HTTP URL query in the format of `name1=value1&name2=value2`, as it + * appears in the first line of the HTTP request. No decoding is performed. + * + * Generated from protobuf field string query = 7; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The timestamp when the `destination` service receives the last byte of + * the request. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 9; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->time; + } + + public function hasTime() + { + return isset($this->time); + } + + public function clearTime() + { + unset($this->time); + } + + /** + * The timestamp when the `destination` service receives the last byte of + * the request. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 9; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->time = $var; + + return $this; + } + + /** + * The HTTP request size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 10; + * @return int|string + */ + public function getSize() + { + return $this->size; + } + + /** + * The HTTP request size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 10; + * @param int|string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt64($var); + $this->size = $var; + + return $this; + } + + /** + * The network protocol used with the request, such as "http/1.1", + * "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for details. + * + * Generated from protobuf field string protocol = 11; + * @return string + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * The network protocol used with the request, such as "http/1.1", + * "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + * for details. + * + * Generated from protobuf field string protocol = 11; + * @param string $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkString($var, True); + $this->protocol = $var; + + return $this; + } + + /** + * A special parameter for request reason. It is used by security systems + * to associate auditing information with a request. + * + * Generated from protobuf field string reason = 12; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * A special parameter for request reason. It is used by security systems + * to associate auditing information with a request. + * + * Generated from protobuf field string reason = 12; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * The request authentication. May be absent for unauthenticated requests. + * Derived from the HTTP request `Authorization` header or equivalent. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Auth auth = 13; + * @return \Google\Rpc\Context\AttributeContext\Auth|null + */ + public function getAuth() + { + return $this->auth; + } + + public function hasAuth() + { + return isset($this->auth); + } + + public function clearAuth() + { + unset($this->auth); + } + + /** + * The request authentication. May be absent for unauthenticated requests. + * Derived from the HTTP request `Authorization` header or equivalent. + * + * Generated from protobuf field .google.rpc.context.AttributeContext.Auth auth = 13; + * @param \Google\Rpc\Context\AttributeContext\Auth $var + * @return $this + */ + public function setAuth($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Context\AttributeContext\Auth::class); + $this->auth = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php new file mode 100644 index 0000000..4c10424 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php @@ -0,0 +1,614 @@ +google.rpc.context.AttributeContext.Resource + */ +class Resource extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the service that this resource belongs to, such as + * `pubsub.googleapis.com`. The service may be different from the DNS + * hostname that actually serves the request. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as "//{resource.service}/{resource.name}". + * The differences between a resource name and a URI are: + * * Resource name is a logical identifier, independent of network + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * * URI often includes protocol and version information, so it can + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * See https://cloud.google.com/apis/design/resource_names for details. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The type of the resource. The syntax is platform-specific because + * different platforms define their resources differently. + * For Google APIs, the type format must be "{service}/{kind}", such as + * "pubsub.googleapis.com/Topic". + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * The labels or tags on the resource, such as AWS resource tags and + * Kubernetes resource labels. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * The unique identifier of the resource. UID is unique in the time + * and space for this resource within the scope of the service. It is + * typically generated by the server on successful creation of a resource + * and must not be changed. UID is used to uniquely identify resources + * with resource name reuses. This should be a UUID4. + * + * Generated from protobuf field string uid = 5; + */ + protected $uid = ''; + /** + * Annotations is an unstructured key-value map stored with a resource that + * may be set by external tools to store and retrieve arbitrary metadata. + * They are not queryable and should be preserved when modifying objects. + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + * + * Generated from protobuf field map annotations = 6; + */ + private $annotations; + /** + * Mutable. The display name set by clients. Must be <= 63 characters. + * + * Generated from protobuf field string display_name = 7; + */ + protected $display_name = ''; + /** + * Output only. The timestamp when the resource was created. This may + * be either the time creation was initiated or when it was completed. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was last updated. Any + * change to the resource made by users must refresh this value. + * Changes to a resource made by the service should refresh this value. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9; + */ + protected $update_time = null; + /** + * Output only. The timestamp when the resource was deleted. + * If the resource is not deleted, this must be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 10; + */ + protected $delete_time = null; + /** + * Output only. An opaque value that uniquely identifies a version or + * generation of a resource. It can be used to confirm that the client + * and server agree on the ordering of a resource being written. + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Immutable. The location of the resource. The location encoding is + * specific to the service provider, and new encoding may be introduced + * as the service evolves. + * For Google Cloud products, the encoding is what is used by Google Cloud + * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The + * semantics of `location` is identical to the + * `cloud.googleapis.com/location` label used by some Google Cloud APIs. + * + * Generated from protobuf field string location = 12; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The name of the service that this resource belongs to, such as + * `pubsub.googleapis.com`. The service may be different from the DNS + * hostname that actually serves the request. + * @type string $name + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as "//{resource.service}/{resource.name}". + * The differences between a resource name and a URI are: + * * Resource name is a logical identifier, independent of network + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * * URI often includes protocol and version information, so it can + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * See https://cloud.google.com/apis/design/resource_names for details. + * @type string $type + * The type of the resource. The syntax is platform-specific because + * different platforms define their resources differently. + * For Google APIs, the type format must be "{service}/{kind}", such as + * "pubsub.googleapis.com/Topic". + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels or tags on the resource, such as AWS resource tags and + * Kubernetes resource labels. + * @type string $uid + * The unique identifier of the resource. UID is unique in the time + * and space for this resource within the scope of the service. It is + * typically generated by the server on successful creation of a resource + * and must not be changed. UID is used to uniquely identify resources + * with resource name reuses. This should be a UUID4. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations is an unstructured key-value map stored with a resource that + * may be set by external tools to store and retrieve arbitrary metadata. + * They are not queryable and should be preserved when modifying objects. + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + * @type string $display_name + * Mutable. The display name set by clients. Must be <= 63 characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. This may + * be either the time creation was initiated or when it was completed. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was last updated. Any + * change to the resource made by users must refresh this value. + * Changes to a resource made by the service should refresh this value. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The timestamp when the resource was deleted. + * If the resource is not deleted, this must be empty. + * @type string $etag + * Output only. An opaque value that uniquely identifies a version or + * generation of a resource. It can be used to confirm that the client + * and server agree on the ordering of a resource being written. + * @type string $location + * Immutable. The location of the resource. The location encoding is + * specific to the service provider, and new encoding may be introduced + * as the service evolves. + * For Google Cloud products, the encoding is what is used by Google Cloud + * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The + * semantics of `location` is identical to the + * `cloud.googleapis.com/location` label used by some Google Cloud APIs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The name of the service that this resource belongs to, such as + * `pubsub.googleapis.com`. The service may be different from the DNS + * hostname that actually serves the request. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * The name of the service that this resource belongs to, such as + * `pubsub.googleapis.com`. The service may be different from the DNS + * hostname that actually serves the request. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as "//{resource.service}/{resource.name}". + * The differences between a resource name and a URI are: + * * Resource name is a logical identifier, independent of network + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * * URI often includes protocol and version information, so it can + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * See https://cloud.google.com/apis/design/resource_names for details. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The stable identifier (name) of a resource on the `service`. A resource + * can be logically identified as "//{resource.service}/{resource.name}". + * The differences between a resource name and a URI are: + * * Resource name is a logical identifier, independent of network + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * * URI often includes protocol and version information, so it can + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * See https://cloud.google.com/apis/design/resource_names for details. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the resource. The syntax is platform-specific because + * different platforms define their resources differently. + * For Google APIs, the type format must be "{service}/{kind}", such as + * "pubsub.googleapis.com/Topic". + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the resource. The syntax is platform-specific because + * different platforms define their resources differently. + * For Google APIs, the type format must be "{service}/{kind}", such as + * "pubsub.googleapis.com/Topic". + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The labels or tags on the resource, such as AWS resource tags and + * Kubernetes resource labels. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels or tags on the resource, such as AWS resource tags and + * Kubernetes resource labels. + * + * Generated from protobuf field map labels = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The unique identifier of the resource. UID is unique in the time + * and space for this resource within the scope of the service. It is + * typically generated by the server on successful creation of a resource + * and must not be changed. UID is used to uniquely identify resources + * with resource name reuses. This should be a UUID4. + * + * Generated from protobuf field string uid = 5; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * The unique identifier of the resource. UID is unique in the time + * and space for this resource within the scope of the service. It is + * typically generated by the server on successful creation of a resource + * and must not be changed. UID is used to uniquely identify resources + * with resource name reuses. This should be a UUID4. + * + * Generated from protobuf field string uid = 5; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Annotations is an unstructured key-value map stored with a resource that + * may be set by external tools to store and retrieve arbitrary metadata. + * They are not queryable and should be preserved when modifying objects. + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + * + * Generated from protobuf field map annotations = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations is an unstructured key-value map stored with a resource that + * may be set by external tools to store and retrieve arbitrary metadata. + * They are not queryable and should be preserved when modifying objects. + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + * + * Generated from protobuf field map annotations = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Mutable. The display name set by clients. Must be <= 63 characters. + * + * Generated from protobuf field string display_name = 7; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Mutable. The display name set by clients. Must be <= 63 characters. + * + * Generated from protobuf field string display_name = 7; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. This may + * be either the time creation was initiated or when it was completed. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. This may + * be either the time creation was initiated or when it was completed. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was last updated. Any + * change to the resource made by users must refresh this value. + * Changes to a resource made by the service should refresh this value. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was last updated. Any + * change to the resource made by users must refresh this value. + * Changes to a resource made by the service should refresh this value. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was deleted. + * If the resource is not deleted, this must be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The timestamp when the resource was deleted. + * If the resource is not deleted, this must be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. An opaque value that uniquely identifies a version or + * generation of a resource. It can be used to confirm that the client + * and server agree on the ordering of a resource being written. + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. An opaque value that uniquely identifies a version or + * generation of a resource. It can be used to confirm that the client + * and server agree on the ordering of a resource being written. + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Immutable. The location of the resource. The location encoding is + * specific to the service provider, and new encoding may be introduced + * as the service evolves. + * For Google Cloud products, the encoding is what is used by Google Cloud + * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The + * semantics of `location` is identical to the + * `cloud.googleapis.com/location` label used by some Google Cloud APIs. + * + * Generated from protobuf field string location = 12; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Immutable. The location of the resource. The location encoding is + * specific to the service provider, and new encoding may be introduced + * as the service evolves. + * For Google Cloud products, the encoding is what is used by Google Cloud + * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The + * semantics of `location` is identical to the + * `cloud.googleapis.com/location` label used by some Google Cloud APIs. + * + * Generated from protobuf field string location = 12; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Response.php b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Response.php new file mode 100644 index 0000000..c632cf4 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Response.php @@ -0,0 +1,249 @@ +google.rpc.context.AttributeContext.Response + */ +class Response extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP response status code, such as `200` and `404`. + * + * Generated from protobuf field int64 code = 1; + */ + protected $code = 0; + /** + * The HTTP response size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 2; + */ + protected $size = 0; + /** + * The HTTP response headers. If multiple headers share the same key, they + * must be merged according to HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * The timestamp when the `destination` service sends the last byte of + * the response. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + */ + protected $time = null; + /** + * The amount of time it takes the backend service to fully respond to a + * request. Measured from when the destination service starts to send the + * request to the backend until when the destination service receives the + * complete response from the backend. + * + * Generated from protobuf field .google.protobuf.Duration backend_latency = 5; + */ + protected $backend_latency = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $code + * The HTTP response status code, such as `200` and `404`. + * @type int|string $size + * The HTTP response size in bytes. If unknown, it must be -1. + * @type array|\Google\Protobuf\Internal\MapField $headers + * The HTTP response headers. If multiple headers share the same key, they + * must be merged according to HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * @type \Google\Protobuf\Timestamp $time + * The timestamp when the `destination` service sends the last byte of + * the response. + * @type \Google\Protobuf\Duration $backend_latency + * The amount of time it takes the backend service to fully respond to a + * request. Measured from when the destination service starts to send the + * request to the backend until when the destination service receives the + * complete response from the backend. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AttributeContext::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP response status code, such as `200` and `404`. + * + * Generated from protobuf field int64 code = 1; + * @return int|string + */ + public function getCode() + { + return $this->code; + } + + /** + * The HTTP response status code, such as `200` and `404`. + * + * Generated from protobuf field int64 code = 1; + * @param int|string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt64($var); + $this->code = $var; + + return $this; + } + + /** + * The HTTP response size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 2; + * @return int|string + */ + public function getSize() + { + return $this->size; + } + + /** + * The HTTP response size in bytes. If unknown, it must be -1. + * + * Generated from protobuf field int64 size = 2; + * @param int|string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt64($var); + $this->size = $var; + + return $this; + } + + /** + * The HTTP response headers. If multiple headers share the same key, they + * must be merged according to HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * The HTTP response headers. If multiple headers share the same key, they + * must be merged according to HTTP spec. All header keys must be + * lowercased, because HTTP header keys are case-insensitive. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * The timestamp when the `destination` service sends the last byte of + * the response. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->time; + } + + public function hasTime() + { + return isset($this->time); + } + + public function clearTime() + { + unset($this->time); + } + + /** + * The timestamp when the `destination` service sends the last byte of + * the response. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->time = $var; + + return $this; + } + + /** + * The amount of time it takes the backend service to fully respond to a + * request. Measured from when the destination service starts to send the + * request to the backend until when the destination service receives the + * complete response from the backend. + * + * Generated from protobuf field .google.protobuf.Duration backend_latency = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getBackendLatency() + { + return $this->backend_latency; + } + + public function hasBackendLatency() + { + return isset($this->backend_latency); + } + + public function clearBackendLatency() + { + unset($this->backend_latency); + } + + /** + * The amount of time it takes the backend service to fully respond to a + * request. Measured from when the destination service starts to send the + * request to the backend until when the destination service receives the + * complete response from the backend. + * + * Generated from protobuf field .google.protobuf.Duration backend_latency = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackendLatency($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backend_latency = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/Context/AuditContext.php b/vendor/google/common-protos/src/Rpc/Context/AuditContext.php new file mode 100644 index 0000000..3e9588a --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Context/AuditContext.php @@ -0,0 +1,247 @@ +google.rpc.context.AuditContext + */ +class AuditContext extends \Google\Protobuf\Internal\Message +{ + /** + * Serialized audit log. + * + * Generated from protobuf field bytes audit_log = 1; + */ + protected $audit_log = ''; + /** + * An API request message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_request = 2; + */ + protected $scrubbed_request = null; + /** + * An API response message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_response = 3; + */ + protected $scrubbed_response = null; + /** + * Number of scrubbed response items. + * + * Generated from protobuf field int32 scrubbed_response_item_count = 4; + */ + protected $scrubbed_response_item_count = 0; + /** + * Audit resource name which is scrubbed. + * + * Generated from protobuf field string target_resource = 5; + */ + protected $target_resource = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $audit_log + * Serialized audit log. + * @type \Google\Protobuf\Struct $scrubbed_request + * An API request message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * @type \Google\Protobuf\Struct $scrubbed_response + * An API response message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * @type int $scrubbed_response_item_count + * Number of scrubbed response items. + * @type string $target_resource + * Audit resource name which is scrubbed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Context\AuditContext::initOnce(); + parent::__construct($data); + } + + /** + * Serialized audit log. + * + * Generated from protobuf field bytes audit_log = 1; + * @return string + */ + public function getAuditLog() + { + return $this->audit_log; + } + + /** + * Serialized audit log. + * + * Generated from protobuf field bytes audit_log = 1; + * @param string $var + * @return $this + */ + public function setAuditLog($var) + { + GPBUtil::checkString($var, False); + $this->audit_log = $var; + + return $this; + } + + /** + * An API request message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_request = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getScrubbedRequest() + { + return $this->scrubbed_request; + } + + public function hasScrubbedRequest() + { + return isset($this->scrubbed_request); + } + + public function clearScrubbedRequest() + { + unset($this->scrubbed_request); + } + + /** + * An API request message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_request = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setScrubbedRequest($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->scrubbed_request = $var; + + return $this; + } + + /** + * An API response message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_response = 3; + * @return \Google\Protobuf\Struct|null + */ + public function getScrubbedResponse() + { + return $this->scrubbed_response; + } + + public function hasScrubbedResponse() + { + return isset($this->scrubbed_response); + } + + public function clearScrubbedResponse() + { + unset($this->scrubbed_response); + } + + /** + * An API response message that is scrubbed based on the method annotation. + * This field should only be filled if audit_log field is present. + * Service Control will use this to assemble a complete log for Cloud Audit + * Logs and Google internal audit logs. + * + * Generated from protobuf field .google.protobuf.Struct scrubbed_response = 3; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setScrubbedResponse($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->scrubbed_response = $var; + + return $this; + } + + /** + * Number of scrubbed response items. + * + * Generated from protobuf field int32 scrubbed_response_item_count = 4; + * @return int + */ + public function getScrubbedResponseItemCount() + { + return $this->scrubbed_response_item_count; + } + + /** + * Number of scrubbed response items. + * + * Generated from protobuf field int32 scrubbed_response_item_count = 4; + * @param int $var + * @return $this + */ + public function setScrubbedResponseItemCount($var) + { + GPBUtil::checkInt32($var); + $this->scrubbed_response_item_count = $var; + + return $this; + } + + /** + * Audit resource name which is scrubbed. + * + * Generated from protobuf field string target_resource = 5; + * @return string + */ + public function getTargetResource() + { + return $this->target_resource; + } + + /** + * Audit resource name which is scrubbed. + * + * Generated from protobuf field string target_resource = 5; + * @param string $var + * @return $this + */ + public function setTargetResource($var) + { + GPBUtil::checkString($var, True); + $this->target_resource = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/DebugInfo.php b/vendor/google/common-protos/src/Rpc/DebugInfo.php new file mode 100644 index 0000000..6489673 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/DebugInfo.php @@ -0,0 +1,101 @@ +google.rpc.DebugInfo + */ +class DebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The stack trace entries indicating where the error occurred. + * + * Generated from protobuf field repeated string stack_entries = 1; + */ + private $stack_entries; + /** + * Additional debugging information provided by the server. + * + * Generated from protobuf field string detail = 2; + */ + protected $detail = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $stack_entries + * The stack trace entries indicating where the error occurred. + * @type string $detail + * Additional debugging information provided by the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * The stack trace entries indicating where the error occurred. + * + * Generated from protobuf field repeated string stack_entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStackEntries() + { + return $this->stack_entries; + } + + /** + * The stack trace entries indicating where the error occurred. + * + * Generated from protobuf field repeated string stack_entries = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStackEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->stack_entries = $arr; + + return $this; + } + + /** + * Additional debugging information provided by the server. + * + * Generated from protobuf field string detail = 2; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Additional debugging information provided by the server. + * + * Generated from protobuf field string detail = 2; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/ErrorInfo.php b/vendor/google/common-protos/src/Rpc/ErrorInfo.php new file mode 100644 index 0000000..83c969c --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/ErrorInfo.php @@ -0,0 +1,217 @@ +google.rpc.ErrorInfo + */ +class ErrorInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The reason of the error. This is a constant value that identifies the + * proximate cause of the error. Error reasons are unique within a particular + * domain of errors. This should be at most 63 characters and match a + * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + * UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 1; + */ + protected $reason = ''; + /** + * The logical grouping to which the "reason" belongs. The error domain + * is typically the registered service name of the tool or product that + * generates the error. Example: "pubsub.googleapis.com". If the error is + * generated by some common infrastructure, the error domain must be a + * globally unique value that identifies the infrastructure. For Google API + * infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field string domain = 2; + */ + protected $domain = ''; + /** + * Additional structured details about this error. + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in + * length. When identifying the current value of an exceeded limit, the units + * should be contained in the key, not the value. For example, rather than + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of + * instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadata = 3; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reason + * The reason of the error. This is a constant value that identifies the + * proximate cause of the error. Error reasons are unique within a particular + * domain of errors. This should be at most 63 characters and match a + * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + * UPPER_SNAKE_CASE. + * @type string $domain + * The logical grouping to which the "reason" belongs. The error domain + * is typically the registered service name of the tool or product that + * generates the error. Example: "pubsub.googleapis.com". If the error is + * generated by some common infrastructure, the error domain must be a + * globally unique value that identifies the infrastructure. For Google API + * infrastructure, the error domain is "googleapis.com". + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional structured details about this error. + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in + * length. When identifying the current value of an exceeded limit, the units + * should be contained in the key, not the value. For example, rather than + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of + * instances that can be created in a single (batch) request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * The reason of the error. This is a constant value that identifies the + * proximate cause of the error. Error reasons are unique within a particular + * domain of errors. This should be at most 63 characters and match a + * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + * UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 1; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * The reason of the error. This is a constant value that identifies the + * proximate cause of the error. Error reasons are unique within a particular + * domain of errors. This should be at most 63 characters and match a + * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + * UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 1; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * The logical grouping to which the "reason" belongs. The error domain + * is typically the registered service name of the tool or product that + * generates the error. Example: "pubsub.googleapis.com". If the error is + * generated by some common infrastructure, the error domain must be a + * globally unique value that identifies the infrastructure. For Google API + * infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field string domain = 2; + * @return string + */ + public function getDomain() + { + return $this->domain; + } + + /** + * The logical grouping to which the "reason" belongs. The error domain + * is typically the registered service name of the tool or product that + * generates the error. Example: "pubsub.googleapis.com". If the error is + * generated by some common infrastructure, the error domain must be a + * globally unique value that identifies the infrastructure. For Google API + * infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field string domain = 2; + * @param string $var + * @return $this + */ + public function setDomain($var) + { + GPBUtil::checkString($var, True); + $this->domain = $var; + + return $this; + } + + /** + * Additional structured details about this error. + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in + * length. When identifying the current value of an exceeded limit, the units + * should be contained in the key, not the value. For example, rather than + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of + * instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadata = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional structured details about this error. + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in + * length. When identifying the current value of an exceeded limit, the units + * should be contained in the key, not the value. For example, rather than + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of + * instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadata = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/Help.php b/vendor/google/common-protos/src/Rpc/Help.php new file mode 100644 index 0000000..e01c5b2 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Help.php @@ -0,0 +1,70 @@ +google.rpc.Help + */ +class Help extends \Google\Protobuf\Internal\Message +{ + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.rpc.Help.Link links = 1; + */ + private $links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\Help\Link>|\Google\Protobuf\Internal\RepeatedField $links + * URL(s) pointing to additional information on handling the current error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.rpc.Help.Link links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.rpc.Help.Link links = 1; + * @param array<\Google\Rpc\Help\Link>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Help\Link::class); + $this->links = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/Help/Link.php b/vendor/google/common-protos/src/Rpc/Help/Link.php new file mode 100644 index 0000000..1786b3f --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Help/Link.php @@ -0,0 +1,102 @@ +google.rpc.Help.Link + */ +class Link extends \Google\Protobuf\Internal\Message +{ + /** + * Describes what the link offers. + * + * Generated from protobuf field string description = 1; + */ + protected $description = ''; + /** + * The URL of the link. + * + * Generated from protobuf field string url = 2; + */ + protected $url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Describes what the link offers. + * @type string $url + * The URL of the link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Describes what the link offers. + * + * Generated from protobuf field string description = 1; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Describes what the link offers. + * + * Generated from protobuf field string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The URL of the link. + * + * Generated from protobuf field string url = 2; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * The URL of the link. + * + * Generated from protobuf field string url = 2; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/LocalizedMessage.php b/vendor/google/common-protos/src/Rpc/LocalizedMessage.php new file mode 100644 index 0000000..e4fa20a --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/LocalizedMessage.php @@ -0,0 +1,110 @@ +google.rpc.LocalizedMessage + */ +class LocalizedMessage extends \Google\Protobuf\Internal\Message +{ + /** + * The locale used following the specification defined at + * https://www.rfc-editor.org/rfc/bcp/bcp47.txt. + * Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field string locale = 1; + */ + protected $locale = ''; + /** + * The localized error message in the above locale. + * + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $locale + * The locale used following the specification defined at + * https://www.rfc-editor.org/rfc/bcp/bcp47.txt. + * Examples are: "en-US", "fr-CH", "es-MX" + * @type string $message + * The localized error message in the above locale. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * The locale used following the specification defined at + * https://www.rfc-editor.org/rfc/bcp/bcp47.txt. + * Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field string locale = 1; + * @return string + */ + public function getLocale() + { + return $this->locale; + } + + /** + * The locale used following the specification defined at + * https://www.rfc-editor.org/rfc/bcp/bcp47.txt. + * Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field string locale = 1; + * @param string $var + * @return $this + */ + public function setLocale($var) + { + GPBUtil::checkString($var, True); + $this->locale = $var; + + return $this; + } + + /** + * The localized error message in the above locale. + * + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * The localized error message in the above locale. + * + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/PreconditionFailure.php b/vendor/google/common-protos/src/Rpc/PreconditionFailure.php new file mode 100644 index 0000000..cc82e73 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/PreconditionFailure.php @@ -0,0 +1,70 @@ +google.rpc.PreconditionFailure + */ +class PreconditionFailure extends \Google\Protobuf\Internal\Message +{ + /** + * Describes all precondition violations. + * + * Generated from protobuf field repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + private $violations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\PreconditionFailure\Violation>|\Google\Protobuf\Internal\RepeatedField $violations + * Describes all precondition violations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Describes all precondition violations. + * + * Generated from protobuf field repeated .google.rpc.PreconditionFailure.Violation violations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getViolations() + { + return $this->violations; + } + + /** + * Describes all precondition violations. + * + * Generated from protobuf field repeated .google.rpc.PreconditionFailure.Violation violations = 1; + * @param array<\Google\Rpc\PreconditionFailure\Violation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setViolations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\PreconditionFailure\Violation::class); + $this->violations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/PreconditionFailure/Violation.php b/vendor/google/common-protos/src/Rpc/PreconditionFailure/Violation.php new file mode 100644 index 0000000..df35be2 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/PreconditionFailure/Violation.php @@ -0,0 +1,160 @@ +google.rpc.PreconditionFailure.Violation + */ +class Violation extends \Google\Protobuf\Internal\Message +{ + /** + * The type of PreconditionFailure. We recommend using a service-specific + * enum type to define the supported precondition violation subjects. For + * example, "TOS" for "Terms of Service violation". + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The subject, relative to the type, that failed. + * For example, "google.com/cloud" relative to the "TOS" type would indicate + * which terms of service is being referenced. + * + * Generated from protobuf field string subject = 2; + */ + protected $subject = ''; + /** + * A description of how the precondition failed. Developers can use this + * description to understand how to fix the failure. + * For example: "Terms of service not accepted". + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The type of PreconditionFailure. We recommend using a service-specific + * enum type to define the supported precondition violation subjects. For + * example, "TOS" for "Terms of Service violation". + * @type string $subject + * The subject, relative to the type, that failed. + * For example, "google.com/cloud" relative to the "TOS" type would indicate + * which terms of service is being referenced. + * @type string $description + * A description of how the precondition failed. Developers can use this + * description to understand how to fix the failure. + * For example: "Terms of service not accepted". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * The type of PreconditionFailure. We recommend using a service-specific + * enum type to define the supported precondition violation subjects. For + * example, "TOS" for "Terms of Service violation". + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of PreconditionFailure. We recommend using a service-specific + * enum type to define the supported precondition violation subjects. For + * example, "TOS" for "Terms of Service violation". + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The subject, relative to the type, that failed. + * For example, "google.com/cloud" relative to the "TOS" type would indicate + * which terms of service is being referenced. + * + * Generated from protobuf field string subject = 2; + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * The subject, relative to the type, that failed. + * For example, "google.com/cloud" relative to the "TOS" type would indicate + * which terms of service is being referenced. + * + * Generated from protobuf field string subject = 2; + * @param string $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkString($var, True); + $this->subject = $var; + + return $this; + } + + /** + * A description of how the precondition failed. Developers can use this + * description to understand how to fix the failure. + * For example: "Terms of service not accepted". + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A description of how the precondition failed. Developers can use this + * description to understand how to fix the failure. + * For example: "Terms of service not accepted". + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/QuotaFailure.php b/vendor/google/common-protos/src/Rpc/QuotaFailure.php new file mode 100644 index 0000000..7bb6561 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/QuotaFailure.php @@ -0,0 +1,75 @@ +google.rpc.QuotaFailure + */ +class QuotaFailure extends \Google\Protobuf\Internal\Message +{ + /** + * Describes all quota violations. + * + * Generated from protobuf field repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + private $violations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\QuotaFailure\Violation>|\Google\Protobuf\Internal\RepeatedField $violations + * Describes all quota violations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Describes all quota violations. + * + * Generated from protobuf field repeated .google.rpc.QuotaFailure.Violation violations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getViolations() + { + return $this->violations; + } + + /** + * Describes all quota violations. + * + * Generated from protobuf field repeated .google.rpc.QuotaFailure.Violation violations = 1; + * @param array<\Google\Rpc\QuotaFailure\Violation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setViolations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\QuotaFailure\Violation::class); + $this->violations = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php b/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php new file mode 100644 index 0000000..5760348 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php @@ -0,0 +1,501 @@ +google.rpc.QuotaFailure.Violation + */ +class Violation extends \Google\Protobuf\Internal\Message +{ + /** + * The subject on which the quota check failed. + * For example, "clientip:" or "project:". + * + * Generated from protobuf field string subject = 1; + */ + protected $subject = ''; + /** + * A description of how the quota check failed. Clients can use this + * description to find more about the quota configuration in the service's + * public documentation, or find the relevant quota limit to adjust through + * developer console. + * For example: "Service disabled" or "Daily Limit for read operations + * exceeded". + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + */ + protected $api_service = ''; + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + */ + protected $quota_metric = ''; + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + */ + protected $quota_id = ''; + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + */ + private $quota_dimensions; + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + */ + protected $quota_value = 0; + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + */ + protected $future_quota_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subject + * The subject on which the quota check failed. + * For example, "clientip:" or "project:". + * @type string $description + * A description of how the quota check failed. Clients can use this + * description to find more about the quota configuration in the service's + * public documentation, or find the relevant quota limit to adjust through + * developer console. + * For example: "Service disabled" or "Daily Limit for read operations + * exceeded". + * @type string $api_service + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * @type string $quota_metric + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * @type string $quota_id + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * @type array|\Google\Protobuf\Internal\MapField $quota_dimensions + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * @type int|string $quota_value + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * @type int|string $future_quota_value + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * The subject on which the quota check failed. + * For example, "clientip:" or "project:". + * + * Generated from protobuf field string subject = 1; + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * The subject on which the quota check failed. + * For example, "clientip:" or "project:". + * + * Generated from protobuf field string subject = 1; + * @param string $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkString($var, True); + $this->subject = $var; + + return $this; + } + + /** + * A description of how the quota check failed. Clients can use this + * description to find more about the quota configuration in the service's + * public documentation, or find the relevant quota limit to adjust through + * developer console. + * For example: "Service disabled" or "Daily Limit for read operations + * exceeded". + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A description of how the quota check failed. Clients can use this + * description to find more about the quota configuration in the service's + * public documentation, or find the relevant quota limit to adjust through + * developer console. + * For example: "Service disabled" or "Daily Limit for read operations + * exceeded". + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + * @return string + */ + public function getApiService() + { + return $this->api_service; + } + + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + * @param string $var + * @return $this + */ + public function setApiService($var) + { + GPBUtil::checkString($var, True); + $this->api_service = $var; + + return $this; + } + + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + * @return string + */ + public function getQuotaMetric() + { + return $this->quota_metric; + } + + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + * @param string $var + * @return $this + */ + public function setQuotaMetric($var) + { + GPBUtil::checkString($var, True); + $this->quota_metric = $var; + + return $this; + } + + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + * @return string + */ + public function getQuotaId() + { + return $this->quota_id; + } + + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + * @param string $var + * @return $this + */ + public function setQuotaId($var) + { + GPBUtil::checkString($var, True); + $this->quota_id = $var; + + return $this; + } + + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getQuotaDimensions() + { + return $this->quota_dimensions; + } + + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setQuotaDimensions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->quota_dimensions = $arr; + + return $this; + } + + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + * @return int|string + */ + public function getQuotaValue() + { + return $this->quota_value; + } + + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + * @param int|string $var + * @return $this + */ + public function setQuotaValue($var) + { + GPBUtil::checkInt64($var); + $this->quota_value = $var; + + return $this; + } + + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + * @return int|string + */ + public function getFutureQuotaValue() + { + return isset($this->future_quota_value) ? $this->future_quota_value : 0; + } + + public function hasFutureQuotaValue() + { + return isset($this->future_quota_value); + } + + public function clearFutureQuotaValue() + { + unset($this->future_quota_value); + } + + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + * @param int|string $var + * @return $this + */ + public function setFutureQuotaValue($var) + { + GPBUtil::checkInt64($var); + $this->future_quota_value = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Rpc/RequestInfo.php b/vendor/google/common-protos/src/Rpc/RequestInfo.php new file mode 100644 index 0000000..effe01d --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/RequestInfo.php @@ -0,0 +1,110 @@ +google.rpc.RequestInfo + */ +class RequestInfo extends \Google\Protobuf\Internal\Message +{ + /** + * An opaque string that should only be interpreted by the service generating + * it. For example, it can be used to identify requests in the service's logs. + * + * Generated from protobuf field string request_id = 1; + */ + protected $request_id = ''; + /** + * Any data that was used to serve this request. For example, an encrypted + * stack trace that can be sent back to the service provider for debugging. + * + * Generated from protobuf field string serving_data = 2; + */ + protected $serving_data = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $request_id + * An opaque string that should only be interpreted by the service generating + * it. For example, it can be used to identify requests in the service's logs. + * @type string $serving_data + * Any data that was used to serve this request. For example, an encrypted + * stack trace that can be sent back to the service provider for debugging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * An opaque string that should only be interpreted by the service generating + * it. For example, it can be used to identify requests in the service's logs. + * + * Generated from protobuf field string request_id = 1; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * An opaque string that should only be interpreted by the service generating + * it. For example, it can be used to identify requests in the service's logs. + * + * Generated from protobuf field string request_id = 1; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Any data that was used to serve this request. For example, an encrypted + * stack trace that can be sent back to the service provider for debugging. + * + * Generated from protobuf field string serving_data = 2; + * @return string + */ + public function getServingData() + { + return $this->serving_data; + } + + /** + * Any data that was used to serve this request. For example, an encrypted + * stack trace that can be sent back to the service provider for debugging. + * + * Generated from protobuf field string serving_data = 2; + * @param string $var + * @return $this + */ + public function setServingData($var) + { + GPBUtil::checkString($var, True); + $this->serving_data = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/ResourceInfo.php b/vendor/google/common-protos/src/Rpc/ResourceInfo.php new file mode 100644 index 0000000..3a7859c --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/ResourceInfo.php @@ -0,0 +1,205 @@ +google.rpc.ResourceInfo + */ +class ResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * A name for the type of resource being accessed, e.g. "sql table", + * "cloud storage bucket", "file", "Google calendar"; or the type URL + * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + * + * Generated from protobuf field string resource_type = 1; + */ + protected $resource_type = ''; + /** + * The name of the resource being accessed. For example, a shared calendar + * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + * error is + * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + * + * Generated from protobuf field string resource_name = 2; + */ + protected $resource_name = ''; + /** + * The owner of the resource (optional). + * For example, "user:" or "project:". + * + * Generated from protobuf field string owner = 3; + */ + protected $owner = ''; + /** + * Describes what error is encountered when accessing this resource. + * For example, updating a cloud project may require the `writer` permission + * on the developer console project. + * + * Generated from protobuf field string description = 4; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_type + * A name for the type of resource being accessed, e.g. "sql table", + * "cloud storage bucket", "file", "Google calendar"; or the type URL + * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + * @type string $resource_name + * The name of the resource being accessed. For example, a shared calendar + * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + * error is + * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + * @type string $owner + * The owner of the resource (optional). + * For example, "user:" or "project:". + * @type string $description + * Describes what error is encountered when accessing this resource. + * For example, updating a cloud project may require the `writer` permission + * on the developer console project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * A name for the type of resource being accessed, e.g. "sql table", + * "cloud storage bucket", "file", "Google calendar"; or the type URL + * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + * + * Generated from protobuf field string resource_type = 1; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * A name for the type of resource being accessed, e.g. "sql table", + * "cloud storage bucket", "file", "Google calendar"; or the type URL + * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + * + * Generated from protobuf field string resource_type = 1; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * The name of the resource being accessed. For example, a shared calendar + * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + * error is + * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + * + * Generated from protobuf field string resource_name = 2; + * @return string + */ + public function getResourceName() + { + return $this->resource_name; + } + + /** + * The name of the resource being accessed. For example, a shared calendar + * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + * error is + * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + * + * Generated from protobuf field string resource_name = 2; + * @param string $var + * @return $this + */ + public function setResourceName($var) + { + GPBUtil::checkString($var, True); + $this->resource_name = $var; + + return $this; + } + + /** + * The owner of the resource (optional). + * For example, "user:" or "project:". + * + * Generated from protobuf field string owner = 3; + * @return string + */ + public function getOwner() + { + return $this->owner; + } + + /** + * The owner of the resource (optional). + * For example, "user:" or "project:". + * + * Generated from protobuf field string owner = 3; + * @param string $var + * @return $this + */ + public function setOwner($var) + { + GPBUtil::checkString($var, True); + $this->owner = $var; + + return $this; + } + + /** + * Describes what error is encountered when accessing this resource. + * For example, updating a cloud project may require the `writer` permission + * on the developer console project. + * + * Generated from protobuf field string description = 4; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Describes what error is encountered when accessing this resource. + * For example, updating a cloud project may require the `writer` permission + * on the developer console project. + * + * Generated from protobuf field string description = 4; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/RetryInfo.php b/vendor/google/common-protos/src/Rpc/RetryInfo.php new file mode 100644 index 0000000..3d391ba --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/RetryInfo.php @@ -0,0 +1,87 @@ +google.rpc.RetryInfo + */ +class RetryInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Clients should wait at least this long between retrying the same request. + * + * Generated from protobuf field .google.protobuf.Duration retry_delay = 1; + */ + protected $retry_delay = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retry_delay + * Clients should wait at least this long between retrying the same request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Clients should wait at least this long between retrying the same request. + * + * Generated from protobuf field .google.protobuf.Duration retry_delay = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getRetryDelay() + { + return $this->retry_delay; + } + + public function hasRetryDelay() + { + return isset($this->retry_delay); + } + + public function clearRetryDelay() + { + unset($this->retry_delay); + } + + /** + * Clients should wait at least this long between retrying the same request. + * + * Generated from protobuf field .google.protobuf.Duration retry_delay = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetryDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retry_delay = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Rpc/Status.php b/vendor/google/common-protos/src/Rpc/Status.php new file mode 100644 index 0000000..55b3038 --- /dev/null +++ b/vendor/google/common-protos/src/Rpc/Status.php @@ -0,0 +1,160 @@ +google.rpc.Status + */ +class Status extends \Google\Protobuf\Internal\Message +{ + /** + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + * + * Generated from protobuf field int32 code = 1; + */ + protected $code = 0; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * [google.rpc.Status.details][google.rpc.Status.details] field, or localized + * by the client. + * + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 3; + */ + private $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + * @type string $message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * [google.rpc.Status.details][google.rpc.Status.details] field, or localized + * by the client. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Rpc\Status::initOnce(); + parent::__construct($data); + } + + /** + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + * + * Generated from protobuf field int32 code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + * + * Generated from protobuf field int32 code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * [google.rpc.Status.details][google.rpc.Status.details] field, or localized + * by the client. + * + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * [google.rpc.Status.details][google.rpc.Status.details] field, or localized + * by the client. + * + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetails() + { + return $this->details; + } + + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 3; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->details = $arr; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/CalendarPeriod.php b/vendor/google/common-protos/src/Type/CalendarPeriod.php new file mode 100644 index 0000000..e4807c0 --- /dev/null +++ b/vendor/google/common-protos/src/Type/CalendarPeriod.php @@ -0,0 +1,102 @@ +google.type.CalendarPeriod + */ +class CalendarPeriod +{ + /** + * Undefined period, raises an error. + * + * Generated from protobuf enum CALENDAR_PERIOD_UNSPECIFIED = 0; + */ + const CALENDAR_PERIOD_UNSPECIFIED = 0; + /** + * A day. + * + * Generated from protobuf enum DAY = 1; + */ + const DAY = 1; + /** + * A week. Weeks begin on Monday, following + * [ISO 8601](https://en.wikipedia.org/wiki/ISO_week_date). + * + * Generated from protobuf enum WEEK = 2; + */ + const WEEK = 2; + /** + * A fortnight. The first calendar fortnight of the year begins at the start + * of week 1 according to + * [ISO 8601](https://en.wikipedia.org/wiki/ISO_week_date). + * + * Generated from protobuf enum FORTNIGHT = 3; + */ + const FORTNIGHT = 3; + /** + * A month. + * + * Generated from protobuf enum MONTH = 4; + */ + const MONTH = 4; + /** + * A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each + * year. + * + * Generated from protobuf enum QUARTER = 5; + */ + const QUARTER = 5; + /** + * A half-year. Half-years start on dates 1-Jan and 1-Jul. + * + * Generated from protobuf enum HALF = 6; + */ + const HALF = 6; + /** + * A year. + * + * Generated from protobuf enum YEAR = 7; + */ + const YEAR = 7; + + private static $valueToName = [ + self::CALENDAR_PERIOD_UNSPECIFIED => 'CALENDAR_PERIOD_UNSPECIFIED', + self::DAY => 'DAY', + self::WEEK => 'WEEK', + self::FORTNIGHT => 'FORTNIGHT', + self::MONTH => 'MONTH', + self::QUARTER => 'QUARTER', + self::HALF => 'HALF', + self::YEAR => 'YEAR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Type/Color.php b/vendor/google/common-protos/src/Type/Color.php new file mode 100644 index 0000000..31c1a6e --- /dev/null +++ b/vendor/google/common-protos/src/Type/Color.php @@ -0,0 +1,360 @@ +google.type.Color + */ +class Color extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of red in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float red = 1; + */ + protected $red = 0.0; + /** + * The amount of green in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float green = 2; + */ + protected $green = 0.0; + /** + * The amount of blue in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float blue = 3; + */ + protected $blue = 0.0; + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * + * Generated from protobuf field .google.protobuf.FloatValue alpha = 4; + */ + protected $alpha = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $red + * The amount of red in the color as a value in the interval [0, 1]. + * @type float $green + * The amount of green in the color as a value in the interval [0, 1]. + * @type float $blue + * The amount of blue in the color as a value in the interval [0, 1]. + * @type \Google\Protobuf\FloatValue $alpha + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Color::initOnce(); + parent::__construct($data); + } + + /** + * The amount of red in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float red = 1; + * @return float + */ + public function getRed() + { + return $this->red; + } + + /** + * The amount of red in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float red = 1; + * @param float $var + * @return $this + */ + public function setRed($var) + { + GPBUtil::checkFloat($var); + $this->red = $var; + + return $this; + } + + /** + * The amount of green in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float green = 2; + * @return float + */ + public function getGreen() + { + return $this->green; + } + + /** + * The amount of green in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float green = 2; + * @param float $var + * @return $this + */ + public function setGreen($var) + { + GPBUtil::checkFloat($var); + $this->green = $var; + + return $this; + } + + /** + * The amount of blue in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float blue = 3; + * @return float + */ + public function getBlue() + { + return $this->blue; + } + + /** + * The amount of blue in the color as a value in the interval [0, 1]. + * + * Generated from protobuf field float blue = 3; + * @param float $var + * @return $this + */ + public function setBlue($var) + { + GPBUtil::checkFloat($var); + $this->blue = $var; + + return $this; + } + + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * + * Generated from protobuf field .google.protobuf.FloatValue alpha = 4; + * @return \Google\Protobuf\FloatValue|null + */ + public function getAlpha() + { + return $this->alpha; + } + + public function hasAlpha() + { + return isset($this->alpha); + } + + public function clearAlpha() + { + unset($this->alpha); + } + + /** + * Returns the unboxed value from getAlpha() + + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * + * Generated from protobuf field .google.protobuf.FloatValue alpha = 4; + * @return float|null + */ + public function getAlphaUnwrapped() + { + return $this->readWrapperValue("alpha"); + } + + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * + * Generated from protobuf field .google.protobuf.FloatValue alpha = 4; + * @param \Google\Protobuf\FloatValue $var + * @return $this + */ + public function setAlpha($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FloatValue::class); + $this->alpha = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\FloatValue object. + + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: + * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + * This means that a value of 1.0 corresponds to a solid color, whereas + * a value of 0.0 corresponds to a completely transparent color. This + * uses a wrapper message rather than a simple float scalar so that it is + * possible to distinguish between a default value and the value being unset. + * If omitted, this color object is rendered as a solid color + * (as if the alpha value had been explicitly given a value of 1.0). + * + * Generated from protobuf field .google.protobuf.FloatValue alpha = 4; + * @param float|null $var + * @return $this + */ + public function setAlphaUnwrapped($var) + { + $this->writeWrapperValue("alpha", $var); + return $this;} + +} + diff --git a/vendor/google/common-protos/src/Type/Date.php b/vendor/google/common-protos/src/Type/Date.php new file mode 100644 index 0000000..ba03e77 --- /dev/null +++ b/vendor/google/common-protos/src/Type/Date.php @@ -0,0 +1,161 @@ +google.type.Date + */ +class Date extends \Google\Protobuf\Internal\Message +{ + /** + * Year of the date. Must be from 1 to 9999, or 0 to specify a date without + * a year. + * + * Generated from protobuf field int32 year = 1; + */ + protected $year = 0; + /** + * Month of a year. Must be from 1 to 12, or 0 to specify a year without a + * month and day. + * + * Generated from protobuf field int32 month = 2; + */ + protected $month = 0; + /** + * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + * to specify a year by itself or a year and month where the day isn't + * significant. + * + * Generated from protobuf field int32 day = 3; + */ + protected $day = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $year + * Year of the date. Must be from 1 to 9999, or 0 to specify a date without + * a year. + * @type int $month + * Month of a year. Must be from 1 to 12, or 0 to specify a year without a + * month and day. + * @type int $day + * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + * to specify a year by itself or a year and month where the day isn't + * significant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Date::initOnce(); + parent::__construct($data); + } + + /** + * Year of the date. Must be from 1 to 9999, or 0 to specify a date without + * a year. + * + * Generated from protobuf field int32 year = 1; + * @return int + */ + public function getYear() + { + return $this->year; + } + + /** + * Year of the date. Must be from 1 to 9999, or 0 to specify a date without + * a year. + * + * Generated from protobuf field int32 year = 1; + * @param int $var + * @return $this + */ + public function setYear($var) + { + GPBUtil::checkInt32($var); + $this->year = $var; + + return $this; + } + + /** + * Month of a year. Must be from 1 to 12, or 0 to specify a year without a + * month and day. + * + * Generated from protobuf field int32 month = 2; + * @return int + */ + public function getMonth() + { + return $this->month; + } + + /** + * Month of a year. Must be from 1 to 12, or 0 to specify a year without a + * month and day. + * + * Generated from protobuf field int32 month = 2; + * @param int $var + * @return $this + */ + public function setMonth($var) + { + GPBUtil::checkInt32($var); + $this->month = $var; + + return $this; + } + + /** + * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + * to specify a year by itself or a year and month where the day isn't + * significant. + * + * Generated from protobuf field int32 day = 3; + * @return int + */ + public function getDay() + { + return $this->day; + } + + /** + * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + * to specify a year by itself or a year and month where the day isn't + * significant. + * + * Generated from protobuf field int32 day = 3; + * @param int $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkInt32($var); + $this->day = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/DateTime.php b/vendor/google/common-protos/src/Type/DateTime.php new file mode 100644 index 0000000..ed211b6 --- /dev/null +++ b/vendor/google/common-protos/src/Type/DateTime.php @@ -0,0 +1,393 @@ +google.type.DateTime + */ +class DateTime extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + * datetime without a year. + * + * Generated from protobuf field int32 year = 1; + */ + protected $year = 0; + /** + * Required. Month of year. Must be from 1 to 12. + * + * Generated from protobuf field int32 month = 2; + */ + protected $month = 0; + /** + * Required. Day of month. Must be from 1 to 31 and valid for the year and + * month. + * + * Generated from protobuf field int32 day = 3; + */ + protected $day = 0; + /** + * Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + * may choose to allow the value "24:00:00" for scenarios like business + * closing time. + * + * Generated from protobuf field int32 hours = 4; + */ + protected $hours = 0; + /** + * Required. Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 5; + */ + protected $minutes = 0; + /** + * Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + * API may allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 6; + */ + protected $seconds = 0; + /** + * Required. Fractions of seconds in nanoseconds. Must be from 0 to + * 999,999,999. + * + * Generated from protobuf field int32 nanos = 7; + */ + protected $nanos = 0; + protected $time_offset; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $year + * Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + * datetime without a year. + * @type int $month + * Required. Month of year. Must be from 1 to 12. + * @type int $day + * Required. Day of month. Must be from 1 to 31 and valid for the year and + * month. + * @type int $hours + * Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + * may choose to allow the value "24:00:00" for scenarios like business + * closing time. + * @type int $minutes + * Required. Minutes of hour of day. Must be from 0 to 59. + * @type int $seconds + * Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + * API may allow the value 60 if it allows leap-seconds. + * @type int $nanos + * Required. Fractions of seconds in nanoseconds. Must be from 0 to + * 999,999,999. + * @type \Google\Protobuf\Duration $utc_offset + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * For example, a UTC offset of -4:00 would be represented as + * { seconds: -14400 }. + * @type \Google\Type\TimeZone $time_zone + * Time zone. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Datetime::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + * datetime without a year. + * + * Generated from protobuf field int32 year = 1; + * @return int + */ + public function getYear() + { + return $this->year; + } + + /** + * Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + * datetime without a year. + * + * Generated from protobuf field int32 year = 1; + * @param int $var + * @return $this + */ + public function setYear($var) + { + GPBUtil::checkInt32($var); + $this->year = $var; + + return $this; + } + + /** + * Required. Month of year. Must be from 1 to 12. + * + * Generated from protobuf field int32 month = 2; + * @return int + */ + public function getMonth() + { + return $this->month; + } + + /** + * Required. Month of year. Must be from 1 to 12. + * + * Generated from protobuf field int32 month = 2; + * @param int $var + * @return $this + */ + public function setMonth($var) + { + GPBUtil::checkInt32($var); + $this->month = $var; + + return $this; + } + + /** + * Required. Day of month. Must be from 1 to 31 and valid for the year and + * month. + * + * Generated from protobuf field int32 day = 3; + * @return int + */ + public function getDay() + { + return $this->day; + } + + /** + * Required. Day of month. Must be from 1 to 31 and valid for the year and + * month. + * + * Generated from protobuf field int32 day = 3; + * @param int $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkInt32($var); + $this->day = $var; + + return $this; + } + + /** + * Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + * may choose to allow the value "24:00:00" for scenarios like business + * closing time. + * + * Generated from protobuf field int32 hours = 4; + * @return int + */ + public function getHours() + { + return $this->hours; + } + + /** + * Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + * may choose to allow the value "24:00:00" for scenarios like business + * closing time. + * + * Generated from protobuf field int32 hours = 4; + * @param int $var + * @return $this + */ + public function setHours($var) + { + GPBUtil::checkInt32($var); + $this->hours = $var; + + return $this; + } + + /** + * Required. Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 5; + * @return int + */ + public function getMinutes() + { + return $this->minutes; + } + + /** + * Required. Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 5; + * @param int $var + * @return $this + */ + public function setMinutes($var) + { + GPBUtil::checkInt32($var); + $this->minutes = $var; + + return $this; + } + + /** + * Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + * API may allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 6; + * @return int + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + * API may allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 6; + * @param int $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt32($var); + $this->seconds = $var; + + return $this; + } + + /** + * Required. Fractions of seconds in nanoseconds. Must be from 0 to + * 999,999,999. + * + * Generated from protobuf field int32 nanos = 7; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Required. Fractions of seconds in nanoseconds. Must be from 0 to + * 999,999,999. + * + * Generated from protobuf field int32 nanos = 7; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + + /** + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * For example, a UTC offset of -4:00 would be represented as + * { seconds: -14400 }. + * + * Generated from protobuf field .google.protobuf.Duration utc_offset = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getUtcOffset() + { + return $this->readOneof(8); + } + + public function hasUtcOffset() + { + return $this->hasOneof(8); + } + + /** + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * For example, a UTC offset of -4:00 would be represented as + * { seconds: -14400 }. + * + * Generated from protobuf field .google.protobuf.Duration utc_offset = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setUtcOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Time zone. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 9; + * @return \Google\Type\TimeZone|null + */ + public function getTimeZone() + { + return $this->readOneof(9); + } + + public function hasTimeZone() + { + return $this->hasOneof(9); + } + + /** + * Time zone. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 9; + * @param \Google\Type\TimeZone $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeZone::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getTimeOffset() + { + return $this->whichOneof("time_offset"); + } + +} + diff --git a/vendor/google/common-protos/src/Type/DayOfWeek.php b/vendor/google/common-protos/src/Type/DayOfWeek.php new file mode 100644 index 0000000..56219ff --- /dev/null +++ b/vendor/google/common-protos/src/Type/DayOfWeek.php @@ -0,0 +1,96 @@ +google.type.DayOfWeek + */ +class DayOfWeek +{ + /** + * The day of the week is unspecified. + * + * Generated from protobuf enum DAY_OF_WEEK_UNSPECIFIED = 0; + */ + const DAY_OF_WEEK_UNSPECIFIED = 0; + /** + * Monday + * + * Generated from protobuf enum MONDAY = 1; + */ + const MONDAY = 1; + /** + * Tuesday + * + * Generated from protobuf enum TUESDAY = 2; + */ + const TUESDAY = 2; + /** + * Wednesday + * + * Generated from protobuf enum WEDNESDAY = 3; + */ + const WEDNESDAY = 3; + /** + * Thursday + * + * Generated from protobuf enum THURSDAY = 4; + */ + const THURSDAY = 4; + /** + * Friday + * + * Generated from protobuf enum FRIDAY = 5; + */ + const FRIDAY = 5; + /** + * Saturday + * + * Generated from protobuf enum SATURDAY = 6; + */ + const SATURDAY = 6; + /** + * Sunday + * + * Generated from protobuf enum SUNDAY = 7; + */ + const SUNDAY = 7; + + private static $valueToName = [ + self::DAY_OF_WEEK_UNSPECIFIED => 'DAY_OF_WEEK_UNSPECIFIED', + self::MONDAY => 'MONDAY', + self::TUESDAY => 'TUESDAY', + self::WEDNESDAY => 'WEDNESDAY', + self::THURSDAY => 'THURSDAY', + self::FRIDAY => 'FRIDAY', + self::SATURDAY => 'SATURDAY', + self::SUNDAY => 'SUNDAY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Type/Decimal.php b/vendor/google/common-protos/src/Type/Decimal.php new file mode 100644 index 0000000..84e0fec --- /dev/null +++ b/vendor/google/common-protos/src/Type/Decimal.php @@ -0,0 +1,244 @@ +google.type.Decimal + */ +class Decimal extends \Google\Protobuf\Internal\Message +{ + /** + * The decimal value, as a string. + * The string representation consists of an optional sign, `+` (`U+002B`) + * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits + * ("the integer"), optionally followed by a fraction, optionally followed + * by an exponent. + * The fraction consists of a decimal point followed by zero or more decimal + * digits. The string must contain at least one digit in either the integer + * or the fraction. The number formed by the sign, the integer and the + * fraction is referred to as the significand. + * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) + * followed by one or more decimal digits. + * Services **should** normalize decimal values before storing them by: + * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). + * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). + * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). + * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). + * Services **may** perform additional normalization based on its own needs + * and the internal decimal implementation selected, such as shifting the + * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). + * Additionally, services **may** preserve trailing zeroes in the fraction + * to indicate increased precision, but are not required to do so. + * Note that only the `.` character is supported to divide the integer + * and the fraction; `,` **should not** be supported regardless of locale. + * Additionally, thousand separators **should not** be supported. If a + * service does support them, values **must** be normalized. + * The ENBF grammar is: + * DecimalString = + * [Sign] Significand [Exponent]; + * Sign = '+' | '-'; + * Significand = + * Digits ['.'] [Digits] | [Digits] '.' Digits; + * Exponent = ('e' | 'E') [Sign] Digits; + * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; + * Services **should** clearly document the range of supported values, the + * maximum supported precision (total number of digits), and, if applicable, + * the scale (number of digits after the decimal point), as well as how it + * behaves when receiving out-of-bounds values. + * Services **may** choose to accept values passed as input even when the + * value has a higher precision or scale than the service supports, and + * **should** round the value to fit the supported scale. Alternatively, the + * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) + * if precision would be lost. + * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in + * gRPC) if the service receives a value outside of the supported range. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The decimal value, as a string. + * The string representation consists of an optional sign, `+` (`U+002B`) + * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits + * ("the integer"), optionally followed by a fraction, optionally followed + * by an exponent. + * The fraction consists of a decimal point followed by zero or more decimal + * digits. The string must contain at least one digit in either the integer + * or the fraction. The number formed by the sign, the integer and the + * fraction is referred to as the significand. + * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) + * followed by one or more decimal digits. + * Services **should** normalize decimal values before storing them by: + * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). + * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). + * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). + * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). + * Services **may** perform additional normalization based on its own needs + * and the internal decimal implementation selected, such as shifting the + * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). + * Additionally, services **may** preserve trailing zeroes in the fraction + * to indicate increased precision, but are not required to do so. + * Note that only the `.` character is supported to divide the integer + * and the fraction; `,` **should not** be supported regardless of locale. + * Additionally, thousand separators **should not** be supported. If a + * service does support them, values **must** be normalized. + * The ENBF grammar is: + * DecimalString = + * [Sign] Significand [Exponent]; + * Sign = '+' | '-'; + * Significand = + * Digits ['.'] [Digits] | [Digits] '.' Digits; + * Exponent = ('e' | 'E') [Sign] Digits; + * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; + * Services **should** clearly document the range of supported values, the + * maximum supported precision (total number of digits), and, if applicable, + * the scale (number of digits after the decimal point), as well as how it + * behaves when receiving out-of-bounds values. + * Services **may** choose to accept values passed as input even when the + * value has a higher precision or scale than the service supports, and + * **should** round the value to fit the supported scale. Alternatively, the + * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) + * if precision would be lost. + * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in + * gRPC) if the service receives a value outside of the supported range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Decimal::initOnce(); + parent::__construct($data); + } + + /** + * The decimal value, as a string. + * The string representation consists of an optional sign, `+` (`U+002B`) + * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits + * ("the integer"), optionally followed by a fraction, optionally followed + * by an exponent. + * The fraction consists of a decimal point followed by zero or more decimal + * digits. The string must contain at least one digit in either the integer + * or the fraction. The number formed by the sign, the integer and the + * fraction is referred to as the significand. + * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) + * followed by one or more decimal digits. + * Services **should** normalize decimal values before storing them by: + * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). + * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). + * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). + * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). + * Services **may** perform additional normalization based on its own needs + * and the internal decimal implementation selected, such as shifting the + * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). + * Additionally, services **may** preserve trailing zeroes in the fraction + * to indicate increased precision, but are not required to do so. + * Note that only the `.` character is supported to divide the integer + * and the fraction; `,` **should not** be supported regardless of locale. + * Additionally, thousand separators **should not** be supported. If a + * service does support them, values **must** be normalized. + * The ENBF grammar is: + * DecimalString = + * [Sign] Significand [Exponent]; + * Sign = '+' | '-'; + * Significand = + * Digits ['.'] [Digits] | [Digits] '.' Digits; + * Exponent = ('e' | 'E') [Sign] Digits; + * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; + * Services **should** clearly document the range of supported values, the + * maximum supported precision (total number of digits), and, if applicable, + * the scale (number of digits after the decimal point), as well as how it + * behaves when receiving out-of-bounds values. + * Services **may** choose to accept values passed as input even when the + * value has a higher precision or scale than the service supports, and + * **should** round the value to fit the supported scale. Alternatively, the + * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) + * if precision would be lost. + * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in + * gRPC) if the service receives a value outside of the supported range. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The decimal value, as a string. + * The string representation consists of an optional sign, `+` (`U+002B`) + * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits + * ("the integer"), optionally followed by a fraction, optionally followed + * by an exponent. + * The fraction consists of a decimal point followed by zero or more decimal + * digits. The string must contain at least one digit in either the integer + * or the fraction. The number formed by the sign, the integer and the + * fraction is referred to as the significand. + * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) + * followed by one or more decimal digits. + * Services **should** normalize decimal values before storing them by: + * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). + * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). + * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). + * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). + * Services **may** perform additional normalization based on its own needs + * and the internal decimal implementation selected, such as shifting the + * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). + * Additionally, services **may** preserve trailing zeroes in the fraction + * to indicate increased precision, but are not required to do so. + * Note that only the `.` character is supported to divide the integer + * and the fraction; `,` **should not** be supported regardless of locale. + * Additionally, thousand separators **should not** be supported. If a + * service does support them, values **must** be normalized. + * The ENBF grammar is: + * DecimalString = + * [Sign] Significand [Exponent]; + * Sign = '+' | '-'; + * Significand = + * Digits ['.'] [Digits] | [Digits] '.' Digits; + * Exponent = ('e' | 'E') [Sign] Digits; + * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; + * Services **should** clearly document the range of supported values, the + * maximum supported precision (total number of digits), and, if applicable, + * the scale (number of digits after the decimal point), as well as how it + * behaves when receiving out-of-bounds values. + * Services **may** choose to accept values passed as input even when the + * value has a higher precision or scale than the service supports, and + * **should** round the value to fit the supported scale. Alternatively, the + * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) + * if precision would be lost. + * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in + * gRPC) if the service receives a value outside of the supported range. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Expr.php b/vendor/google/common-protos/src/Type/Expr.php new file mode 100644 index 0000000..e47299b --- /dev/null +++ b/vendor/google/common-protos/src/Type/Expr.php @@ -0,0 +1,210 @@ +google.type.Expr + */ +class Expr extends \Google\Protobuf\Internal\Message +{ + /** + * Textual representation of an expression in Common Expression Language + * syntax. + * + * Generated from protobuf field string expression = 1; + */ + protected $expression = ''; + /** + * Optional. Title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * Optional. Description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Optional. String indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field string location = 4; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $expression + * Textual representation of an expression in Common Expression Language + * syntax. + * @type string $title + * Optional. Title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * @type string $description + * Optional. Description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * @type string $location + * Optional. String indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Expr::initOnce(); + parent::__construct($data); + } + + /** + * Textual representation of an expression in Common Expression Language + * syntax. + * + * Generated from protobuf field string expression = 1; + * @return string + */ + public function getExpression() + { + return $this->expression; + } + + /** + * Textual representation of an expression in Common Expression Language + * syntax. + * + * Generated from protobuf field string expression = 1; + * @param string $var + * @return $this + */ + public function setExpression($var) + { + GPBUtil::checkString($var, True); + $this->expression = $var; + + return $this; + } + + /** + * Optional. Title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. Title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. String indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field string location = 4; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Optional. String indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field string location = 4; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Fraction.php b/vendor/google/common-protos/src/Type/Fraction.php new file mode 100644 index 0000000..f7aae21 --- /dev/null +++ b/vendor/google/common-protos/src/Type/Fraction.php @@ -0,0 +1,105 @@ +google.type.Fraction + */ +class Fraction extends \Google\Protobuf\Internal\Message +{ + /** + * The numerator in the fraction, e.g. 2 in 2/3. + * + * Generated from protobuf field int64 numerator = 1; + */ + protected $numerator = 0; + /** + * The value by which the numerator is divided, e.g. 3 in 2/3. Must be + * positive. + * + * Generated from protobuf field int64 denominator = 2; + */ + protected $denominator = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $numerator + * The numerator in the fraction, e.g. 2 in 2/3. + * @type int|string $denominator + * The value by which the numerator is divided, e.g. 3 in 2/3. Must be + * positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Fraction::initOnce(); + parent::__construct($data); + } + + /** + * The numerator in the fraction, e.g. 2 in 2/3. + * + * Generated from protobuf field int64 numerator = 1; + * @return int|string + */ + public function getNumerator() + { + return $this->numerator; + } + + /** + * The numerator in the fraction, e.g. 2 in 2/3. + * + * Generated from protobuf field int64 numerator = 1; + * @param int|string $var + * @return $this + */ + public function setNumerator($var) + { + GPBUtil::checkInt64($var); + $this->numerator = $var; + + return $this; + } + + /** + * The value by which the numerator is divided, e.g. 3 in 2/3. Must be + * positive. + * + * Generated from protobuf field int64 denominator = 2; + * @return int|string + */ + public function getDenominator() + { + return $this->denominator; + } + + /** + * The value by which the numerator is divided, e.g. 3 in 2/3. Must be + * positive. + * + * Generated from protobuf field int64 denominator = 2; + * @param int|string $var + * @return $this + */ + public function setDenominator($var) + { + GPBUtil::checkInt64($var); + $this->denominator = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Interval.php b/vendor/google/common-protos/src/Type/Interval.php new file mode 100644 index 0000000..89fb028 --- /dev/null +++ b/vendor/google/common-protos/src/Type/Interval.php @@ -0,0 +1,141 @@ +google.type.Interval + */ +class Interval extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Inclusive start of the interval. + * If specified, a Timestamp matching this interval will have to be the same + * or after the start. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Optional. Exclusive end of the interval. + * If specified, a Timestamp matching this interval will have to be before the + * end. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Optional. Inclusive start of the interval. + * If specified, a Timestamp matching this interval will have to be the same + * or after the start. + * @type \Google\Protobuf\Timestamp $end_time + * Optional. Exclusive end of the interval. + * If specified, a Timestamp matching this interval will have to be before the + * end. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Interval::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Inclusive start of the interval. + * If specified, a Timestamp matching this interval will have to be the same + * or after the start. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Optional. Inclusive start of the interval. + * If specified, a Timestamp matching this interval will have to be the same + * or after the start. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Optional. Exclusive end of the interval. + * If specified, a Timestamp matching this interval will have to be before the + * end. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Optional. Exclusive end of the interval. + * If specified, a Timestamp matching this interval will have to be before the + * end. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/LatLng.php b/vendor/google/common-protos/src/Type/LatLng.php new file mode 100644 index 0000000..3725faf --- /dev/null +++ b/vendor/google/common-protos/src/Type/LatLng.php @@ -0,0 +1,105 @@ +WGS84 + * standard. Values must be within normalized ranges. + * + * Generated from protobuf message google.type.LatLng + */ +class LatLng extends \Google\Protobuf\Internal\Message +{ + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + * + * Generated from protobuf field double latitude = 1; + */ + protected $latitude = 0.0; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * + * Generated from protobuf field double longitude = 2; + */ + protected $longitude = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $latitude + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + * @type float $longitude + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Latlng::initOnce(); + parent::__construct($data); + } + + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + * + * Generated from protobuf field double latitude = 1; + * @return float + */ + public function getLatitude() + { + return $this->latitude; + } + + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + * + * Generated from protobuf field double latitude = 1; + * @param float $var + * @return $this + */ + public function setLatitude($var) + { + GPBUtil::checkDouble($var); + $this->latitude = $var; + + return $this; + } + + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * + * Generated from protobuf field double longitude = 2; + * @return float + */ + public function getLongitude() + { + return $this->longitude; + } + + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * + * Generated from protobuf field double longitude = 2; + * @param float $var + * @return $this + */ + public function setLongitude($var) + { + GPBUtil::checkDouble($var); + $this->longitude = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/LocalizedText.php b/vendor/google/common-protos/src/Type/LocalizedText.php new file mode 100644 index 0000000..00545c6 --- /dev/null +++ b/vendor/google/common-protos/src/Type/LocalizedText.php @@ -0,0 +1,109 @@ +google.type.LocalizedText + */ +class LocalizedText extends \Google\Protobuf\Internal\Message +{ + /** + * Localized string in the language corresponding to `language_code' below. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The text's BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * + * Generated from protobuf field string language_code = 2; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Localized string in the language corresponding to `language_code' below. + * @type string $language_code + * The text's BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\LocalizedText::initOnce(); + parent::__construct($data); + } + + /** + * Localized string in the language corresponding to `language_code' below. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Localized string in the language corresponding to `language_code' below. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The text's BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * + * Generated from protobuf field string language_code = 2; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The text's BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * + * Generated from protobuf field string language_code = 2; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Money.php b/vendor/google/common-protos/src/Type/Money.php new file mode 100644 index 0000000..826c954 --- /dev/null +++ b/vendor/google/common-protos/src/Type/Money.php @@ -0,0 +1,159 @@ +google.type.Money + */ +class Money extends \Google\Protobuf\Internal\Message +{ + /** + * The three-letter currency code defined in ISO 4217. + * + * Generated from protobuf field string currency_code = 1; + */ + protected $currency_code = ''; + /** + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * + * Generated from protobuf field int64 units = 2; + */ + protected $units = 0; + /** + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + * + * Generated from protobuf field int32 nanos = 3; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $currency_code + * The three-letter currency code defined in ISO 4217. + * @type int|string $units + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * @type int $nanos + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Money::initOnce(); + parent::__construct($data); + } + + /** + * The three-letter currency code defined in ISO 4217. + * + * Generated from protobuf field string currency_code = 1; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * The three-letter currency code defined in ISO 4217. + * + * Generated from protobuf field string currency_code = 1; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * + * Generated from protobuf field int64 units = 2; + * @return int|string + */ + public function getUnits() + { + return $this->units; + } + + /** + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * + * Generated from protobuf field int64 units = 2; + * @param int|string $var + * @return $this + */ + public function setUnits($var) + { + GPBUtil::checkInt64($var); + $this->units = $var; + + return $this; + } + + /** + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + * + * Generated from protobuf field int32 nanos = 3; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + * + * Generated from protobuf field int32 nanos = 3; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Month.php b/vendor/google/common-protos/src/Type/Month.php new file mode 100644 index 0000000..473d62e --- /dev/null +++ b/vendor/google/common-protos/src/Type/Month.php @@ -0,0 +1,131 @@ +google.type.Month + */ +class Month +{ + /** + * The unspecified month. + * + * Generated from protobuf enum MONTH_UNSPECIFIED = 0; + */ + const MONTH_UNSPECIFIED = 0; + /** + * The month of January. + * + * Generated from protobuf enum JANUARY = 1; + */ + const JANUARY = 1; + /** + * The month of February. + * + * Generated from protobuf enum FEBRUARY = 2; + */ + const FEBRUARY = 2; + /** + * The month of March. + * + * Generated from protobuf enum MARCH = 3; + */ + const MARCH = 3; + /** + * The month of April. + * + * Generated from protobuf enum APRIL = 4; + */ + const APRIL = 4; + /** + * The month of May. + * + * Generated from protobuf enum MAY = 5; + */ + const MAY = 5; + /** + * The month of June. + * + * Generated from protobuf enum JUNE = 6; + */ + const JUNE = 6; + /** + * The month of July. + * + * Generated from protobuf enum JULY = 7; + */ + const JULY = 7; + /** + * The month of August. + * + * Generated from protobuf enum AUGUST = 8; + */ + const AUGUST = 8; + /** + * The month of September. + * + * Generated from protobuf enum SEPTEMBER = 9; + */ + const SEPTEMBER = 9; + /** + * The month of October. + * + * Generated from protobuf enum OCTOBER = 10; + */ + const OCTOBER = 10; + /** + * The month of November. + * + * Generated from protobuf enum NOVEMBER = 11; + */ + const NOVEMBER = 11; + /** + * The month of December. + * + * Generated from protobuf enum DECEMBER = 12; + */ + const DECEMBER = 12; + + private static $valueToName = [ + self::MONTH_UNSPECIFIED => 'MONTH_UNSPECIFIED', + self::JANUARY => 'JANUARY', + self::FEBRUARY => 'FEBRUARY', + self::MARCH => 'MARCH', + self::APRIL => 'APRIL', + self::MAY => 'MAY', + self::JUNE => 'JUNE', + self::JULY => 'JULY', + self::AUGUST => 'AUGUST', + self::SEPTEMBER => 'SEPTEMBER', + self::OCTOBER => 'OCTOBER', + self::NOVEMBER => 'NOVEMBER', + self::DECEMBER => 'DECEMBER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/common-protos/src/Type/PhoneNumber.php b/vendor/google/common-protos/src/Type/PhoneNumber.php new file mode 100644 index 0000000..8f4289d --- /dev/null +++ b/vendor/google/common-protos/src/Type/PhoneNumber.php @@ -0,0 +1,230 @@ +google.type.PhoneNumber + */ +class PhoneNumber extends \Google\Protobuf\Internal\Message +{ + /** + * The phone number's extension. The extension is not standardized in ITU + * recommendations, except for being defined as a series of numbers with a + * maximum length of 40 digits. Other than digits, some other dialing + * characters such as ',' (indicating a wait) or '#' may be stored here. + * Note that no regions currently use extensions with short codes, so this + * field is normally only set in conjunction with an E.164 number. It is held + * separately from the E.164 number to allow for short code extensions in the + * future. + * + * Generated from protobuf field string extension = 3; + */ + protected $extension = ''; + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $e164_number + * The phone number, represented as a leading plus sign ('+'), followed by a + * phone number that uses a relaxed ITU E.164 format consisting of the + * country calling code (1 to 3 digits) and the subscriber number, with no + * additional spaces or formatting, e.g.: + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * The ITU E.164 format limits the latter to 12 digits, but in practice not + * all countries respect that, so we relax that restriction here. + * National-only numbers are not allowed. + * References: + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * @type \Google\Type\PhoneNumber\ShortCode $short_code + * A short code. + * Reference(s): + * - https://en.wikipedia.org/wiki/Short_code + * @type string $extension + * The phone number's extension. The extension is not standardized in ITU + * recommendations, except for being defined as a series of numbers with a + * maximum length of 40 digits. Other than digits, some other dialing + * characters such as ',' (indicating a wait) or '#' may be stored here. + * Note that no regions currently use extensions with short codes, so this + * field is normally only set in conjunction with an E.164 number. It is held + * separately from the E.164 number to allow for short code extensions in the + * future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\PhoneNumber::initOnce(); + parent::__construct($data); + } + + /** + * The phone number, represented as a leading plus sign ('+'), followed by a + * phone number that uses a relaxed ITU E.164 format consisting of the + * country calling code (1 to 3 digits) and the subscriber number, with no + * additional spaces or formatting, e.g.: + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * The ITU E.164 format limits the latter to 12 digits, but in practice not + * all countries respect that, so we relax that restriction here. + * National-only numbers are not allowed. + * References: + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * + * Generated from protobuf field string e164_number = 1; + * @return string + */ + public function getE164Number() + { + return $this->readOneof(1); + } + + public function hasE164Number() + { + return $this->hasOneof(1); + } + + /** + * The phone number, represented as a leading plus sign ('+'), followed by a + * phone number that uses a relaxed ITU E.164 format consisting of the + * country calling code (1 to 3 digits) and the subscriber number, with no + * additional spaces or formatting, e.g.: + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * The ITU E.164 format limits the latter to 12 digits, but in practice not + * all countries respect that, so we relax that restriction here. + * National-only numbers are not allowed. + * References: + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * + * Generated from protobuf field string e164_number = 1; + * @param string $var + * @return $this + */ + public function setE164Number($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A short code. + * Reference(s): + * - https://en.wikipedia.org/wiki/Short_code + * + * Generated from protobuf field .google.type.PhoneNumber.ShortCode short_code = 2; + * @return \Google\Type\PhoneNumber\ShortCode|null + */ + public function getShortCode() + { + return $this->readOneof(2); + } + + public function hasShortCode() + { + return $this->hasOneof(2); + } + + /** + * A short code. + * Reference(s): + * - https://en.wikipedia.org/wiki/Short_code + * + * Generated from protobuf field .google.type.PhoneNumber.ShortCode short_code = 2; + * @param \Google\Type\PhoneNumber\ShortCode $var + * @return $this + */ + public function setShortCode($var) + { + GPBUtil::checkMessage($var, \Google\Type\PhoneNumber\ShortCode::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The phone number's extension. The extension is not standardized in ITU + * recommendations, except for being defined as a series of numbers with a + * maximum length of 40 digits. Other than digits, some other dialing + * characters such as ',' (indicating a wait) or '#' may be stored here. + * Note that no regions currently use extensions with short codes, so this + * field is normally only set in conjunction with an E.164 number. It is held + * separately from the E.164 number to allow for short code extensions in the + * future. + * + * Generated from protobuf field string extension = 3; + * @return string + */ + public function getExtension() + { + return $this->extension; + } + + /** + * The phone number's extension. The extension is not standardized in ITU + * recommendations, except for being defined as a series of numbers with a + * maximum length of 40 digits. Other than digits, some other dialing + * characters such as ',' (indicating a wait) or '#' may be stored here. + * Note that no regions currently use extensions with short codes, so this + * field is normally only set in conjunction with an E.164 number. It is held + * separately from the E.164 number to allow for short code extensions in the + * future. + * + * Generated from protobuf field string extension = 3; + * @param string $var + * @return $this + */ + public function setExtension($var) + { + GPBUtil::checkString($var, True); + $this->extension = $var; + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/vendor/google/common-protos/src/Type/PhoneNumber/ShortCode.php b/vendor/google/common-protos/src/Type/PhoneNumber/ShortCode.php new file mode 100644 index 0000000..1ac9de2 --- /dev/null +++ b/vendor/google/common-protos/src/Type/PhoneNumber/ShortCode.php @@ -0,0 +1,125 @@ +google.type.PhoneNumber.ShortCode + */ +class ShortCode extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BCP-47 region code of the location where calls to this + * short code can be made, such as "US" and "BB". + * Reference(s): + * - http://www.unicode.org/reports/tr35/#unicode_region_subtag + * + * Generated from protobuf field string region_code = 1; + */ + protected $region_code = ''; + /** + * Required. The short code digits, without a leading plus ('+') or country + * calling code, e.g. "611". + * + * Generated from protobuf field string number = 2; + */ + protected $number = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $region_code + * Required. The BCP-47 region code of the location where calls to this + * short code can be made, such as "US" and "BB". + * Reference(s): + * - http://www.unicode.org/reports/tr35/#unicode_region_subtag + * @type string $number + * Required. The short code digits, without a leading plus ('+') or country + * calling code, e.g. "611". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\PhoneNumber::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BCP-47 region code of the location where calls to this + * short code can be made, such as "US" and "BB". + * Reference(s): + * - http://www.unicode.org/reports/tr35/#unicode_region_subtag + * + * Generated from protobuf field string region_code = 1; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. The BCP-47 region code of the location where calls to this + * short code can be made, such as "US" and "BB". + * Reference(s): + * - http://www.unicode.org/reports/tr35/#unicode_region_subtag + * + * Generated from protobuf field string region_code = 1; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Required. The short code digits, without a leading plus ('+') or country + * calling code, e.g. "611". + * + * Generated from protobuf field string number = 2; + * @return string + */ + public function getNumber() + { + return $this->number; + } + + /** + * Required. The short code digits, without a leading plus ('+') or country + * calling code, e.g. "611". + * + * Generated from protobuf field string number = 2; + * @param string $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkString($var, True); + $this->number = $var; + + return $this; + } + +} + + diff --git a/vendor/google/common-protos/src/Type/PostalAddress.php b/vendor/google/common-protos/src/Type/PostalAddress.php new file mode 100644 index 0000000..1fdaf26 --- /dev/null +++ b/vendor/google/common-protos/src/Type/PostalAddress.php @@ -0,0 +1,628 @@ +google.type.PostalAddress + */ +class PostalAddress extends \Google\Protobuf\Internal\Message +{ + /** + * The schema revision of the `PostalAddress`. This must be set to 0, which is + * the latest revision. + * All new revisions **must** be backward compatible with old revisions. + * + * Generated from protobuf field int32 revision = 1; + */ + protected $revision = 0; + /** + * Required. CLDR region code of the country/region of the address. This + * is never inferred and it is up to the user to ensure the value is + * correct. See http://cldr.unicode.org/ and + * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + * for details. Example: "CH" for Switzerland. + * + * Generated from protobuf field string region_code = 2; + */ + protected $region_code = ''; + /** + * Optional. BCP-47 language code of the contents of this address (if + * known). This is often the UI language of the input form or is expected + * to match one of the languages used in the address' country/region, or their + * transliterated equivalents. + * This can affect formatting in certain countries, but is not critical + * to the correctness of the data and will never affect any validation or + * other non-formatting related operations. + * If this value is not known, it should be omitted (rather than specifying a + * possibly incorrect default). + * Examples: "zh-Hant", "ja", "ja-Latn", "en". + * + * Generated from protobuf field string language_code = 3; + */ + protected $language_code = ''; + /** + * Optional. Postal code of the address. Not all countries use or require + * postal codes to be present, but where they are used, they may trigger + * additional validation with other parts of the address (e.g. state/zip + * validation in the U.S.A.). + * + * Generated from protobuf field string postal_code = 4; + */ + protected $postal_code = ''; + /** + * Optional. Additional, country-specific, sorting code. This is not used + * in most regions. Where it is used, the value is either a string like + * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + * alone, representing the "sector code" (Jamaica), "delivery area indicator" + * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + * + * Generated from protobuf field string sorting_code = 5; + */ + protected $sorting_code = ''; + /** + * Optional. Highest administrative subdivision which is used for postal + * addresses of a country or region. + * For example, this can be a state, a province, an oblast, or a prefecture. + * Specifically, for Spain this is the province and not the autonomous + * community (e.g. "Barcelona" and not "Catalonia"). + * Many countries don't use an administrative area in postal addresses. E.g. + * in Switzerland this should be left unpopulated. + * + * Generated from protobuf field string administrative_area = 6; + */ + protected $administrative_area = ''; + /** + * Optional. Generally refers to the city/town portion of the address. + * Examples: US city, IT comune, UK post town. + * In regions of the world where localities are not well defined or do not fit + * into this structure well, leave locality empty and use address_lines. + * + * Generated from protobuf field string locality = 7; + */ + protected $locality = ''; + /** + * Optional. Sublocality of the address. + * For example, this can be neighborhoods, boroughs, districts. + * + * Generated from protobuf field string sublocality = 8; + */ + protected $sublocality = ''; + /** + * Unstructured address lines describing the lower levels of an address. + * Because values in address_lines do not have type information and may + * sometimes contain multiple values in a single field (e.g. + * "Austin, TX"), it is important that the line order is clear. The order of + * address lines should be "envelope order" for the country/region of the + * address. In places where this can vary (e.g. Japan), address_language is + * used to make it explicit (e.g. "ja" for large-to-small ordering and + * "ja-Latn" or "en" for small-to-large). This way, the most specific line of + * an address can be selected based on the language. + * The minimum permitted structural representation of an address consists + * of a region_code with all remaining information placed in the + * address_lines. It would be possible to format such an address very + * approximately without geocoding, but no semantic reasoning could be + * made about any of the address components until it was at least + * partially resolved. + * Creating an address only containing a region_code and address_lines, and + * then geocoding is the recommended way to handle completely unstructured + * addresses (as opposed to guessing which parts of the address should be + * localities or administrative areas). + * + * Generated from protobuf field repeated string address_lines = 9; + */ + private $address_lines; + /** + * Optional. The recipient at the address. + * This field may, under certain circumstances, contain multiline information. + * For example, it might contain "care of" information. + * + * Generated from protobuf field repeated string recipients = 10; + */ + private $recipients; + /** + * Optional. The name of the organization at the address. + * + * Generated from protobuf field string organization = 11; + */ + protected $organization = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $revision + * The schema revision of the `PostalAddress`. This must be set to 0, which is + * the latest revision. + * All new revisions **must** be backward compatible with old revisions. + * @type string $region_code + * Required. CLDR region code of the country/region of the address. This + * is never inferred and it is up to the user to ensure the value is + * correct. See http://cldr.unicode.org/ and + * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + * for details. Example: "CH" for Switzerland. + * @type string $language_code + * Optional. BCP-47 language code of the contents of this address (if + * known). This is often the UI language of the input form or is expected + * to match one of the languages used in the address' country/region, or their + * transliterated equivalents. + * This can affect formatting in certain countries, but is not critical + * to the correctness of the data and will never affect any validation or + * other non-formatting related operations. + * If this value is not known, it should be omitted (rather than specifying a + * possibly incorrect default). + * Examples: "zh-Hant", "ja", "ja-Latn", "en". + * @type string $postal_code + * Optional. Postal code of the address. Not all countries use or require + * postal codes to be present, but where they are used, they may trigger + * additional validation with other parts of the address (e.g. state/zip + * validation in the U.S.A.). + * @type string $sorting_code + * Optional. Additional, country-specific, sorting code. This is not used + * in most regions. Where it is used, the value is either a string like + * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + * alone, representing the "sector code" (Jamaica), "delivery area indicator" + * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + * @type string $administrative_area + * Optional. Highest administrative subdivision which is used for postal + * addresses of a country or region. + * For example, this can be a state, a province, an oblast, or a prefecture. + * Specifically, for Spain this is the province and not the autonomous + * community (e.g. "Barcelona" and not "Catalonia"). + * Many countries don't use an administrative area in postal addresses. E.g. + * in Switzerland this should be left unpopulated. + * @type string $locality + * Optional. Generally refers to the city/town portion of the address. + * Examples: US city, IT comune, UK post town. + * In regions of the world where localities are not well defined or do not fit + * into this structure well, leave locality empty and use address_lines. + * @type string $sublocality + * Optional. Sublocality of the address. + * For example, this can be neighborhoods, boroughs, districts. + * @type array|\Google\Protobuf\Internal\RepeatedField $address_lines + * Unstructured address lines describing the lower levels of an address. + * Because values in address_lines do not have type information and may + * sometimes contain multiple values in a single field (e.g. + * "Austin, TX"), it is important that the line order is clear. The order of + * address lines should be "envelope order" for the country/region of the + * address. In places where this can vary (e.g. Japan), address_language is + * used to make it explicit (e.g. "ja" for large-to-small ordering and + * "ja-Latn" or "en" for small-to-large). This way, the most specific line of + * an address can be selected based on the language. + * The minimum permitted structural representation of an address consists + * of a region_code with all remaining information placed in the + * address_lines. It would be possible to format such an address very + * approximately without geocoding, but no semantic reasoning could be + * made about any of the address components until it was at least + * partially resolved. + * Creating an address only containing a region_code and address_lines, and + * then geocoding is the recommended way to handle completely unstructured + * addresses (as opposed to guessing which parts of the address should be + * localities or administrative areas). + * @type array|\Google\Protobuf\Internal\RepeatedField $recipients + * Optional. The recipient at the address. + * This field may, under certain circumstances, contain multiline information. + * For example, it might contain "care of" information. + * @type string $organization + * Optional. The name of the organization at the address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\PostalAddress::initOnce(); + parent::__construct($data); + } + + /** + * The schema revision of the `PostalAddress`. This must be set to 0, which is + * the latest revision. + * All new revisions **must** be backward compatible with old revisions. + * + * Generated from protobuf field int32 revision = 1; + * @return int + */ + public function getRevision() + { + return $this->revision; + } + + /** + * The schema revision of the `PostalAddress`. This must be set to 0, which is + * the latest revision. + * All new revisions **must** be backward compatible with old revisions. + * + * Generated from protobuf field int32 revision = 1; + * @param int $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkInt32($var); + $this->revision = $var; + + return $this; + } + + /** + * Required. CLDR region code of the country/region of the address. This + * is never inferred and it is up to the user to ensure the value is + * correct. See http://cldr.unicode.org/ and + * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + * for details. Example: "CH" for Switzerland. + * + * Generated from protobuf field string region_code = 2; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. CLDR region code of the country/region of the address. This + * is never inferred and it is up to the user to ensure the value is + * correct. See http://cldr.unicode.org/ and + * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + * for details. Example: "CH" for Switzerland. + * + * Generated from protobuf field string region_code = 2; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Optional. BCP-47 language code of the contents of this address (if + * known). This is often the UI language of the input form or is expected + * to match one of the languages used in the address' country/region, or their + * transliterated equivalents. + * This can affect formatting in certain countries, but is not critical + * to the correctness of the data and will never affect any validation or + * other non-formatting related operations. + * If this value is not known, it should be omitted (rather than specifying a + * possibly incorrect default). + * Examples: "zh-Hant", "ja", "ja-Latn", "en". + * + * Generated from protobuf field string language_code = 3; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. BCP-47 language code of the contents of this address (if + * known). This is often the UI language of the input form or is expected + * to match one of the languages used in the address' country/region, or their + * transliterated equivalents. + * This can affect formatting in certain countries, but is not critical + * to the correctness of the data and will never affect any validation or + * other non-formatting related operations. + * If this value is not known, it should be omitted (rather than specifying a + * possibly incorrect default). + * Examples: "zh-Hant", "ja", "ja-Latn", "en". + * + * Generated from protobuf field string language_code = 3; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Postal code of the address. Not all countries use or require + * postal codes to be present, but where they are used, they may trigger + * additional validation with other parts of the address (e.g. state/zip + * validation in the U.S.A.). + * + * Generated from protobuf field string postal_code = 4; + * @return string + */ + public function getPostalCode() + { + return $this->postal_code; + } + + /** + * Optional. Postal code of the address. Not all countries use or require + * postal codes to be present, but where they are used, they may trigger + * additional validation with other parts of the address (e.g. state/zip + * validation in the U.S.A.). + * + * Generated from protobuf field string postal_code = 4; + * @param string $var + * @return $this + */ + public function setPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->postal_code = $var; + + return $this; + } + + /** + * Optional. Additional, country-specific, sorting code. This is not used + * in most regions. Where it is used, the value is either a string like + * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + * alone, representing the "sector code" (Jamaica), "delivery area indicator" + * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + * + * Generated from protobuf field string sorting_code = 5; + * @return string + */ + public function getSortingCode() + { + return $this->sorting_code; + } + + /** + * Optional. Additional, country-specific, sorting code. This is not used + * in most regions. Where it is used, the value is either a string like + * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + * alone, representing the "sector code" (Jamaica), "delivery area indicator" + * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + * + * Generated from protobuf field string sorting_code = 5; + * @param string $var + * @return $this + */ + public function setSortingCode($var) + { + GPBUtil::checkString($var, True); + $this->sorting_code = $var; + + return $this; + } + + /** + * Optional. Highest administrative subdivision which is used for postal + * addresses of a country or region. + * For example, this can be a state, a province, an oblast, or a prefecture. + * Specifically, for Spain this is the province and not the autonomous + * community (e.g. "Barcelona" and not "Catalonia"). + * Many countries don't use an administrative area in postal addresses. E.g. + * in Switzerland this should be left unpopulated. + * + * Generated from protobuf field string administrative_area = 6; + * @return string + */ + public function getAdministrativeArea() + { + return $this->administrative_area; + } + + /** + * Optional. Highest administrative subdivision which is used for postal + * addresses of a country or region. + * For example, this can be a state, a province, an oblast, or a prefecture. + * Specifically, for Spain this is the province and not the autonomous + * community (e.g. "Barcelona" and not "Catalonia"). + * Many countries don't use an administrative area in postal addresses. E.g. + * in Switzerland this should be left unpopulated. + * + * Generated from protobuf field string administrative_area = 6; + * @param string $var + * @return $this + */ + public function setAdministrativeArea($var) + { + GPBUtil::checkString($var, True); + $this->administrative_area = $var; + + return $this; + } + + /** + * Optional. Generally refers to the city/town portion of the address. + * Examples: US city, IT comune, UK post town. + * In regions of the world where localities are not well defined or do not fit + * into this structure well, leave locality empty and use address_lines. + * + * Generated from protobuf field string locality = 7; + * @return string + */ + public function getLocality() + { + return $this->locality; + } + + /** + * Optional. Generally refers to the city/town portion of the address. + * Examples: US city, IT comune, UK post town. + * In regions of the world where localities are not well defined or do not fit + * into this structure well, leave locality empty and use address_lines. + * + * Generated from protobuf field string locality = 7; + * @param string $var + * @return $this + */ + public function setLocality($var) + { + GPBUtil::checkString($var, True); + $this->locality = $var; + + return $this; + } + + /** + * Optional. Sublocality of the address. + * For example, this can be neighborhoods, boroughs, districts. + * + * Generated from protobuf field string sublocality = 8; + * @return string + */ + public function getSublocality() + { + return $this->sublocality; + } + + /** + * Optional. Sublocality of the address. + * For example, this can be neighborhoods, boroughs, districts. + * + * Generated from protobuf field string sublocality = 8; + * @param string $var + * @return $this + */ + public function setSublocality($var) + { + GPBUtil::checkString($var, True); + $this->sublocality = $var; + + return $this; + } + + /** + * Unstructured address lines describing the lower levels of an address. + * Because values in address_lines do not have type information and may + * sometimes contain multiple values in a single field (e.g. + * "Austin, TX"), it is important that the line order is clear. The order of + * address lines should be "envelope order" for the country/region of the + * address. In places where this can vary (e.g. Japan), address_language is + * used to make it explicit (e.g. "ja" for large-to-small ordering and + * "ja-Latn" or "en" for small-to-large). This way, the most specific line of + * an address can be selected based on the language. + * The minimum permitted structural representation of an address consists + * of a region_code with all remaining information placed in the + * address_lines. It would be possible to format such an address very + * approximately without geocoding, but no semantic reasoning could be + * made about any of the address components until it was at least + * partially resolved. + * Creating an address only containing a region_code and address_lines, and + * then geocoding is the recommended way to handle completely unstructured + * addresses (as opposed to guessing which parts of the address should be + * localities or administrative areas). + * + * Generated from protobuf field repeated string address_lines = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAddressLines() + { + return $this->address_lines; + } + + /** + * Unstructured address lines describing the lower levels of an address. + * Because values in address_lines do not have type information and may + * sometimes contain multiple values in a single field (e.g. + * "Austin, TX"), it is important that the line order is clear. The order of + * address lines should be "envelope order" for the country/region of the + * address. In places where this can vary (e.g. Japan), address_language is + * used to make it explicit (e.g. "ja" for large-to-small ordering and + * "ja-Latn" or "en" for small-to-large). This way, the most specific line of + * an address can be selected based on the language. + * The minimum permitted structural representation of an address consists + * of a region_code with all remaining information placed in the + * address_lines. It would be possible to format such an address very + * approximately without geocoding, but no semantic reasoning could be + * made about any of the address components until it was at least + * partially resolved. + * Creating an address only containing a region_code and address_lines, and + * then geocoding is the recommended way to handle completely unstructured + * addresses (as opposed to guessing which parts of the address should be + * localities or administrative areas). + * + * Generated from protobuf field repeated string address_lines = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAddressLines($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->address_lines = $arr; + + return $this; + } + + /** + * Optional. The recipient at the address. + * This field may, under certain circumstances, contain multiline information. + * For example, it might contain "care of" information. + * + * Generated from protobuf field repeated string recipients = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecipients() + { + return $this->recipients; + } + + /** + * Optional. The recipient at the address. + * This field may, under certain circumstances, contain multiline information. + * For example, it might contain "care of" information. + * + * Generated from protobuf field repeated string recipients = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecipients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->recipients = $arr; + + return $this; + } + + /** + * Optional. The name of the organization at the address. + * + * Generated from protobuf field string organization = 11; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * Optional. The name of the organization at the address. + * + * Generated from protobuf field string organization = 11; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/Quaternion.php b/vendor/google/common-protos/src/Type/Quaternion.php new file mode 100644 index 0000000..f3c316d --- /dev/null +++ b/vendor/google/common-protos/src/Type/Quaternion.php @@ -0,0 +1,211 @@ +google.type.Quaternion + */ +class Quaternion extends \Google\Protobuf\Internal\Message +{ + /** + * The x component. + * + * Generated from protobuf field double x = 1; + */ + protected $x = 0.0; + /** + * The y component. + * + * Generated from protobuf field double y = 2; + */ + protected $y = 0.0; + /** + * The z component. + * + * Generated from protobuf field double z = 3; + */ + protected $z = 0.0; + /** + * The scalar component. + * + * Generated from protobuf field double w = 4; + */ + protected $w = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $x + * The x component. + * @type float $y + * The y component. + * @type float $z + * The z component. + * @type float $w + * The scalar component. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Quaternion::initOnce(); + parent::__construct($data); + } + + /** + * The x component. + * + * Generated from protobuf field double x = 1; + * @return float + */ + public function getX() + { + return $this->x; + } + + /** + * The x component. + * + * Generated from protobuf field double x = 1; + * @param float $var + * @return $this + */ + public function setX($var) + { + GPBUtil::checkDouble($var); + $this->x = $var; + + return $this; + } + + /** + * The y component. + * + * Generated from protobuf field double y = 2; + * @return float + */ + public function getY() + { + return $this->y; + } + + /** + * The y component. + * + * Generated from protobuf field double y = 2; + * @param float $var + * @return $this + */ + public function setY($var) + { + GPBUtil::checkDouble($var); + $this->y = $var; + + return $this; + } + + /** + * The z component. + * + * Generated from protobuf field double z = 3; + * @return float + */ + public function getZ() + { + return $this->z; + } + + /** + * The z component. + * + * Generated from protobuf field double z = 3; + * @param float $var + * @return $this + */ + public function setZ($var) + { + GPBUtil::checkDouble($var); + $this->z = $var; + + return $this; + } + + /** + * The scalar component. + * + * Generated from protobuf field double w = 4; + * @return float + */ + public function getW() + { + return $this->w; + } + + /** + * The scalar component. + * + * Generated from protobuf field double w = 4; + * @param float $var + * @return $this + */ + public function setW($var) + { + GPBUtil::checkDouble($var); + $this->w = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/TimeOfDay.php b/vendor/google/common-protos/src/Type/TimeOfDay.php new file mode 100644 index 0000000..4ab91e0 --- /dev/null +++ b/vendor/google/common-protos/src/Type/TimeOfDay.php @@ -0,0 +1,180 @@ +google.type.TimeOfDay + */ +class TimeOfDay extends \Google\Protobuf\Internal\Message +{ + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + * + * Generated from protobuf field int32 hours = 1; + */ + protected $hours = 0; + /** + * Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 2; + */ + protected $minutes = 0; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 3; + */ + protected $seconds = 0; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + * + * Generated from protobuf field int32 nanos = 4; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $hours + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + * @type int $minutes + * Minutes of hour of day. Must be from 0 to 59. + * @type int $seconds + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + * @type int $nanos + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Timeofday::initOnce(); + parent::__construct($data); + } + + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + * + * Generated from protobuf field int32 hours = 1; + * @return int + */ + public function getHours() + { + return $this->hours; + } + + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + * + * Generated from protobuf field int32 hours = 1; + * @param int $var + * @return $this + */ + public function setHours($var) + { + GPBUtil::checkInt32($var); + $this->hours = $var; + + return $this; + } + + /** + * Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 2; + * @return int + */ + public function getMinutes() + { + return $this->minutes; + } + + /** + * Minutes of hour of day. Must be from 0 to 59. + * + * Generated from protobuf field int32 minutes = 2; + * @param int $var + * @return $this + */ + public function setMinutes($var) + { + GPBUtil::checkInt32($var); + $this->minutes = $var; + + return $this; + } + + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 3; + * @return int + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + * + * Generated from protobuf field int32 seconds = 3; + * @param int $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt32($var); + $this->seconds = $var; + + return $this; + } + + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + * + * Generated from protobuf field int32 nanos = 4; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + * + * Generated from protobuf field int32 nanos = 4; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/common-protos/src/Type/TimeZone.php b/vendor/google/common-protos/src/Type/TimeZone.php new file mode 100644 index 0000000..064bc32 --- /dev/null +++ b/vendor/google/common-protos/src/Type/TimeZone.php @@ -0,0 +1,102 @@ +google.type.TimeZone + */ +class TimeZone extends \Google\Protobuf\Internal\Message +{ + /** + * IANA Time Zone Database time zone, e.g. "America/New_York". + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Optional. IANA Time Zone Database version number, e.g. "2019a". + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * IANA Time Zone Database time zone, e.g. "America/New_York". + * @type string $version + * Optional. IANA Time Zone Database version number, e.g. "2019a". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Type\Datetime::initOnce(); + parent::__construct($data); + } + + /** + * IANA Time Zone Database time zone, e.g. "America/New_York". + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * IANA Time Zone Database time zone, e.g. "America/New_York". + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. IANA Time Zone Database version number, e.g. "2019a". + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. IANA Time Zone Database version number, e.g. "2019a". + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/vendor/google/gax/.repo-metadata.json b/vendor/google/gax/.repo-metadata.json new file mode 100644 index 0000000..2fe16da --- /dev/null +++ b/vendor/google/gax/.repo-metadata.json @@ -0,0 +1,7 @@ +{ + "language": "php", + "distribution_name": "google/gax", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/gax/latest", + "library_type": "CORE" +} diff --git a/vendor/google/gax/CHANGELOG.md b/vendor/google/gax/CHANGELOG.md new file mode 100644 index 0000000..d296e0d --- /dev/null +++ b/vendor/google/gax/CHANGELOG.md @@ -0,0 +1,371 @@ +# Changelog + +## [1.38.0](https://github.com/googleapis/gax-php/compare/v1.37.0...v1.38.0) (2025-09-17) + + +### Features + +* Add the rpcName to the BIDI stream opening request ([#630](https://github.com/googleapis/gax-php/issues/630)) ([9c61d8f](https://github.com/googleapis/gax-php/commit/9c61d8f2bd09731d5f22c22eb81895eaf4db2031)) +* Make options classes fluid ([#618](https://github.com/googleapis/gax-php/issues/618)) ([427b46e](https://github.com/googleapis/gax-php/commit/427b46e91b3881fd0da361b5b351c6dda47e640a)) + + +### Bug Fixes + +* Update protobuf RepeatedField to new namespace ([#624](https://github.com/googleapis/gax-php/issues/624)) ([3558cc4](https://github.com/googleapis/gax-php/commit/3558cc49139861fa411c77b33f457467ec8daa97)) + +## [1.37.0](https://github.com/googleapis/gax-php/compare/v1.36.1...v1.37.0) (2025-09-10) + + +### Features + +* Support client options in ClientOptionsTrait::buildClientOptions ([#621](https://github.com/googleapis/gax-php/issues/621)) ([68e2336](https://github.com/googleapis/gax-php/commit/68e23369657b1740fffe480f96d9d7b04e3e38c2)) + + +### Bug Fixes + +* Ensure compute request build parameters have the operation ID last ([#625](https://github.com/googleapis/gax-php/issues/625)) ([f90ab28](https://github.com/googleapis/gax-php/commit/f90ab28cea6bbbd00f2a652a6d77babb69b2ada8)) + +## [1.36.1](https://github.com/googleapis/gax-php/compare/v1.36.0...v1.36.1) (2025-05-20) + + +### Bug Fixes + +* Protobuf 4.31 deprecations ([#616](https://github.com/googleapis/gax-php/issues/616)) ([b06048b](https://github.com/googleapis/gax-php/commit/b06048be5c29a2534ba1c908642c69798e145d99)) + +## [1.36.0](https://github.com/googleapis/gax-php/compare/v1.35.1...v1.36.0) (2024-12-11) + + +### Features + +* Add logging to the supported transports ([#585](https://github.com/googleapis/gax-php/issues/585)) ([819a677](https://github.com/googleapis/gax-php/commit/819a677e0d89d75662b30a1dbdd45f6a610d9f0c)) + +## [1.35.1](https://github.com/googleapis/gax-php/compare/v1.35.0...v1.35.1) (2024-12-04) + + +### Bug Fixes + +* Ensure hasEmulator client option is passed to createTransport ([#594](https://github.com/googleapis/gax-php/issues/594)) ([13bbe8a](https://github.com/googleapis/gax-php/commit/13bbe8a2e6df2bfd6c5febba735113f1abcba201)) +* Remove implicit null, add php 8.4 ([#599](https://github.com/googleapis/gax-php/issues/599)) ([af0a0e7](https://github.com/googleapis/gax-php/commit/af0a0e708dfbea46de627965db0f63114fcfb67f)) + +## [1.35.0](https://github.com/googleapis/gax-php/compare/v1.34.1...v1.35.0) (2024-11-06) + + +### Features + +* Add `InsecureRequestBuilder` for emulator ([#582](https://github.com/googleapis/gax-php/issues/582)) ([cc1d047](https://github.com/googleapis/gax-php/commit/cc1d0472a1caf31bb3ecd98da1d6b8588f95b63a)) +* **docs:** Use doctum shared workflow for reference docs ([#578](https://github.com/googleapis/gax-php/issues/578)) ([021763f](https://github.com/googleapis/gax-php/commit/021763f255acaffda6ebe34a9d1a01c2bd187326)) +* Support for API Key client option ([#351](https://github.com/googleapis/gax-php/issues/351)) ([ab7f04f](https://github.com/googleapis/gax-php/commit/ab7f04fd8c9f7ed33a58155ae6b9e740f365ac2a)) + + +### Bug Fixes + +* **tests:** Skip docs tests from forks ([#591](https://github.com/googleapis/gax-php/issues/591)) ([35ae9f7](https://github.com/googleapis/gax-php/commit/35ae9f708d3ef937308d266e3a012296ce8606fc)) + +## [1.34.1](https://github.com/googleapis/gax-php/compare/v1.34.0...v1.34.1) (2024-08-13) + + +### Bug Fixes + +* Disable universe domain check for MDS ([#575](https://github.com/googleapis/gax-php/issues/575)) ([a47a469](https://github.com/googleapis/gax-php/commit/a47a469d9ef76613c5d320539646323a5e7b978d)) + +## [1.34.0](https://github.com/googleapis/gax-php/compare/v1.33.0...v1.34.0) (2024-05-29) + + +### Features + +* Support new surface operations clients ([#569](https://github.com/googleapis/gax-php/issues/569)) ([fa06e73](https://github.com/googleapis/gax-php/commit/fa06e738fc63a3b9f70a26e6d20f30c582ef1870)) + +## [1.33.0](https://github.com/googleapis/gax-php/compare/v1.32.0...v1.33.0) (2024-05-10) + + +### Features + +* Support V2 OperationsClient in OperationResponse ([#564](https://github.com/googleapis/gax-php/issues/564)) ([7f8bb13](https://github.com/googleapis/gax-php/commit/7f8bb13f78463b1e7f2289ce5514763992806e5e)) + +## [1.32.0](https://github.com/googleapis/gax-php/compare/v1.31.0...v1.32.0) (2024-04-24) + + +### Features + +* Add a custom encoder in Serializer ([#554](https://github.com/googleapis/gax-php/issues/554)) ([be28b5a](https://github.com/googleapis/gax-php/commit/be28b5a859b674a3d398bdaab7ed86b93dd7a593)) + +## [1.31.0](https://github.com/googleapis/gax-php/compare/v1.30.1...v1.31.0) (2024-04-22) + + +### Features + +* Add the api header to the GapicClientTrait ([#553](https://github.com/googleapis/gax-php/issues/553)) ([cc102eb](https://github.com/googleapis/gax-php/commit/cc102ebdfd63019b1e6bcd51515be2a2cb13534d)) + + +### Bug Fixes + +* Add caching and micro optimizations in Serializer ([5a5d8a7](https://github.com/googleapis/gax-php/commit/5a5d8a763d8e2d470a6d960b788e7d2a938cd64f)) +* Pass auth http handler to update metadata call ([#557](https://github.com/googleapis/gax-php/issues/557)) ([6e04a50](https://github.com/googleapis/gax-php/commit/6e04a50d013f5686ec5e66c457b9b440b9bcde9e)) + +## [1.30.0](https://github.com/googleapis/gax-php/compare/v1.29.1...v1.30.0) (2024-02-28) + + +### Features + +* Auto Populate fields configured for auto population in Rpc Request Message ([#543](https://github.com/googleapis/gax-php/issues/543)) ([99d6b89](https://github.com/googleapis/gax-php/commit/99d6b899ddf55d51fab976844c1e0f8fe9918a52)) +* Make the default authHttpHandler in CredentialsWrapper null ([#544](https://github.com/googleapis/gax-php/issues/544)) ([2a25eea](https://github.com/googleapis/gax-php/commit/2a25eeacadf2f783f64b4eca4f94e067ddef3eaa)) + +## [1.29.1](https://github.com/googleapis/gax-php/compare/v1.29.0...v1.29.1) (2024-02-26) + + +### Bug Fixes + +* Allow InsecureCredentialsWrapper::getAuthorizationHeaderCallback to return null ([#541](https://github.com/googleapis/gax-php/issues/541)) ([676f4f7](https://github.com/googleapis/gax-php/commit/676f4f7e3d8925d8aba00285616fdf89440b45f9)) + +## [1.29.0](https://github.com/googleapis/gax-php/compare/v1.28.1...v1.29.0) (2024-02-26) + + +### Features + +* Add InsecureCredentialsWrapper for Emulator connection ([#538](https://github.com/googleapis/gax-php/issues/538)) ([b5dbeaf](https://github.com/googleapis/gax-php/commit/b5dbeaf33594b300a0c678ffc6a6946b09fce7dd)) + +## [1.28.1](https://github.com/googleapis/gax-php/compare/v1.28.0...v1.28.1) (2024-02-20) + + +### Bug Fixes + +* Universe domain check for grpc transport ([#534](https://github.com/googleapis/gax-php/issues/534)) ([1026d8a](https://github.com/googleapis/gax-php/commit/1026d8aec73e0aad8949a86ee7575e3edb3d56be)) + +## [1.28.0](https://github.com/googleapis/gax-php/compare/v1.27.2...v1.28.0) (2024-02-15) + + +### Features + +* Allow setting of universe domain in environment variable ([#520](https://github.com/googleapis/gax-php/issues/520)) ([6e6603b](https://github.com/googleapis/gax-php/commit/6e6603b03285f3f8d1072776cd206720e3990f50)) + +## [1.27.2](https://github.com/googleapis/gax-php/compare/v1.27.1...v1.27.2) (2024-02-14) + + +### Bug Fixes + +* Typo in TransportOptions option name ([#530](https://github.com/googleapis/gax-php/issues/530)) ([6914fe0](https://github.com/googleapis/gax-php/commit/6914fe04554867bd827be6596fafc751a3d7621a)) + +## [1.27.1](https://github.com/googleapis/gax-php/compare/v1.27.0...v1.27.1) (2024-02-14) + + +### Bug Fixes + +* Issues in Options classes ([#528](https://github.com/googleapis/gax-php/issues/528)) ([aa9ba3a](https://github.com/googleapis/gax-php/commit/aa9ba3a6bac9324ad894d9677da0e897497ebab2)) + +## [1.27.0](https://github.com/googleapis/gax-php/compare/v1.26.3...v1.27.0) (2024-02-07) + + +### Features + +* Create ClientOptionsTrait ([#527](https://github.com/googleapis/gax-php/issues/527)) ([cfe2c60](https://github.com/googleapis/gax-php/commit/cfe2c60a36233f74259c96a6799d8492ed7c45d0)) +* Implement ProjectIdProviderInterface in CredentialsWrapper ([#523](https://github.com/googleapis/gax-php/issues/523)) ([b56a463](https://github.com/googleapis/gax-php/commit/b56a4635abfeeec08895202da8218e9ba915413e)) +* Update ArrayTrait to be consistent with Core ([#526](https://github.com/googleapis/gax-php/issues/526)) ([8e44185](https://github.com/googleapis/gax-php/commit/8e44185dd6f8f8f9ef5b136776cba61ec7a8b8f6)) + + +### Bug Fixes + +* Correct exception type for Guzzle promise ([#521](https://github.com/googleapis/gax-php/issues/521)) ([7129373](https://github.com/googleapis/gax-php/commit/712937339c134e1d92cab5fa736cfe1bbcd7f343)) + +## [1.26.3](https://github.com/googleapis/gax-php/compare/v1.26.2...v1.26.3) (2024-01-18) + + +### Bug Fixes + +* CallOptions should use transportOptions ([#513](https://github.com/googleapis/gax-php/issues/513)) ([2d45ee1](https://github.com/googleapis/gax-php/commit/2d45ee187cdc3619b30c51b653b508718baf3af4)) + +## [1.26.2](https://github.com/googleapis/gax-php/compare/v1.26.1...v1.26.2) (2024-01-09) + + +### Bug Fixes + +* Ensure modifyClientOptions is called for new surface clients ([#515](https://github.com/googleapis/gax-php/issues/515)) ([68231b8](https://github.com/googleapis/gax-php/commit/68231b896dec8efb86f8986aefba3d247d2a2d1c)) + +## [1.26.1](https://github.com/googleapis/gax-php/compare/v1.26.0...v1.26.1) (2024-01-04) + + +### Bug Fixes + +* Widen google/longrunning version ([#511](https://github.com/googleapis/gax-php/issues/511)) ([b93096d](https://github.com/googleapis/gax-php/commit/b93096d0e10bde14c50480ea9f0423c292fbd5a6)) + +## [1.26.0](https://github.com/googleapis/gax-php/compare/v1.25.0...v1.26.0) (2024-01-03) + + +### Features + +* Add support for universe domain ([#502](https://github.com/googleapis/gax-php/issues/502)) ([5a26fac](https://github.com/googleapis/gax-php/commit/5a26facad5c2e5c30945987c422bb78a3fffb9b1)) +* Interface and methods for middleware stack ([#473](https://github.com/googleapis/gax-php/issues/473)) ([766da7b](https://github.com/googleapis/gax-php/commit/766da7b369409ec1b29376b533e7f22ee7f745f4)) + + +### Bug Fixes + +* Accept throwable for retry settings ([#509](https://github.com/googleapis/gax-php/issues/509)) ([5af9c3c](https://github.com/googleapis/gax-php/commit/5af9c3c650419c8f1a590783e954cd11dc1f0d56)) + +## [1.25.0](https://github.com/googleapis/gax-php/compare/v1.24.0...v1.25.0) (2023-11-02) + + +### Features + +* Add custom retries ([#489](https://github.com/googleapis/gax-php/issues/489)) ([ef0789b](https://github.com/googleapis/gax-php/commit/ef0789b73ef28d79a08c354d1361a9ccc6206088)) + +## [1.24.0](https://github.com/googleapis/gax-php/compare/v1.23.0...v1.24.0) (2023-10-10) + + +### Features + +* Ensure NewClientSurface works for consoldiated v2 clients ([#493](https://github.com/googleapis/gax-php/issues/493)) ([cb8706e](https://github.com/googleapis/gax-php/commit/cb8706ef9211a1e43f733d2c8f272a330c2fa792)) + +## [1.23.0](https://github.com/googleapis/gax-php/compare/v1.22.1...v1.23.0) (2023-09-14) + + +### Features + +* Typesafety for new surface client options ([#450](https://github.com/googleapis/gax-php/issues/450)) ([21550c5](https://github.com/googleapis/gax-php/commit/21550c5bf07f178f2043b0630f3ac34fcc3a05e0)) + +## [1.22.1](https://github.com/googleapis/gax-php/compare/v1.22.0...v1.22.1) (2023-08-04) + + +### Bug Fixes + +* Deprecation notice while GapicClientTrait->setClientOptions ([#483](https://github.com/googleapis/gax-php/issues/483)) ([1c66d34](https://github.com/googleapis/gax-php/commit/1c66d3445dca4d43831a2f4e26e59b9bd1cb76dd)) + +## [1.22.0](https://github.com/googleapis/gax-php/compare/v1.21.1...v1.22.0) (2023-07-31) + + +### Features + +* Sets api headers for "gcloud-php-new" and "gcloud-php-legacy" surface versions ([#470](https://github.com/googleapis/gax-php/issues/470)) ([2d8ccff](https://github.com/googleapis/gax-php/commit/2d8ccff419a076ee2fe9d3dc7ecd5509c74afb4c)) + +## [1.21.1](https://github.com/googleapis/gax-php/compare/v1.21.0...v1.21.1) (2023-06-28) + + +### Bug Fixes + +* Revert "chore: remove unnecessary api endpoint check" ([#476](https://github.com/googleapis/gax-php/issues/476)) ([13e773f](https://github.com/googleapis/gax-php/commit/13e773f5b09f9a99b8425835815746d37e9c1da3)) + +## [1.21.0](https://github.com/googleapis/gax-php/compare/v1.20.2...v1.21.0) (2023-06-09) + + +### Features + +* Support guzzle/promises:v2 ([753eae9](https://github.com/googleapis/gax-php/commit/753eae9acf638f3356f8149acf84444eb399a699)) + +## [1.20.2](https://github.com/googleapis/gax-php/compare/v1.20.1...v1.20.2) (2023-05-12) + + +### Bug Fixes + +* Ensure timeout set by RetryMiddleware is int not float ([#462](https://github.com/googleapis/gax-php/issues/462)) ([9d4c7fa](https://github.com/googleapis/gax-php/commit/9d4c7fa89445c63ec0bf4745ed9d98fd185ef51f)) + +## [1.20.1](https://github.com/googleapis/gax-php/compare/v1.20.0...v1.20.1) (2023-05-12) + + +### Bug Fixes + +* Default value for error message in createFromRequestException ([#463](https://github.com/googleapis/gax-php/issues/463)) ([7552d22](https://github.com/googleapis/gax-php/commit/7552d22241c2f488606e9546efdd6edea356ee9a)) + +## [1.20.0](https://github.com/googleapis/gax-php/compare/v1.19.1...v1.20.0) (2023-05-01) + + +### Features + +* **deps:** Support google/common-protos 4.0 ([af1db80](https://github.com/googleapis/gax-php/commit/af1db80c22307597f0dfcb9fafa86caf466588ba)) +* **deps:** Support google/grpc-gcp 0.3 ([18edc2c](https://github.com/googleapis/gax-php/commit/18edc2ce6a1a615e3ea7c00ede313c32cec4b799)) + +## [1.19.1](https://github.com/googleapis/gax-php/compare/v1.19.0...v1.19.1) (2023-03-16) + + +### Bug Fixes + +* Simplify ResourceHelperTrait registration ([#447](https://github.com/googleapis/gax-php/issues/447)) ([4949dc0](https://github.com/googleapis/gax-php/commit/4949dc0c4cd5e58af7933a1d2ecab90832c0b036)) + +## [1.19.0](https://github.com/googleapis/gax-php/compare/v1.18.2...v1.19.0) (2023-01-27) + + +### Features + +* Ensure cache is used in calls to ADC::onGCE ([#441](https://github.com/googleapis/gax-php/issues/441)) ([64a4184](https://github.com/googleapis/gax-php/commit/64a4184ab69d13104d269b15a55d4b8b2515b5a6)) + +## [1.18.2](https://github.com/googleapis/gax-php/compare/v1.18.1...v1.18.2) (2023-01-06) + + +### Bug Fixes + +* Ensure metadata return type is loaded into descriptor pool ([#439](https://github.com/googleapis/gax-php/issues/439)) ([a40cf8d](https://github.com/googleapis/gax-php/commit/a40cf8d87ac9aa45d18239456e2e4c96653f1a6c)) +* Implicit conversion from float to int warning ([#438](https://github.com/googleapis/gax-php/issues/438)) ([1cb62ad](https://github.com/googleapis/gax-php/commit/1cb62ad3d92ace0518017abc972e912b339f1b56)) + +## [1.18.1](https://github.com/googleapis/gax-php/compare/v1.18.0...v1.18.1) (2022-12-06) + + +### Bug Fixes + +* Message parameters in required querystring ([#430](https://github.com/googleapis/gax-php/issues/430)) ([77bc5e1](https://github.com/googleapis/gax-php/commit/77bc5e1cb8f347601d9237bf5164cf8b8ad8aa0f)) + +## [1.18.0](https://github.com/googleapis/gax-php/compare/v1.17.0...v1.18.0) (2022-12-05) + + +### Features + +* Add ResourceHelperTrait ([#428](https://github.com/googleapis/gax-php/issues/428)) ([0439efa](https://github.com/googleapis/gax-php/commit/0439efa926865be5fea25b699469b0c1f8c1c768)) + +## [1.17.0](https://github.com/googleapis/gax-php/compare/v1.16.4...v1.17.0) (2022-09-08) + + +### Features + +* Add startAsyncCall support ([#418](https://github.com/googleapis/gax-php/issues/418)) ([fc90693](https://github.com/googleapis/gax-php/commit/fc9069373c329183e07f8d174084c305b2308209)) + +## [1.16.4](https://github.com/googleapis/gax-php/compare/v1.16.3...v1.16.4) (2022-08-25) + + +### Bug Fixes + +* use interfaceOverride instead of param ([#419](https://github.com/googleapis/gax-php/issues/419)) ([9dd5bc9](https://github.com/googleapis/gax-php/commit/9dd5bc91c4becfd2a0832288ab2406c3d224618e)) + +## [1.16.3](https://github.com/googleapis/gax-php/compare/v1.16.2...v1.16.3) (2022-08-23) + + +### Bug Fixes + +* add eager threshold ([#416](https://github.com/googleapis/gax-php/issues/416)) ([99eb172](https://github.com/googleapis/gax-php/commit/99eb172280f301b117fde9dcc92079ca03aa28bd)) + +## [1.16.2](https://github.com/googleapis/gax-php/compare/v1.16.1...v1.16.2) (2022-08-16) + + +### Bug Fixes + +* use responseType for custom operations ([#413](https://github.com/googleapis/gax-php/issues/413)) ([b643adf](https://github.com/googleapis/gax-php/commit/b643adfc44dd9fe82b0919e5b34edd00c7cdbb1f)) + +## [1.16.1](https://github.com/googleapis/gax-php/compare/v1.16.0...v1.16.1) (2022-08-11) + + +### Bug Fixes + +* remove typehint from extended method ([#411](https://github.com/googleapis/gax-php/issues/411)) ([fb37f73](https://github.com/googleapis/gax-php/commit/fb37f7365e888465d84fca304ca83360ddbae6c3)) + +## [1.16.0](https://github.com/googleapis/gax-php/compare/v1.15.0...v1.16.0) (2022-08-10) + + +### Features + +* additional typehinting ([#403](https://github.com/googleapis/gax-php/issues/403)) ([6597a07](https://github.com/googleapis/gax-php/commit/6597a07019665d91e07ea0a016c7d99c8a099cd2)) +* drop support for PHP 5.6 ([#397](https://github.com/googleapis/gax-php/issues/397)) ([b888b24](https://github.com/googleapis/gax-php/commit/b888b24e0e223784e22dbbbe27fe0284cdcdfc35)) +* introduce startApiCall ([#406](https://github.com/googleapis/gax-php/issues/406)) ([1cfeb62](https://github.com/googleapis/gax-php/commit/1cfeb628070c9c6e57b2dde854b0a973a888a2bc)) + + +### Bug Fixes + +* **deps:** update dependency google/longrunning to ^0.2 ([#407](https://github.com/googleapis/gax-php/issues/407)) ([54d4f32](https://github.com/googleapis/gax-php/commit/54d4f32ba5464d1f5da33e1c99a020174cae367c)) + +## [1.15.0](https://github.com/googleapis/gax-php/compare/v1.14.0...v1.15.0) (2022-08-02) + + +### Features + +* move LongRunning classes to a standalone package ([#401](https://github.com/googleapis/gax-php/issues/401)) ([1747125](https://github.com/googleapis/gax-php/commit/1747125c84dcc6d42390de7e78d2e326884e1073)) + +## [1.14.0](https://github.com/googleapis/gax-php/compare/v1.13.0...v1.14.0) (2022-07-26) + + +### Features + +* support requesting numeric enum rest encoding ([#395](https://github.com/googleapis/gax-php/issues/395)) ([0d74a48](https://github.com/googleapis/gax-php/commit/0d74a4877c5198cfaf534c4e55d7e418b50bc6ab)) diff --git a/vendor/google/gax/CODE_OF_CONDUCT.md b/vendor/google/gax/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..46b2a08 --- /dev/null +++ b/vendor/google/gax/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/vendor/google/gax/LICENSE b/vendor/google/gax/LICENSE new file mode 100644 index 0000000..1839ff9 --- /dev/null +++ b/vendor/google/gax/LICENSE @@ -0,0 +1,25 @@ +Copyright 2016, Google Inc. +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/google/gax/README.md b/vendor/google/gax/README.md new file mode 100644 index 0000000..6a6c017 --- /dev/null +++ b/vendor/google/gax/README.md @@ -0,0 +1,97 @@ +# Google API Core for PHP + +![Build Status](https://github.com/googleapis/gax-php/actions/workflows/tests.yml/badge.svg) + +- [Documentation](https://cloud.google.com/php/docs/reference/gax/latest) + +Google API Core for PHP (gax-php) is a set of modules which aids the development +of APIs for clients based on [gRPC][] and Google API conventions. + +Application code will rarely need to use most of the classes within this library +directly, but code generated automatically from the API definition files in +[Google APIs][] can use services such as page streaming and retry to provide a +more convenient and idiomatic API surface to callers. + +[gRPC]: http://grpc.io +[Google APIs]: https://github.com/googleapis/googleapis/ + +## PHP Versions + +gax-php currently requires PHP 8.1 or higher. + +## Contributing + +Contributions to this library are always welcome and highly encouraged. + +See the [CONTRIBUTING][] documentation for more information on how to get +started. + +[CONTRIBUTING]: https://github.com/googleapis/gax-php/blob/main/.github/CONTRIBUTING.md + +## Versioning + +This library follows [Semantic Versioning][]. + +This library is considered GA (generally available). As such, it will not +introduce backwards-incompatible changes in any minor or patch releases. We will +address issues and requests with the highest priority. + +[Semantic Versioning]: http://semver.org/ + +## Repository Structure + +All code lives under the src/ directory. Handwritten code lives in the +src/ApiCore directory and is contained in the `Google\ApiCore` namespace. + +Generated classes for protobuf common types and LongRunning client live under +the src/ directory, in the appropriate directory and namespace. + +Code in the metadata/ directory is provided to support generated protobuf +classes, and should not be used directly. + +## Development Set-Up + +These steps describe the dependencies to install for Linux, and equivalents can +be found for Mac or Windows. + +1. Install dependencies. + + ```sh + > cd ~/ + > sudo apt-get install php php-dev libcurl3-openssl-dev php-pear php-bcmath php-xml + > curl -sS https://getcomposer.org/installer | php + > sudo pecl install protobuf + ``` + +2. Set up this repo. + + ```sh + > cd /path/to/gax-php + > composer install + ``` + +3. Run tests. + + ```sh + > composer test + ``` + +4. Updating dependencies after changing `composer.json`: + + ```sh + > composer update + ` + ``` + +5. Formatting source: + + ```sh + > composer cs-lint + > composer cs-fix + ``` + +## License + +BSD - See [LICENSE][] for more information. + +[LICENSE]: https://github.com/googleapis/gax-php/blob/main/LICENSE diff --git a/vendor/google/gax/SECURITY.md b/vendor/google/gax/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/vendor/google/gax/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/gax/VERSION b/vendor/google/gax/VERSION new file mode 100644 index 0000000..ebeef2f --- /dev/null +++ b/vendor/google/gax/VERSION @@ -0,0 +1 @@ +1.38.0 diff --git a/vendor/google/gax/composer.json b/vendor/google/gax/composer.json new file mode 100644 index 0000000..652f0cf --- /dev/null +++ b/vendor/google/gax/composer.json @@ -0,0 +1,48 @@ +{ + "name": "google/gax", + "type": "library", + "description": "Google API Core for PHP", + "keywords": ["google"], + "homepage": "https://github.com/googleapis/gax-php", + "license": "BSD-3-Clause", + "require": { + "php": "^8.1", + "google/auth": "^1.45", + "google/grpc-gcp": "^0.4", + "grpc/grpc": "^1.13", + "google/protobuf": "^4.31", + "guzzlehttp/promises": "^2.0", + "guzzlehttp/psr7": "^2.0", + "google/common-protos": "^4.4", + "google/longrunning": "~0.4", + "ramsey/uuid": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "4.*", + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^2.0" + }, + "conflict": { + "ext-protobuf": "<4.31.0" + }, + "autoload": { + "psr-4": { + "Google\\ApiCore\\": "src", + "GPBMetadata\\ApiCore\\": "metadata/ApiCore" + } + }, + "autoload-dev": { + "psr-4": { + "Google\\ApiCore\\Dev\\": "dev/src", + "Google\\ApiCore\\Tests\\": "tests", + "GPBMetadata\\Google\\": "metadata/Google" + } + }, + "scripts": { + "regenerate-test-protos": "dev/sh/regenerate-test-protos.sh", + "test": "./vendor/bin/phpunit", + "cs-lint": "vendor/bin/phpcs --standard=./ruleset.xml", + "cs-fix": "vendor/bin/phpcbf --standard=./ruleset.xml" + } +} diff --git a/vendor/google/gax/metadata/ApiCore/Testing/Mocks.php b/vendor/google/gax/metadata/ApiCore/Testing/Mocks.php new file mode 100644 index 0000000..5dcb11f Binary files /dev/null and b/vendor/google/gax/metadata/ApiCore/Testing/Mocks.php differ diff --git a/vendor/google/gax/metadata/Google/ApiCore/Tests/Unit/Example.php b/vendor/google/gax/metadata/Google/ApiCore/Tests/Unit/Example.php new file mode 100644 index 0000000..d958e2b --- /dev/null +++ b/vendor/google/gax/metadata/Google/ApiCore/Tests/Unit/Example.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile(hex2bin( + "0a85010a0d6578616d706c652e70726f746f1219676f6f676c652e617069" . + "636f72652e74657374732e756e6974220b0a094d794d6573736167654244" . + "ca0219476f6f676c655c417069436f72655c54657374735c556e6974e202" . + "254750424d657461646174615c476f6f676c655c417069436f72655c5465" . + "7374735c556e6974620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/gax/metadata/README.md b/vendor/google/gax/metadata/README.md new file mode 100644 index 0000000..1bd4155 --- /dev/null +++ b/vendor/google/gax/metadata/README.md @@ -0,0 +1,6 @@ +# Google Protobuf Metadata Classes + +## WARNING! + +These classes are not intended for direct use - they exist only to support +the generated protobuf classes in src/ diff --git a/vendor/google/gax/phpstan.neon.dist b/vendor/google/gax/phpstan.neon.dist new file mode 100644 index 0000000..dcef113 --- /dev/null +++ b/vendor/google/gax/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + treatPhpDocTypesAsCertain: false + level: 5 + paths: + - src diff --git a/vendor/google/gax/phpunit.xml.dist b/vendor/google/gax/phpunit.xml.dist new file mode 100644 index 0000000..825f7f7 --- /dev/null +++ b/vendor/google/gax/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + + + + src/ApiCore + + + + + tests/Unit + + + diff --git a/vendor/google/gax/renovate.json b/vendor/google/gax/renovate.json new file mode 100644 index 0000000..6d81213 --- /dev/null +++ b/vendor/google/gax/renovate.json @@ -0,0 +1,7 @@ +{ + "extends": [ + "config:base", + ":preserveSemverRanges", + ":disableDependencyDashboard" + ] +} diff --git a/vendor/google/gax/src/AgentHeader.php b/vendor/google/gax/src/AgentHeader.php new file mode 100644 index 0000000..4fda2b0 --- /dev/null +++ b/vendor/google/gax/src/AgentHeader.php @@ -0,0 +1,132 @@ + $value) { + $metricsList[] = $key . '/' . $value; + } + return [self::AGENT_HEADER_KEY => [implode(' ', $metricsList)]]; + } + + /** + * Reads the gapic version string from a VERSION file. In order to determine the file + * location, this method follows this procedure: + * - accepts a class name $callingClass + * - identifies the file defining that class + * - searches up the directory structure for the 'src' directory + * - looks in the directory above 'src' for a file named VERSION + * + * @param string $callingClass + * @return string the gapic version + * @throws \ReflectionException + */ + public static function readGapicVersionFromFile(string $callingClass) + { + $callingClassFile = (new \ReflectionClass($callingClass))->getFileName(); + $versionFile = substr( + $callingClassFile, + 0, + strrpos($callingClassFile, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR) + ) . DIRECTORY_SEPARATOR . 'VERSION'; + + return Version::readVersionFile($versionFile); + } +} diff --git a/vendor/google/gax/src/ApiException.php b/vendor/google/gax/src/ApiException.php new file mode 100644 index 0000000..5a3edd5 --- /dev/null +++ b/vendor/google/gax/src/ApiException.php @@ -0,0 +1,345 @@ + null, + 'metadata' => null, + 'basicMessage' => $message, + ]; + parent::__construct($message, $code, $optionalArgs['previous']); + $this->status = $status; + $this->metadata = $optionalArgs['metadata']; + $this->basicMessage = $optionalArgs['basicMessage']; + if ($this->metadata) { + $this->decodedMetadataErrorInfo = self::decodeMetadataErrorInfo($this->metadata); + } + } + + public function getStatus() + { + return $this->status; + } + + /** + * Returns null if metadata does not contain error info, or returns containsErrorInfo() array + * if the metadata does contain error info. + * @param array $metadata + * @return array $details { + * @type string|null $reason + * @type string|null $domain + * @type array|null $errorInfoMetadata + * } + */ + private static function decodeMetadataErrorInfo(array $metadata) + { + $details = []; + // ApiExceptions created from RPC status have metadata that is an array of objects. + if (is_object(reset($metadata))) { + $metadataRpcStatus = Serializer::decodeAnyMessages($metadata); + $details = self::containsErrorInfo($metadataRpcStatus); + } elseif (self::containsErrorInfo($metadata)) { + $details = self::containsErrorInfo($metadata); + } else { + // For GRPC-based responses, the $metadata needs to be decoded. + $metadataGrpc = Serializer::decodeMetadata($metadata); + $details = self::containsErrorInfo($metadataGrpc); + } + return $details; + } + + /** + * Returns the `reason` in ErrorInfo for an exception, or null if there is no ErrorInfo. + * @return string|null $reason + */ + public function getReason() + { + return ($this->decodedMetadataErrorInfo) ? $this->decodedMetadataErrorInfo['reason'] : null; + } + + /** + * Returns the `domain` in ErrorInfo for an exception, or null if there is no ErrorInfo. + * @return string|null $domain + */ + public function getDomain() + { + return ($this->decodedMetadataErrorInfo) ? $this->decodedMetadataErrorInfo['domain'] : null; + } + + /** + * Returns the `metadata` in ErrorInfo for an exception, or null if there is no ErrorInfo. + * @return array|null $errorInfoMetadata + */ + public function getErrorInfoMetadata() + { + return ($this->decodedMetadataErrorInfo) ? $this->decodedMetadataErrorInfo['errorInfoMetadata'] : null; + } + + /** + * @param stdClass $status + * @return ApiException + */ + public static function createFromStdClass(stdClass $status) + { + $metadata = property_exists($status, 'metadata') ? $status->metadata : null; + return self::create( + $status->details, + $status->code, + $metadata, + Serializer::decodeMetadata((array) $metadata) + ); + } + + /** + * @param string $basicMessage + * @param int $rpcCode + * @param array|null $metadata + * @param Exception $previous + * @return ApiException + */ + public static function createFromApiResponse( + $basicMessage, + $rpcCode, + ?array $metadata = null, + ?Exception $previous = null + ) { + return self::create( + $basicMessage, + $rpcCode, + $metadata, + Serializer::decodeMetadata((array) $metadata), + $previous + ); + } + + /** + * For REST-based responses, the metadata does not need to be decoded. + * + * @param string $basicMessage + * @param int $rpcCode + * @param array|null $metadata + * @param Exception $previous + * @return ApiException + */ + public static function createFromRestApiResponse( + $basicMessage, + $rpcCode, + ?array $metadata = null, + ?Exception $previous = null + ) { + return self::create( + $basicMessage, + $rpcCode, + $metadata, + is_null($metadata) ? [] : $metadata, + $previous + ); + } + + /** + * Checks if decoded metadata includes errorInfo message. + * If errorInfo is set, it will always contain `reason`, `domain`, and `metadata` keys. + * @param array $decodedMetadata + * @return array { + * @type string $reason + * @type string $domain + * @type array $errorInfoMetadata + * } + */ + private static function containsErrorInfo(array $decodedMetadata) + { + if (empty($decodedMetadata)) { + return []; + } + foreach ($decodedMetadata as $value) { + $isErrorInfoArray = isset($value['reason']) && isset($value['domain']) && isset($value['metadata']); + if ($isErrorInfoArray) { + return [ + 'reason' => $value['reason'], + 'domain' => $value['domain'], + 'errorInfoMetadata' => $value['metadata'], + ]; + } + } + return []; + } + + /** + * Construct an ApiException with a useful message, including decoded metadata. + * If the decoded metadata includes an errorInfo message, then the domain, reason, + * and metadata fields from that message are hoisted directly into the error. + * + * @param string $basicMessage + * @param int $rpcCode + * @param iterable|null $metadata + * @param array $decodedMetadata + * @param Exception|null $previous + * @return ApiException + */ + private static function create( + string $basicMessage, + int $rpcCode, + $metadata, + array $decodedMetadata, + ?Exception $previous = null + ) { + $containsErrorInfo = self::containsErrorInfo($decodedMetadata); + $rpcStatus = ApiStatus::statusFromRpcCode($rpcCode); + $messageData = [ + 'message' => $basicMessage, + 'code' => $rpcCode, + 'status' => $rpcStatus, + 'details' => $decodedMetadata + ]; + if ($containsErrorInfo) { + $messageData = array_merge($containsErrorInfo, $messageData); + } + + $message = json_encode($messageData, JSON_PRETTY_PRINT); + + if ($metadata instanceof RepeatedField) { + $metadata = iterator_to_array($metadata); + } + + return new ApiException($message, $rpcCode, $rpcStatus, [ + 'previous' => $previous, + 'metadata' => $metadata, + 'basicMessage' => $basicMessage, + ]); + } + + /** + * @param Status $status + * @return ApiException + */ + public static function createFromRpcStatus(Status $status) + { + return self::create( + $status->getMessage(), + $status->getCode(), + $status->getDetails(), + Serializer::decodeAnyMessages($status->getDetails()) + ); + } + + /** + * Creates an ApiException from a GuzzleHttp RequestException. + * + * @param RequestException $ex + * @param boolean $isStream + * @return ApiException + * @throws ValidationException + */ + public static function createFromRequestException(RequestException $ex, bool $isStream = false) + { + $res = $ex->getResponse(); + $body = (string) $res->getBody(); + $decoded = json_decode($body, true); + + // A streaming response body will return one error in an array. Parse + // that first (and only) error message, if provided. + if ($isStream && isset($decoded[0])) { + $decoded = $decoded[0]; + } + + if (isset($decoded['error']) && $decoded['error']) { + $error = $decoded['error']; + $basicMessage = $error['message'] ?? ''; + $code = isset($error['status']) + ? ApiStatus::rpcCodeFromStatus($error['status']) + : $ex->getCode(); + $metadata = $error['details'] ?? null; + return static::createFromRestApiResponse($basicMessage, $code, $metadata); + } + // Use the RPC code instead of the HTTP Status Code. + $code = ApiStatus::rpcCodeFromHttpStatusCode($res->getStatusCode()); + return static::createFromApiResponse($body, $code); + } + + /** + * @return null|string + */ + public function getBasicMessage() + { + return $this->basicMessage; + } + + /** + * @return mixed[] + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * String representation of ApiException + * @return string + */ + public function __toString() + { + return __CLASS__ . ": $this->message\n"; + } +} diff --git a/vendor/google/gax/src/ApiKeyHeaderCredentials.php b/vendor/google/gax/src/ApiKeyHeaderCredentials.php new file mode 100644 index 0000000..f4471d6 --- /dev/null +++ b/vendor/google/gax/src/ApiKeyHeaderCredentials.php @@ -0,0 +1,95 @@ +apiKey = $apiKey; + $this->quotaProject = $quotaProject; + } + + /** + * @return string|null The quota project associated with the credentials. + */ + public function getQuotaProject(): ?string + { + return $this->quotaProject; + } + + /** + * @param string|null $unusedAudience audiences are not supported for API keys. + * + * @return callable|null Callable function that returns the API key header. + */ + public function getAuthorizationHeaderCallback(?string $unusedAudience = null): ?callable + { + $apiKey = $this->apiKey; + + // NOTE: changes to this function should be treated carefully and tested thoroughly. It will + // be passed into the gRPC c extension, and changes have the potential to trigger very + // difficult-to-diagnose segmentation faults. + return function () use ($apiKey) { + return ['x-goog-api-key' => [$apiKey]]; + }; + } + + /** + * Verify that the expected universe domain matches the universe domain from the credentials. + * + * @throws ValidationException if the universe domain does not match. + */ + public function checkUniverseDomain(): void + { + // This is a no-op, as API keys are not tied to a universe domain. As a result, the + // potential for leaking API keys to the GDU is higher, and it's recommended to specify + // the "universeDomain" option with the GAPIC client. + } +} diff --git a/vendor/google/gax/src/ApiStatus.php b/vendor/google/gax/src/ApiStatus.php new file mode 100644 index 0000000..aa6adcf --- /dev/null +++ b/vendor/google/gax/src/ApiStatus.php @@ -0,0 +1,171 @@ + Code::OK, + ApiStatus::CANCELLED => Code::CANCELLED, + ApiStatus::UNKNOWN => Code::UNKNOWN, + ApiStatus::INVALID_ARGUMENT => Code::INVALID_ARGUMENT, + ApiStatus::DEADLINE_EXCEEDED => Code::DEADLINE_EXCEEDED, + ApiStatus::NOT_FOUND => Code::NOT_FOUND, + ApiStatus::ALREADY_EXISTS => Code::ALREADY_EXISTS, + ApiStatus::PERMISSION_DENIED => Code::PERMISSION_DENIED, + ApiStatus::RESOURCE_EXHAUSTED => Code::RESOURCE_EXHAUSTED, + ApiStatus::FAILED_PRECONDITION => Code::FAILED_PRECONDITION, + ApiStatus::ABORTED => Code::ABORTED, + ApiStatus::OUT_OF_RANGE => Code::OUT_OF_RANGE, + ApiStatus::UNIMPLEMENTED => Code::UNIMPLEMENTED, + ApiStatus::INTERNAL => Code::INTERNAL, + ApiStatus::UNAVAILABLE => Code::UNAVAILABLE, + ApiStatus::DATA_LOSS => Code::DATA_LOSS, + ApiStatus::UNAUTHENTICATED => Code::UNAUTHENTICATED, + ]; + private static $codeToApiStatusMap = [ + Code::OK => ApiStatus::OK, + Code::CANCELLED => ApiStatus::CANCELLED, + Code::UNKNOWN => ApiStatus::UNKNOWN, + Code::INVALID_ARGUMENT => ApiStatus::INVALID_ARGUMENT, + Code::DEADLINE_EXCEEDED => ApiStatus::DEADLINE_EXCEEDED, + Code::NOT_FOUND => ApiStatus::NOT_FOUND, + Code::ALREADY_EXISTS => ApiStatus::ALREADY_EXISTS, + Code::PERMISSION_DENIED => ApiStatus::PERMISSION_DENIED, + Code::RESOURCE_EXHAUSTED => ApiStatus::RESOURCE_EXHAUSTED, + Code::FAILED_PRECONDITION => ApiStatus::FAILED_PRECONDITION, + Code::ABORTED => ApiStatus::ABORTED, + Code::OUT_OF_RANGE => ApiStatus::OUT_OF_RANGE, + Code::UNIMPLEMENTED => ApiStatus::UNIMPLEMENTED, + Code::INTERNAL => ApiStatus::INTERNAL, + Code::UNAVAILABLE => ApiStatus::UNAVAILABLE, + Code::DATA_LOSS => ApiStatus::DATA_LOSS, + Code::UNAUTHENTICATED => ApiStatus::UNAUTHENTICATED, + ]; + private static $httpStatusCodeToRpcCodeMap = [ + 400 => Code::INVALID_ARGUMENT, + 401 => Code::UNAUTHENTICATED, + 403 => Code::PERMISSION_DENIED, + 404 => Code::NOT_FOUND, + 409 => Code::ABORTED, + 416 => Code::OUT_OF_RANGE, + 429 => Code::RESOURCE_EXHAUSTED, + 499 => Code::CANCELLED, + 501 => Code::UNIMPLEMENTED, + 503 => Code::UNAVAILABLE, + 504 => Code::DEADLINE_EXCEEDED, + ]; + + /** + * @param string $status + * @return bool + */ + public static function isValidStatus(string $status) + { + return array_key_exists($status, self::$apiStatusToCodeMap); + } + + /** + * @param int $code + * @return string + */ + public static function statusFromRpcCode(int $code) + { + if (array_key_exists($code, self::$codeToApiStatusMap)) { + return self::$codeToApiStatusMap[$code]; + } + return ApiStatus::UNRECOGNIZED_STATUS; + } + + /** + * @param string $status + * @return int + */ + public static function rpcCodeFromStatus(string $status) + { + if (array_key_exists($status, self::$apiStatusToCodeMap)) { + return self::$apiStatusToCodeMap[$status]; + } + return ApiStatus::UNRECOGNIZED_CODE; + } + + /** + * Maps HTTP status codes to Google\Rpc\Code codes. + * Some codes are left out because they map to multiple gRPC codes (e.g. 500). + * + * @param int $httpStatusCode + * @return int + */ + public static function rpcCodeFromHttpStatusCode(int $httpStatusCode) + { + if (array_key_exists($httpStatusCode, self::$httpStatusCodeToRpcCodeMap)) { + return self::$httpStatusCodeToRpcCodeMap[$httpStatusCode]; + } + // All 2xx + if ($httpStatusCode >= 200 && $httpStatusCode < 300) { + return Code::OK; + } + // All 4xx + if ($httpStatusCode >= 400 && $httpStatusCode < 500) { + return Code::FAILED_PRECONDITION; + } + // All 5xx + if ($httpStatusCode >= 500 && $httpStatusCode < 600) { + return Code::INTERNAL; + } + // Everything else (We cannot change this to Code::UNKNOWN because it would break BC) + return ApiStatus::UNRECOGNIZED_CODE; + } +} diff --git a/vendor/google/gax/src/ArrayTrait.php b/vendor/google/gax/src/ArrayTrait.php new file mode 100644 index 0000000..02638be --- /dev/null +++ b/vendor/google/gax/src/ArrayTrait.php @@ -0,0 +1,156 @@ +pluck($key, $arr, false); + } + } + + return $values; + } + + /** + * Determine whether given array is associative. + * + * @param array $arr + * @return bool + */ + private function isAssoc(array $arr) + { + return array_keys($arr) !== range(0, count($arr) - 1); + } + + /** + * Just like array_filter(), but preserves falsey values except null. + * + * @param array $arr + * @return array + */ + private function arrayFilterRemoveNull(array $arr) + { + return array_filter($arr, function ($element) { + if (!is_null($element)) { + return true; + } + + return false; + }); + } + + /** + * Return a subset of an array, like pluckArray, without modifying the original array. + * + * @param array $keys + * @param array $arr + * @return array + */ + private function subsetArray(array $keys, array $arr) + { + return array_intersect_key( + $arr, + array_flip($keys) + ); + } + + /** + * A method, similar to PHP's `array_merge_recursive`, with two differences. + * + * 1. Keys in $array2 take precedence over keys in $array1. + * 2. Non-array keys found in both inputs are not transformed into an array + * and appended. Rather, the value in $array2 is used. + * + * @param array $array1 + * @param array $array2 + * @return array + */ + private function arrayMergeRecursive(array $array1, array $array2) + { + foreach ($array2 as $key => $value) { + if (array_key_exists($key, $array1) && is_array($array1[$key]) && is_array($value)) { + $array1[$key] = ($this->isAssoc($array1[$key]) && $this->isAssoc($value)) + ? $this->arrayMergeRecursive($array1[$key], $value) + : array_merge($array1[$key], $value); + } else { + $array1[$key] = $value; + } + } + + return $array1; + } +} diff --git a/vendor/google/gax/src/BidiStream.php b/vendor/google/gax/src/BidiStream.php new file mode 100644 index 0000000..e4d6718 --- /dev/null +++ b/vendor/google/gax/src/BidiStream.php @@ -0,0 +1,217 @@ +call = $bidiStreamingCall; + if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) { + $this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod']; + } + $this->logger = $logger; + } + + /** + * Write request to the server. + * + * @param mixed $request The request to write + * @throws ValidationException + */ + public function write($request) + { + if ($this->isComplete) { + throw new ValidationException('Cannot call write() after streaming call is complete.'); + } + if ($this->writesClosed) { + throw new ValidationException('Cannot call write() after calling closeWrite().'); + } + + if ($this->logger && $request instanceof Message) { + $logEvent = new RpcLogEvent(); + + $logEvent->headers = null; + $logEvent->payload = $request->serializeToJsonString(); + $logEvent->processId = (int) getmypid(); + $logEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + $this->logRequest($logEvent); + } + + $this->call->write($request); + } + + /** + * Write all requests in $requests. + * + * @param iterable $requests An Iterable of request objects to write to the server + * + * @throws ValidationException + */ + public function writeAll($requests = []) + { + foreach ($requests as $request) { + $this->write($request); + } + } + + /** + * Inform the server that no more requests will be written. The write() function cannot be + * called after closeWrite() is called. + * @throws ValidationException + */ + public function closeWrite() + { + if ($this->isComplete) { + throw new ValidationException( + 'Cannot call closeWrite() after streaming call is complete.' + ); + } + if (!$this->writesClosed) { + $this->call->writesDone(); + $this->writesClosed = true; + } + } + + /** + * Read the next response from the server. Returns null if the streaming call completed + * successfully. Throws an ApiException if the streaming call failed. + * + * @throws ValidationException + * @throws ApiException + * @return mixed + */ + public function read() + { + if ($this->isComplete) { + throw new ValidationException('Cannot call read() after streaming call is complete.'); + } + $resourcesGetMethod = $this->resourcesGetMethod; + if (!is_null($resourcesGetMethod)) { + if (count($this->pendingResources) === 0) { + $response = $this->call->read(); + if (!is_null($response)) { + $pendingResources = []; + foreach ($response->$resourcesGetMethod() as $resource) { + $pendingResources[] = $resource; + } + $this->pendingResources = array_reverse($pendingResources); + } + } + $result = array_pop($this->pendingResources); + } else { + $result = $this->call->read(); + } + if (is_null($result)) { + $status = $this->call->getStatus(); + $this->isComplete = true; + if (!($status->code == Code::OK)) { + throw ApiException::createFromStdClass($status); + } + } + + if ($this->logger) { + $responseEvent = new RpcLogEvent(); + + $responseEvent->headers = $this->call->getMetadata(); + $responseEvent->status = $status->code ?? null; + $responseEvent->processId = (int) getmypid(); + $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + if ($result instanceof Message) { + $responseEvent->payload = $result->serializeToJsonString(); + } + + $this->logResponse($responseEvent); + } + + return $result; + } + + /** + * Call closeWrite(), and read all responses from the server, until the streaming call is + * completed. Throws an ApiException if the streaming call failed. + * + * @throws ValidationException + * @throws ApiException + * @return \Generator|mixed[] + */ + public function closeWriteAndReadAll() + { + $this->closeWrite(); + $response = $this->read(); + while (!is_null($response)) { + yield $response; + $response = $this->read(); + } + } + + /** + * Return the underlying gRPC call object + * + * @return \Grpc\BidiStreamingCall|mixed + */ + public function getBidiStreamingCall() + { + return $this->call; + } +} diff --git a/vendor/google/gax/src/Call.php b/vendor/google/gax/src/Call.php new file mode 100644 index 0000000..53c5d32 --- /dev/null +++ b/vendor/google/gax/src/Call.php @@ -0,0 +1,131 @@ +method = $method; + $this->decodeType = $decodeType; + $this->message = $message; + $this->descriptor = $descriptor; + $this->callType = $callType; + } + + /** + * @return string + */ + public function getMethod() + { + return $this->method; + } + + /** + * @return int + */ + public function getCallType() + { + return $this->callType; + } + + /** + * @return string + */ + public function getDecodeType() + { + return $this->decodeType; + } + + /** + * @return mixed|Message + */ + public function getMessage() + { + return $this->message; + } + + /** + * @return array|null + */ + public function getDescriptor() + { + return $this->descriptor; + } + + /** + * @param mixed|Message $message + * @return Call + */ + public function withMessage($message) + { + // @phpstan-ignore-next-line + return new static( + $this->method, + $this->decodeType, + $message, + $this->descriptor, + $this->callType + ); + } +} diff --git a/vendor/google/gax/src/ClientOptionsTrait.php b/vendor/google/gax/src/ClientOptionsTrait.php new file mode 100644 index 0000000..5def36e --- /dev/null +++ b/vendor/google/gax/src/ClientOptionsTrait.php @@ -0,0 +1,400 @@ +mergeFromJsonString(file_get_contents($confPath)); + $config = new Config($hostName, $apiConfig); + return $config; + } + + /** + * Get default options. This function should be "overridden" by clients using late static + * binding to provide default options to the client. + * + * @return array + * @access private + */ + private static function getClientDefaults() + { + return []; + } + + /** + * Resolve client options based on the client's default + * ({@see ClientOptionsTrait::getClientDefault}) and the default for all + * Google APIs. + * + * 1. Set default client option values + * 2. Set default logger (and log user-supplied configuration options) + * 3. Set default transport configuration + * 4. Call "modifyClientOptions" (for backwards compatibility) + * 5. Use "defaultScopes" when custom endpoint is supplied + * 6. Load mTLS from the environment if configured + * 7. Resolve endpoint based on universe domain template when possible + * 8. Load sysvshm grpc config when possible + */ + private function buildClientOptions(array|ClientOptions $options) + { + if ($options instanceof ClientOptions) { + $options = $options->toArray(); + } + + // Build $defaultOptions starting from top level + // variables, then going into deeper nesting, so that + // we will not encounter missing keys + $defaultOptions = self::getClientDefaults(); + $defaultOptions += [ + 'disableRetries' => false, + 'credentials' => null, + 'credentialsConfig' => [], + 'transport' => null, + 'transportConfig' => [], + 'gapicVersion' => self::getGapicVersion($options), + 'libName' => null, + 'libVersion' => null, + 'apiEndpoint' => null, + 'clientCertSource' => null, + 'universeDomain' => null, + 'logger' => null, + ]; + + $supportedTransports = $this->supportedTransports(); + foreach ($supportedTransports as $transportName) { + if (!array_key_exists($transportName, $defaultOptions['transportConfig'])) { + $defaultOptions['transportConfig'][$transportName] = []; + } + } + if (in_array('grpc', $supportedTransports)) { + $defaultOptions['transportConfig']['grpc'] = [ + 'stubOpts' => ['grpc.service_config_disable_resolution' => 1] + ]; + } + + // Keep track of the API Endpoint + $apiEndpoint = $options['apiEndpoint'] ?? null; + + // Keep track of the original user supplied options for logging the configuration + $clientSuppliedOptions = $options; + + // Merge defaults into $options starting from top level + // variables, then going into deeper nesting, so that + // we will not encounter missing keys + $options += $defaultOptions; + + // If logger is explicitly set to false, logging is disabled + if (is_null($options['logger'])) { + $options['logger'] = ApplicationDefaultCredentials::getDefaultLogger(); + } + + if ( + $options['logger'] !== null + && $options['logger'] !== false + && !$options['logger'] instanceof LoggerInterface + ) { + throw new ValidationException( + 'The "logger" option in the options array should be PSR-3 LoggerInterface compatible' + ); + } + + // Log the user supplied configuration. + $this->logConfiguration($options['logger'], $clientSuppliedOptions); + + if (isset($options['logger'])) { + $options['credentialsConfig']['authHttpHandler'] = HttpHandlerFactory::build( + logger: $options['logger'] + ); + } + + $options['credentialsConfig'] += $defaultOptions['credentialsConfig']; + $options['transportConfig'] += $defaultOptions['transportConfig']; // @phpstan-ignore-line + if (isset($options['transportConfig']['grpc'])) { + $options['transportConfig']['grpc'] += $defaultOptions['transportConfig']['grpc']; + $options['transportConfig']['grpc']['stubOpts'] += $defaultOptions['transportConfig']['grpc']['stubOpts']; + $options['transportConfig']['grpc']['logger'] = $options['logger'] ?? null; + } + if (isset($options['transportConfig']['rest'])) { + $options['transportConfig']['rest'] += $defaultOptions['transportConfig']['rest']; + $options['transportConfig']['rest']['logger'] = $options['logger'] ?? null; + } + if (isset($options['transportConfig']['grpc-fallback'])) { + $options['transportConfig']['grpc-fallback']['logger'] = $options['logger'] ?? null; + } + + // These calls do not apply to "New Surface" clients. + if ($this->isBackwardsCompatibilityMode()) { + $preModifiedOptions = $options; + $this->modifyClientOptions($options); + // NOTE: this is required to ensure backwards compatiblity with $options['apiEndpoint'] + if ($options['apiEndpoint'] !== $preModifiedOptions['apiEndpoint']) { + $apiEndpoint = $options['apiEndpoint']; + } + + // serviceAddress is now deprecated and acts as an alias for apiEndpoint + if (isset($options['serviceAddress'])) { + $apiEndpoint = $this->pluck('serviceAddress', $options, false); + } + } else { + // Ads is using this method in their new surface clients, so we need to call it. + // However, this method is not used anywhere else for the new surface clients + // @TODO: Remove this in GAX V2 + $this->modifyClientOptions($options); + } + // If an API endpoint is different form the default, ensure the "audience" does not conflict + // with the custom endpoint by setting "user defined" scopes. + if ($apiEndpoint + && $apiEndpoint != $defaultOptions['apiEndpoint'] + && empty($options['credentialsConfig']['scopes']) + && !empty($options['credentialsConfig']['defaultScopes']) + ) { + $options['credentialsConfig']['scopes'] = $options['credentialsConfig']['defaultScopes']; + } + + // mTLS: detect and load the default clientCertSource if the environment variable + // "GOOGLE_API_USE_CLIENT_CERTIFICATE" is true, and the cert source is available + if (empty($options['clientCertSource']) && CredentialsLoader::shouldLoadClientCertSource()) { + if ($defaultCertSource = CredentialsLoader::getDefaultClientCertSource()) { + $options['clientCertSource'] = function () use ($defaultCertSource) { + $cert = call_user_func($defaultCertSource); + + // the key and the cert are returned in one string + return [$cert, $cert]; + }; + } + } + + // mTLS: If no apiEndpoint has been supplied by the user, and either + // GOOGLE_API_USE_MTLS_ENDPOINT tells us to, or mTLS is available, use the mTLS endpoint. + if (is_null($apiEndpoint) && $this->shouldUseMtlsEndpoint($options)) { + $apiEndpoint = self::determineMtlsEndpoint($options['apiEndpoint']); + } + + // If the user has not supplied a universe domain, use the environment variable if set. + // Otherwise, use the default ("googleapis.com"). + $options['universeDomain'] ??= getenv('GOOGLE_CLOUD_UNIVERSE_DOMAIN') + ?: GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN; + + // mTLS: It is not valid to configure mTLS outside of "googleapis.com" (yet) + if (isset($options['clientCertSource']) + && $options['universeDomain'] !== GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN + ) { + throw new ValidationException( + 'mTLS is not supported outside the "googleapis.com" universe' + ); + } + + if (is_null($apiEndpoint)) { + if (defined('self::SERVICE_ADDRESS_TEMPLATE')) { + // Derive the endpoint from the service address template and the universe domain + $apiEndpoint = str_replace( + 'UNIVERSE_DOMAIN', + $options['universeDomain'], + self::SERVICE_ADDRESS_TEMPLATE + ); + } else { + // For older clients, the service address template does not exist. Use the default + // endpoint instead. + $apiEndpoint = $defaultOptions['apiEndpoint']; + } + } + + if (extension_loaded('sysvshm') + && isset($options['gcpApiConfigPath']) + && file_exists($options['gcpApiConfigPath']) + && !empty($apiEndpoint) + ) { + $grpcGcpConfig = self::initGrpcGcpConfig( + $apiEndpoint, + $options['gcpApiConfigPath'] + ); + + if (!array_key_exists('stubOpts', $options['transportConfig']['grpc'])) { + $options['transportConfig']['grpc']['stubOpts'] = []; + } + + $options['transportConfig']['grpc']['stubOpts'] += [ + 'grpc_call_invoker' => $grpcGcpConfig->callInvoker() + ]; + } + + $options['apiEndpoint'] = $apiEndpoint; + + return $options; + } + + private function shouldUseMtlsEndpoint(array $options) + { + $mtlsEndpointEnvVar = getenv('GOOGLE_API_USE_MTLS_ENDPOINT'); + if ('always' === $mtlsEndpointEnvVar) { + return true; + } + if ('never' === $mtlsEndpointEnvVar) { + return false; + } + // For all other cases, assume "auto" and return true if clientCertSource exists + return !empty($options['clientCertSource']); + } + + private static function determineMtlsEndpoint(string $apiEndpoint) + { + $parts = explode('.', $apiEndpoint); + if (count($parts) < 3) { + return $apiEndpoint; // invalid endpoint! + } + return sprintf('%s.mtls.%s', array_shift($parts), implode('.', $parts)); + } + + /** + * @param mixed $credentials + * @param array $credentialsConfig + * @return CredentialsWrapper + * @throws ValidationException + */ + private function createCredentialsWrapper($credentials, array $credentialsConfig, string $universeDomain) + { + if (is_null($credentials)) { + // If the user has explicitly set the apiKey option, use Api Key credentials + return CredentialsWrapper::build($credentialsConfig, $universeDomain); + } + + if (is_string($credentials) || is_array($credentials)) { + return CredentialsWrapper::build(['keyFile' => $credentials] + $credentialsConfig, $universeDomain); + } + + if ($credentials instanceof FetchAuthTokenInterface) { + $authHttpHandler = $credentialsConfig['authHttpHandler'] ?? null; + return new CredentialsWrapper($credentials, $authHttpHandler, $universeDomain); + } + + if ($credentials instanceof CredentialsWrapper) { + return $credentials; + } + + throw new ValidationException(sprintf( + 'Unexpected value in $auth option, got: %s', + print_r($credentials, true) + )); + } + + /** + * This defaults to all three transports, which One-Platform supports. + * Discovery clients should define this function and only return ['rest']. + */ + private static function supportedTransports() + { + return ['grpc', 'grpc-fallback', 'rest']; + } + + // Gapic Client Extension Points + // The methods below provide extension points that can be used to customize client + // functionality. These extension points are currently considered + // private and may change at any time. + + /** + * Modify options passed to the client before calling setClientOptions. + * + * @param array $options + * @access private + * @internal + */ + protected function modifyClientOptions(array &$options) + { + // Do nothing - this method exists to allow option modification by partial veneers. + } + + /** + * @internal + */ + private function isBackwardsCompatibilityMode(): bool + { + return false; + } + + /** + * @param null|false|LoggerInterface $logger + * @param string $options + */ + private function logConfiguration(null|false|LoggerInterface $logger, array $options): void + { + if (!$logger) { + return; + } + + $configurationLog = [ + 'timestamp' => date(DATE_RFC3339), + 'severity' => strtoupper(LogLevel::DEBUG), + 'processId' => getmypid(), + 'jsonPayload' => [ + 'serviceName' => self::SERVICE_NAME, // @phpstan-ignore-line + 'clientConfiguration' => $options, + ] + ]; + + $logger->debug(json_encode($configurationLog)); + } +} diff --git a/vendor/google/gax/src/ClientStream.php b/vendor/google/gax/src/ClientStream.php new file mode 100644 index 0000000..6c24955 --- /dev/null +++ b/vendor/google/gax/src/ClientStream.php @@ -0,0 +1,143 @@ +call = $clientStreamingCall; + $this->logger = $logger; + } + + /** + * Write request to the server. + * + * @param mixed $request The request to write + */ + public function write($request) + { + // In some cases, $request can be a string + if ($this->logger && $request instanceof Message) { + $requestEvent = new RpcLogEvent(); + + $requestEvent->payload = $request->serializeToJsonString(); + $requestEvent->processId = (int) getmypid(); + $requestEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + $this->logRequest($requestEvent); + } + + $this->call->write($request); + } + + /** + * Read the response from the server, completing the streaming call. + * + * @throws ApiException + * @return mixed The response object from the server + */ + public function readResponse() + { + list($response, $status) = $this->call->wait(); + if ($status->code == Code::OK) { + if ($this->logger) { + $responseEvent = new RpcLogEvent(); + + $responseEvent->headers = $status->metadata; + $responseEvent->status = $status->code; + $responseEvent->processId = (int) getmypid(); + $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + if ($response instanceof Message) { + $response->serializeToJsonString(); + } + + $this->logResponse($responseEvent); + } + + return $response; + } else { + throw ApiException::createFromStdClass($status); + } + } + + /** + * Write all data in $dataArray and read the response from the server, completing the streaming + * call. + * + * @param mixed[] $requests An iterator of request objects to write to the server + * @return mixed The response object from the server + */ + public function writeAllAndReadResponse(array $requests) + { + foreach ($requests as $request) { + $this->write($request); + } + return $this->readResponse(); + } + + /** + * Return the underlying gRPC call object + * + * @return \Grpc\ClientStreamingCall|mixed + */ + public function getClientStreamingCall() + { + return $this->call; + } +} diff --git a/vendor/google/gax/src/CredentialsWrapper.php b/vendor/google/gax/src/CredentialsWrapper.php new file mode 100644 index 0000000..d6e9089 --- /dev/null +++ b/vendor/google/gax/src/CredentialsWrapper.php @@ -0,0 +1,359 @@ +credentialsFetcher = $credentialsFetcher; + $this->authHttpHandler = $authHttpHandler; + if (empty($universeDomain)) { + throw new ValidationException('The universe domain cannot be empty'); + } + $this->universeDomain = $universeDomain; + } + + /** + * Factory method to create a CredentialsWrapper from an array of options. + * + * @param array $args { + * An array of optional arguments. + * + * @type string|array $keyFile + * Credentials to be used. Accepts either a path to a credentials file, or a decoded + * credentials file as a PHP array. If this is not specified, application default + * credentials will be used. + * @type string[] $scopes + * A string array of scopes to use when acquiring credentials. + * @type callable $authHttpHandler + * A handler used to deliver PSR-7 requests specifically + * for authentication. Should match a signature of + * `function (RequestInterface $request, array $options) : ResponseInterface`. + * @type bool $enableCaching + * Enable caching of access tokens. Defaults to true. + * @type CacheItemPoolInterface $authCache + * A cache for storing access tokens. Defaults to a simple in memory implementation. + * @type array $authCacheOptions + * Cache configuration options. + * @type string $quotaProject + * Specifies a user project to bill for access charges associated with the request. + * @type string[] $defaultScopes + * A string array of default scopes to use when acquiring + * credentials. + * @type bool $useJwtAccessWithScope + * Ensures service account credentials use JWT Access (also known as self-signed + * JWTs), even when user-defined scopes are supplied. + * } + * @param string $universeDomain The expected universe of the credentials. Defaults to + * "googleapis.com" + * @return CredentialsWrapper + * @throws ValidationException + */ + public static function build( + array $args = [], + string $universeDomain = GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN + ) { + $args += [ + 'keyFile' => null, + 'scopes' => null, + 'authHttpHandler' => null, + 'enableCaching' => true, + 'authCache' => null, + 'authCacheOptions' => [], + 'quotaProject' => null, + 'defaultScopes' => null, + 'useJwtAccessWithScope' => true, + ]; + + $keyFile = $args['keyFile']; + + if (is_null($keyFile)) { + $loader = self::buildApplicationDefaultCredentials( + $args['scopes'], + $args['authHttpHandler'], + $args['authCacheOptions'], + $args['authCache'], + $args['quotaProject'], + $args['defaultScopes'] + ); + if ($loader instanceof FetchAuthTokenCache) { + $loader = $loader->getFetcher(); + } + } else { + if (is_string($keyFile)) { + if (!file_exists($keyFile)) { + throw new ValidationException("Could not find keyfile: $keyFile"); + } + $keyFile = json_decode(file_get_contents($keyFile), true); + } + + if (isset($args['quotaProject'])) { + $keyFile['quota_project_id'] = $args['quotaProject']; + } + + $loader = CredentialsLoader::makeCredentials( + $args['scopes'], + $keyFile, + $args['defaultScopes'] + ); + } + + if ($loader instanceof ServiceAccountCredentials && $args['useJwtAccessWithScope']) { + // Ensures the ServiceAccountCredentials uses JWT Access, also known + // as self-signed JWTs, even when user-defined scopes are supplied. + $loader->useJwtAccessWithScope(); + } + + if ($args['enableCaching']) { + $authCache = $args['authCache'] ?: new MemoryCacheItemPool(); + $loader = new FetchAuthTokenCache( + $loader, + $args['authCacheOptions'], + $authCache + ); + } + + return new CredentialsWrapper($loader, $args['authHttpHandler'], $universeDomain); + } + + /** + * @return string|null The quota project associated with the credentials. + */ + public function getQuotaProject(): ?string + { + if ($this->credentialsFetcher instanceof GetQuotaProjectInterface) { + return $this->credentialsFetcher->getQuotaProject(); + } + return null; + } + + public function getProjectId(?callable $httpHandler = null): ?string + { + // Ensure that FetchAuthTokenCache does not throw an exception + if ($this->credentialsFetcher instanceof FetchAuthTokenCache + && !$this->credentialsFetcher->getFetcher() instanceof ProjectIdProviderInterface) { + return null; + } + + if ($this->credentialsFetcher instanceof ProjectIdProviderInterface) { + return $this->credentialsFetcher->getProjectId($httpHandler); + } + return null; + } + + /** + * @deprecated + * @return string Bearer string containing access token. + */ + public function getBearerString() + { + $token = $this->credentialsFetcher->getLastReceivedToken(); + if (self::isExpired($token)) { + $this->checkUniverseDomain(); + + $token = $this->credentialsFetcher->fetchAuthToken($this->authHttpHandler); + if (!self::isValid($token)) { + return ''; + } + } + return empty($token['access_token']) ? '' : 'Bearer ' . $token['access_token']; + } + + /** + * @param string $audience optional audience for self-signed JWTs. + * @return callable Callable function that returns an authorization header. + */ + public function getAuthorizationHeaderCallback($audience = null): ?callable + { + // NOTE: changes to this function should be treated carefully and tested thoroughly. It will + // be passed into the gRPC c extension, and changes have the potential to trigger very + // difficult-to-diagnose segmentation faults. + return function () use ($audience) { + $token = $this->credentialsFetcher->getLastReceivedToken(); + if (self::isExpired($token)) { + $this->checkUniverseDomain(); + + // Call updateMetadata to take advantage of self-signed JWTs + if ($this->credentialsFetcher instanceof UpdateMetadataInterface) { + return $this->credentialsFetcher->updateMetadata([], $audience, $this->authHttpHandler); + } + + // In case a custom fetcher is provided (unlikely) which doesn't + // implement UpdateMetadataInterface + $token = $this->credentialsFetcher->fetchAuthToken($this->authHttpHandler); + if (!self::isValid($token)) { + return []; + } + } + $tokenString = $token['access_token']; + if (!empty($tokenString)) { + return ['authorization' => ["Bearer $tokenString"]]; + } + return []; + }; + } + + /** + * Verify that the expected universe domain matches the universe domain from the credentials. + * + * @throws ValidationException if the universe domain does not match. + */ + public function checkUniverseDomain(): void + { + if (false === $this->hasCheckedUniverse && $this->shouldCheckUniverseDomain()) { + $credentialsUniverse = $this->credentialsFetcher instanceof GetUniverseDomainInterface + ? $this->credentialsFetcher->getUniverseDomain() + : GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN; + if ($credentialsUniverse !== $this->universeDomain) { + throw new ValidationException(sprintf( + 'The configured universe domain (%s) does not match the credential universe domain (%s)', + $this->universeDomain, + $credentialsUniverse + )); + } + $this->hasCheckedUniverse = true; + } + } + + /** + * Skip universe domain check for Metadata server (e.g. GCE) credentials. + * + * @return bool + */ + private function shouldCheckUniverseDomain(): bool + { + $fetcher = $this->credentialsFetcher instanceof FetchAuthTokenCache + ? $this->credentialsFetcher->getFetcher() + : $this->credentialsFetcher; + + if ($fetcher instanceof GCECredentials) { + return false; + } + + return true; + } + + /** + * @param array $scopes + * @param callable $authHttpHandler + * @param array $authCacheOptions + * @param CacheItemPoolInterface $authCache + * @param string $quotaProject + * @param array $defaultScopes + * @return FetchAuthTokenInterface + * @throws ValidationException + */ + private static function buildApplicationDefaultCredentials( + ?array $scopes = null, + ?callable $authHttpHandler = null, + ?array $authCacheOptions = null, + ?CacheItemPoolInterface $authCache = null, + $quotaProject = null, + ?array $defaultScopes = null + ) { + try { + return ApplicationDefaultCredentials::getCredentials( + $scopes, + $authHttpHandler, + $authCacheOptions, + $authCache, + $quotaProject, + $defaultScopes + ); + } catch (DomainException $ex) { + throw new ValidationException('Could not construct ApplicationDefaultCredentials', $ex->getCode(), $ex); + } + } + + /** + * @param mixed $token + */ + private static function isValid($token) + { + return is_array($token) + && array_key_exists('access_token', $token); + } + + /** + * @param mixed $token + */ + private static function isExpired($token) + { + return !(self::isValid($token) + && array_key_exists('expires_at', $token) + && $token['expires_at'] > time() + self::$eagerRefreshThresholdSeconds); + } +} diff --git a/vendor/google/gax/src/FixedSizeCollection.php b/vendor/google/gax/src/FixedSizeCollection.php new file mode 100644 index 0000000..03ec835 --- /dev/null +++ b/vendor/google/gax/src/FixedSizeCollection.php @@ -0,0 +1,190 @@ + 0. collectionSize: $collectionSize" + ); + } + if ($collectionSize < $initialPage->getPageElementCount()) { + $ipc = $initialPage->getPageElementCount(); + throw new InvalidArgumentException( + 'collectionSize must be greater than or equal to the number of ' . + "elements in initialPage. collectionSize: $collectionSize, " . + "initialPage size: $ipc" + ); + } + $this->collectionSize = $collectionSize; + + $this->pageList = FixedSizeCollection::createPageArray($initialPage, $collectionSize); + } + + /** + * Returns the number of elements in the collection. This will be + * equal to the collectionSize parameter used at construction + * unless there are no elements remaining to be retrieved. + * + * @return int + */ + public function getCollectionSize() + { + $size = 0; + foreach ($this->pageList as $page) { + $size += $page->getPageElementCount(); + } + return $size; + } + + /** + * Returns true if there are more elements that can be retrieved + * from the API. + * + * @return bool + */ + public function hasNextCollection() + { + return $this->getLastPage()->hasNextPage(); + } + + /** + * Returns a page token that can be passed into the API list + * method to retrieve additional elements. + * + * @return string + */ + public function getNextPageToken() + { + return $this->getLastPage()->getNextPageToken(); + } + + /** + * Retrieves the next FixedSizeCollection using one or more API calls. + * + * @return FixedSizeCollection + */ + public function getNextCollection() + { + $lastPage = $this->getLastPage(); + $nextPage = $lastPage->getNextPage($this->collectionSize); + return new FixedSizeCollection($nextPage, $this->collectionSize); + } + + /** + * Returns an iterator over the elements of the collection. + * + * @return Generator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + foreach ($this->pageList as $page) { + foreach ($page as $element) { + yield $element; + } + } + } + + /** + * Returns an iterator over FixedSizeCollections, starting with this + * and making API calls as required until all of the elements have + * been retrieved. + * + * @return Generator|FixedSizeCollection[] + */ + public function iterateCollections() + { + $currentCollection = $this; + yield $this; + while ($currentCollection->hasNextCollection()) { + $currentCollection = $currentCollection->getNextCollection(); + yield $currentCollection; + } + } + + private function getLastPage() + { + $pageList = $this->pageList; + // Get last element in array... + $lastPage = end($pageList); + reset($pageList); + return $lastPage; + } + + /** + * @param Page $initialPage + * @param int $collectionSize + * @return Page[] + */ + private static function createPageArray(Page $initialPage, int $collectionSize) + { + $pageList = [$initialPage]; + $currentPage = $initialPage; + $itemCount = $currentPage->getPageElementCount(); + while ($itemCount < $collectionSize && $currentPage->hasNextPage()) { + $remainingCount = $collectionSize - $itemCount; + $currentPage = $currentPage->getNextPage($remainingCount); + $rxElementCount = $currentPage->getPageElementCount(); + if ($rxElementCount > $remainingCount) { + throw new LengthException('API returned a number of elements ' . + 'exceeding the specified page size limit. page size: ' . + "$remainingCount, elements received: $rxElementCount"); + } + array_push($pageList, $currentPage); + $itemCount += $rxElementCount; + } + return $pageList; + } +} diff --git a/vendor/google/gax/src/GPBLabel.php b/vendor/google/gax/src/GPBLabel.php new file mode 100644 index 0000000..18208cd --- /dev/null +++ b/vendor/google/gax/src/GPBLabel.php @@ -0,0 +1,43 @@ + $middlewareCallables */ + private array $middlewareCallables = []; + private array $transportCallMethods = [ + Call::UNARY_CALL => 'startUnaryCall', + Call::BIDI_STREAMING_CALL => 'startBidiStreamingCall', + Call::CLIENT_STREAMING_CALL => 'startClientStreamingCall', + Call::SERVER_STREAMING_CALL => 'startServerStreamingCall', + ]; + private bool $backwardsCompatibilityMode; + + /** + * Add a middleware to the call stack by providing a callable which will be + * invoked at the start of each call, and will return an instance of + * {@see MiddlewareInterface} when invoked. + * + * The callable must have the following method signature: + * + * callable(MiddlewareInterface): MiddlewareInterface + * + * An implementation may look something like this: + * ``` + * $client->addMiddleware(function (MiddlewareInterface $handler) { + * return new class ($handler) implements MiddlewareInterface { + * public function __construct(private MiddlewareInterface $handler) { + * } + * + * public function __invoke(Call $call, array $options) { + * // modify call and options (pre-request) + * $response = ($this->handler)($call, $options); + * // modify the response (post-request) + * return $response; + * } + * }; + * }); + * ``` + * + * @param callable $middlewareCallable A callable which returns an instance + * of {@see MiddlewareInterface} when invoked with a + * MiddlewareInterface instance as its first argument. + * @return void + */ + public function addMiddleware(callable $middlewareCallable): void + { + $this->middlewareCallables[] = $middlewareCallable; + } + + /** + * Initiates an orderly shutdown in which preexisting calls continue but new + * calls are immediately cancelled. + * + * @experimental + */ + public function close() + { + $this->transport->close(); + } + + /** + * Get the transport for the client. This method is protected to support + * use by customized clients. + * + * @access private + * @return TransportInterface + */ + protected function getTransport() + { + return $this->transport; + } + + /** + * Get the credentials for the client. This method is protected to support + * use by customized clients. + * + * @access private + * @return CredentialsWrapper + */ + protected function getCredentialsWrapper() + { + return $this->credentialsWrapper; + } + + /** + * Configures the GAPIC client based on an array of options. + * + * @param array $options { + * An array of required and optional arguments. + * + * @type string $apiEndpoint + * The address of the API remote host, for example "example.googleapis.com. May also + * include the port, for example "example.googleapis.com:443" + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either a + * path to a JSON file, or a PHP array containing the decoded JSON data. + * By default this settings points to the default client config file, which is provided + * in the resources folder. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * \Google\Auth\FetchAuthTokenInterface object or \Google\ApiCore\CredentialsWrapper + * object. Note that when one of these objects are provided, any settings in + * $authConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the client. + * For a full list of supporting configuration options, see + * \Google\ApiCore\CredentialsWrapper::build. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string `rest`, + * `grpc`, or 'grpc-fallback'. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already instantiated + * TransportInterface object. Note that when this objects is provided, any settings in + * $transportConfig, and any `$apiEndpoint` setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * 'grpc-fallback' => [...], + * ]; + * See the GrpcTransport::build and RestTransport::build + * methods for the supported options. + * @type string $versionFile + * The path to a file which contains the current version of the client. + * @type string $descriptorsConfigPath + * The path to a descriptor configuration file. + * @type string $serviceName + * The name of the service. + * @type string $libName + * The name of the client application. + * @type string $libVersion + * The version of the client application. + * @type string $gapicVersion + * The code generator version of the GAPIC library. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. + * } + * @throws ValidationException + */ + private function setClientOptions(array $options) + { + // serviceAddress is now deprecated and acts as an alias for apiEndpoint + if (isset($options['serviceAddress'])) { + $options['apiEndpoint'] = $this->pluck('serviceAddress', $options, false); + } + $this->validateNotNull($options, [ + 'apiEndpoint', + 'serviceName', + 'descriptorsConfigPath', + 'clientConfig', + 'disableRetries', + 'credentialsConfig', + 'transportConfig', + ]); + $this->traitValidate($options, [ + 'credentials', + 'transport', + 'gapicVersion', + 'libName', + 'libVersion', + ]); + + // "hasEmulator" is not a supported Client Option, but is used + // internally to determine if the client is running in emulator mode. + // Therefore, we need to remove it from the $options array before + // creating the ClientOptions. + $hasEmulator = $this->pluck('hasEmulator', $options, false) ?? false; + if ($this->isBackwardsCompatibilityMode()) { + if (is_string($options['clientConfig'])) { + // perform validation for V1 surfaces which is done in the + // ClientOptions class for v2 surfaces. + $options['clientConfig'] = json_decode( + file_get_contents($options['clientConfig']), + true + ); + self::validateFileExists($options['descriptorsConfigPath']); + } + } else { + // cast to ClientOptions for new surfaces only + $options = new ClientOptions($options); + } + $this->serviceName = $options['serviceName']; + $this->retrySettings = RetrySettings::load( + $this->serviceName, + $options['clientConfig'], + $options['disableRetries'] + ); + + $headerInfo = [ + 'libName' => $options['libName'], + 'libVersion' => $options['libVersion'], + 'gapicVersion' => $options['gapicVersion'], + ]; + // Edge case: If the client has the gRPC extension installed, but is + // a REST-only library, then the grpcVersion header should not be set. + if ($this->transport instanceof GrpcTransport) { + $headerInfo['grpcVersion'] = phpversion('grpc'); + } elseif ($this->transport instanceof RestTransport + || $this->transport instanceof GrpcFallbackTransport) { + $headerInfo['restVersion'] = Version::getApiCoreVersion(); + } + $this->agentHeader = AgentHeader::buildAgentHeader($headerInfo); + + // Set "client_library_name" depending on client library surface being used + $userAgentHeader = sprintf( + 'gcloud-php-%s/%s', + $this->isBackwardsCompatibilityMode() ? 'legacy' : 'new', + $options['gapicVersion'] + ); + $this->agentHeader['User-Agent'] = [$userAgentHeader]; + + self::validateFileExists($options['descriptorsConfigPath']); + + $descriptors = require($options['descriptorsConfigPath']); + $this->descriptors = $descriptors['interfaces'][$this->serviceName]; + + if (isset($options['apiKey'], $options['credentials'])) { + throw new ValidationException( + 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.' + ); + } + // Set the credentialsWrapper + if (isset($options['apiKey'])) { + $this->credentialsWrapper = new ApiKeyHeaderCredentials( + $options['apiKey'], + $options['credentialsConfig']['quotaProject'] ?? null + ); + } else { + $this->credentialsWrapper = $this->createCredentialsWrapper( + $options['credentials'], + $options['credentialsConfig'], + $options['universeDomain'] + ); + } + + $transport = $options['transport'] ?: self::defaultTransport(); + $this->transport = $transport instanceof TransportInterface + ? $transport + : $this->createTransport( + $options['apiEndpoint'], + $transport, + $options['transportConfig'], + $options['clientCertSource'], + $hasEmulator + ); + } + + /** + * @param string $apiEndpoint + * @param string $transport + * @param TransportOptions|array $transportConfig + * @param callable $clientCertSource + * @param bool $hasEmulator + * @return TransportInterface + * @throws ValidationException + */ + private function createTransport( + string $apiEndpoint, + $transport, + $transportConfig, + ?callable $clientCertSource = null, + bool $hasEmulator = false + ) { + if (!is_string($transport)) { + throw new ValidationException( + "'transport' must be a string, instead got:" . + print_r($transport, true) + ); + } + $supportedTransports = self::supportedTransports(); + if (!in_array($transport, $supportedTransports)) { + throw new ValidationException(sprintf( + 'Unexpected transport option "%s". Supported transports: %s', + $transport, + implode(', ', $supportedTransports) + )); + } + $configForSpecifiedTransport = $transportConfig[$transport] ?? []; + if (is_array($configForSpecifiedTransport)) { + $configForSpecifiedTransport['clientCertSource'] = $clientCertSource; + } else { + $configForSpecifiedTransport->setClientCertSource($clientCertSource); + $configForSpecifiedTransport = $configForSpecifiedTransport->toArray(); + } + switch ($transport) { + case 'grpc': + // Setting the user agent for gRPC requires special handling + if (isset($this->agentHeader['User-Agent'])) { + if ($configForSpecifiedTransport['stubOpts']['grpc.primary_user_agent'] ??= '') { + $configForSpecifiedTransport['stubOpts']['grpc.primary_user_agent'] .= ' '; + } + $configForSpecifiedTransport['stubOpts']['grpc.primary_user_agent'] .= + $this->agentHeader['User-Agent'][0]; + } + return GrpcTransport::build($apiEndpoint, $configForSpecifiedTransport); + case 'grpc-fallback': + return GrpcFallbackTransport::build($apiEndpoint, $configForSpecifiedTransport); + case 'rest': + if (!isset($configForSpecifiedTransport['restClientConfigPath'])) { + throw new ValidationException( + "The 'restClientConfigPath' config is required for 'rest' transport." + ); + } + $restConfigPath = $configForSpecifiedTransport['restClientConfigPath']; + $configForSpecifiedTransport['hasEmulator'] = $hasEmulator; + + return RestTransport::build($apiEndpoint, $restConfigPath, $configForSpecifiedTransport); + default: + throw new ValidationException( + "Unexpected 'transport' option: $transport. " . + "Supported values: ['grpc', 'rest', 'grpc-fallback']" + ); + } + } + + /** + * @param array $options + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + $this->pluckArray([ + 'serviceName', + 'clientConfig', + 'descriptorsConfigPath', + ], $options); + + // User-supplied operations client + if ($operationsClient = $this->pluck('operationsClient', $options, false)) { + return $operationsClient; + } + + // operationsClientClass option + $operationsClientClass = $this->pluck('operationsClientClass', $options, false) + ?: OperationsCLient::class; + return new $operationsClientClass($options); + } + + /** + * @return string + */ + private static function defaultTransport() + { + return self::getGrpcDependencyStatus() + ? 'grpc' + : 'rest'; + } + + private function validateCallConfig(string $methodName) + { + // Ensure a method descriptor exists for the target method. + if (!isset($this->descriptors[$methodName])) { + throw new ValidationException("Requested method '$methodName' does not exist in descriptor configuration."); + } + $methodDescriptors = $this->descriptors[$methodName]; + + // Ensure required descriptor configuration exists. + if (!isset($methodDescriptors['callType'])) { + throw new ValidationException("Requested method '$methodName' does not have a callType " . + 'in descriptor configuration.'); + } + $callType = $methodDescriptors['callType']; + + // Validate various callType specific configurations. + if ($callType == Call::LONGRUNNING_CALL) { + if (!isset($methodDescriptors['longRunning'])) { + throw new ValidationException("Requested method '$methodName' does not have a longRunning config " . + 'in descriptor configuration.'); + } + // @TODO: check if the client implements `OperationsClientInterface` instead + if (!method_exists($this, 'getOperationsClient')) { + throw new ValidationException('Client missing required getOperationsClient ' . + "for longrunning call '$methodName'"); + } + } elseif ($callType == Call::PAGINATED_CALL) { + if (!isset($methodDescriptors['pageStreaming'])) { + throw new ValidationException("Requested method '$methodName' with callType PAGINATED_CALL does not " . + 'have a pageStreaming in descriptor configuration.'); + } + } + + // LRO are either Standard LRO response type or custom, which are handled by + // startOperationCall, so no need to validate responseType for those callType. + if ($callType != Call::LONGRUNNING_CALL) { + if (!isset($methodDescriptors['responseType'])) { + throw new ValidationException("Requested method '$methodName' does not have a responseType " . + 'in descriptor configuration.'); + } + } + + return $methodDescriptors; + } + + /** + * @param string $methodName + * @param Message $request + * @param array $optionalArgs { + * Call Options + * + * @type array $headers [optional] key-value array containing headers + * @type int $timeoutMillis [optional] the timeout in milliseconds for the call + * @type array $transportOptions [optional] transport-specific call options + * @type RetrySettings|array $retrySettings [optional] A retry settings override for the call. + * } + * + * @experimental + * + * @return PromiseInterface + */ + private function startAsyncCall( + string $methodName, + Message $request, + array $optionalArgs = [] + ) { + // Convert method name to the UpperCamelCase of RPC names from lowerCamelCase of GAPIC method names + // in order to find the method in the descriptor config. + $methodName = ucfirst($methodName); + $methodDescriptors = $this->validateCallConfig($methodName); + + $callType = $methodDescriptors['callType']; + + switch ($callType) { + case Call::PAGINATED_CALL: + return $this->getPagedListResponseAsync( + $methodName, + $optionalArgs, + $methodDescriptors['responseType'], + $request, + $methodDescriptors['interfaceOverride'] ?? $this->serviceName + ); + case Call::SERVER_STREAMING_CALL: + case Call::CLIENT_STREAMING_CALL: + case Call::BIDI_STREAMING_CALL: + throw new ValidationException("Call type '$callType' of requested method " . + "'$methodName' is not supported for async execution."); + } + + return $this->startApiCall($methodName, $request, $optionalArgs); + } + + /** + * @param string $methodName + * @param Message $request + * @param array $optionalArgs { + * Call Options + * + * @type array $headers [optional] key-value array containing headers + * @type int $timeoutMillis [optional] the timeout in milliseconds for the call + * @type array $transportOptions [optional] transport-specific call options + * @type RetrySettings|array $retrySettings [optional] A retry settings + * override for the call. + * } + * + * @experimental + * + * @return PromiseInterface|PagedListResponse|BidiStream|ClientStream|ServerStream + */ + private function startApiCall( + string $methodName, + ?Message $request = null, + array $optionalArgs = [] + ) { + $methodDescriptors = $this->validateCallConfig($methodName); + $callType = $methodDescriptors['callType']; + + // Prepare request-based headers, merge with user-provided headers, + // which take precedence. + $headerParams = $methodDescriptors['headerParams'] ?? []; + $requestHeaders = $this->buildRequestParamsHeader($headerParams, $request); + $optionalArgs['headers'] = array_merge($requestHeaders, $optionalArgs['headers'] ?? []); + + // Default the interface name, if not set, to the client's protobuf service name. + $interfaceName = $methodDescriptors['interfaceOverride'] ?? $this->serviceName; + + // Handle call based on call type configured in the method descriptor config. + if ($callType == Call::LONGRUNNING_CALL) { + return $this->startOperationsCall( + $methodName, + $optionalArgs, + $request, + $this->getOperationsClient(), + $interfaceName, + // Custom operations will define their own operation response type, whereas standard + // LRO defaults to the same type. + $methodDescriptors['responseType'] ?? null + ); + } + + // Fully-qualified name of the response message PHP class. + $decodeType = $methodDescriptors['responseType']; + + if ($callType == Call::PAGINATED_CALL) { + return $this->getPagedListResponse($methodName, $optionalArgs, $decodeType, $request, $interfaceName); + } + + // Unary, and all Streaming types handled by startCall. + return $this->startCall($methodName, $decodeType, $optionalArgs, $request, $callType, $interfaceName); + } + + /** + * @param string $methodName + * @param string $decodeType + * @param array $optionalArgs { + * Call Options + * + * @type array $headers [optional] key-value array containing headers + * @type int $timeoutMillis [optional] the timeout in milliseconds for the call + * @type array $transportOptions [optional] transport-specific call options + * @type RetrySettings|array $retrySettings [optional] A retry settings + * override for the call. + * } + * @param Message $request + * @param int $callType + * @param string $interfaceName + * + * @return PromiseInterface|BidiStream|ClientStream|ServerStream + */ + private function startCall( + string $methodName, + string $decodeType, + array $optionalArgs = [], + ?Message $request = null, + int $callType = Call::UNARY_CALL, + ?string $interfaceName = null + ) { + $optionalArgs = $this->configureCallOptions($optionalArgs); + $callStack = $this->createCallStack( + $this->configureCallConstructionOptions($methodName, $optionalArgs) + ); + + $descriptor = $this->descriptors[$methodName]['grpcStreaming'] ?? null; + + $call = new Call( + $this->buildMethod($interfaceName, $methodName), + $decodeType, + $request, + $descriptor, + $callType + ); + switch ($callType) { + case Call::UNARY_CALL: + $this->modifyUnaryCallable($callStack); + break; + case Call::BIDI_STREAMING_CALL: + case Call::CLIENT_STREAMING_CALL: + case Call::SERVER_STREAMING_CALL: + $this->modifyStreamingCallable($callStack); + break; + } + + return $callStack($call, $optionalArgs + array_filter([ + 'audience' => self::getDefaultAudience() + ])); + } + + /** + * @param array $callConstructionOptions { + * Call Construction Options + * + * @type RetrySettings $retrySettings [optional] A retry settings override + * For the call. + * @type array $autoPopulationSettings Settings for + * auto population of particular request fields if unset. + * } + * + * @return callable + */ + private function createCallStack(array $callConstructionOptions) + { + $fixedHeaders = $this->agentHeader; + if ($quotaProject = $this->credentialsWrapper->getQuotaProject()) { + $fixedHeaders += [ + 'X-Goog-User-Project' => [$quotaProject] + ]; + } + + if (isset($this->apiVersion)) { + $fixedHeaders += [ + 'X-Goog-Api-Version' => [$this->apiVersion] + ]; + } + + $callStack = function (Call $call, array $options) { + $startCallMethod = $this->transportCallMethods[$call->getCallType()]; + return $this->transport->$startCallMethod($call, $options); + }; + $callStack = new CredentialsWrapperMiddleware($callStack, $this->credentialsWrapper); + $callStack = new FixedHeaderMiddleware($callStack, $fixedHeaders, true); + $callStack = new RetryMiddleware($callStack, $callConstructionOptions['retrySettings']); + $callStack = new RequestAutoPopulationMiddleware( + $callStack, + $callConstructionOptions['autoPopulationSettings'], + ); + $callStack = new OptionsFilterMiddleware($callStack, [ + 'headers', + 'timeoutMillis', + 'transportOptions', + 'metadataCallback', + 'audience', + 'metadataReturnType' + ]); + + foreach (\array_reverse($this->middlewareCallables) as $fn) { + /** @var MiddlewareInterface $callStack */ + $callStack = $fn($callStack); + } + + return $callStack; + } + + /** + * @param string $methodName + * @param array $optionalArgs { + * Optional arguments + * + * @type RetrySettings|array $retrySettings [optional] A retry settings + * override for the call. + * } + * + * @return array + */ + private function configureCallConstructionOptions(string $methodName, array $optionalArgs) + { + $retrySettings = $this->retrySettings[$methodName]; + $autoPopulatedFields = $this->descriptors[$methodName]['autoPopulatedFields'] ?? []; + // Allow for retry settings to be changed at call time + if (isset($optionalArgs['retrySettings'])) { + if ($optionalArgs['retrySettings'] instanceof RetrySettings) { + $retrySettings = $optionalArgs['retrySettings']; + } else { + $retrySettings = $retrySettings->with( + $optionalArgs['retrySettings'] + ); + } + } + return [ + 'retrySettings' => $retrySettings, + 'autoPopulationSettings' => $autoPopulatedFields, + ]; + } + + /** + * @return array + */ + private function configureCallOptions(array $optionalArgs): array + { + if ($this->isBackwardsCompatibilityMode()) { + return $optionalArgs; + } + // cast to CallOptions for new surfaces only + return (new CallOptions($optionalArgs))->toArray(); + } + + /** + * @param string $methodName + * @param array $optionalArgs { + * Call Options + * + * @type array $headers [optional] key-value array containing headers + * @type int $timeoutMillis [optional] the timeout in milliseconds for the call + * @type array $transportOptions [optional] transport-specific call options + * } + * @param Message $request + * @param OperationsClient|object $client + * @param string $interfaceName + * @param string $operationClass If provided, will be used instead of the default + * operation response class of {@see \Google\LongRunning\Operation}. + * + * @return PromiseInterface + */ + private function startOperationsCall( + string $methodName, + array $optionalArgs, + Message $request, + $client, + ?string $interfaceName = null, + ?string $operationClass = null + ) { + $optionalArgs = $this->configureCallOptions($optionalArgs); + $callStack = $this->createCallStack( + $this->configureCallConstructionOptions($methodName, $optionalArgs) + ); + $descriptor = $this->descriptors[$methodName]['longRunning']; + $metadataReturnType = null; + + // Call the methods supplied in "additionalArgumentMethods" on the request Message object + // to build the "additionalOperationArguments" option for the operation response. + if (isset($descriptor['additionalArgumentMethods'])) { + $additionalArgs = []; + foreach ($descriptor['additionalArgumentMethods'] as $additionalArgsMethodName) { + $additionalArgs[] = $request->$additionalArgsMethodName(); + } + $descriptor['additionalOperationArguments'] = $additionalArgs; + unset($descriptor['additionalArgumentMethods']); + } + + if (isset($descriptor['metadataReturnType'])) { + $metadataReturnType = $descriptor['metadataReturnType']; + } + + $callStack = new OperationsMiddleware($callStack, $client, $descriptor); + + $call = new Call( + $this->buildMethod($interfaceName, $methodName), + $operationClass ?: Operation::class, + $request, + [], + Call::UNARY_CALL + ); + + $this->modifyUnaryCallable($callStack); + return $callStack($call, $optionalArgs + array_filter([ + 'metadataReturnType' => $metadataReturnType, + 'audience' => self::getDefaultAudience() + ])); + } + + /** + * @param string $methodName + * @param array $optionalArgs + * @param string $decodeType + * @param Message $request + * @param string $interfaceName + * + * @return PagedListResponse + */ + private function getPagedListResponse( + string $methodName, + array $optionalArgs, + string $decodeType, + Message $request, + ?string $interfaceName = null + ) { + return $this->getPagedListResponseAsync( + $methodName, + $optionalArgs, + $decodeType, + $request, + $interfaceName + )->wait(); + } + + /** + * @param string $methodName + * @param array $optionalArgs + * @param string $decodeType + * @param Message $request + * @param string $interfaceName + * + * @return PromiseInterface + */ + private function getPagedListResponseAsync( + string $methodName, + array $optionalArgs, + string $decodeType, + Message $request, + ?string $interfaceName = null + ) { + $optionalArgs = $this->configureCallOptions($optionalArgs); + $callStack = $this->createCallStack( + $this->configureCallConstructionOptions($methodName, $optionalArgs) + ); + $descriptor = new PageStreamingDescriptor( + $this->descriptors[$methodName]['pageStreaming'] + ); + $callStack = new PagedMiddleware($callStack, $descriptor); + + $call = new Call( + $this->buildMethod($interfaceName, $methodName), + $decodeType, + $request, + [], + Call::UNARY_CALL + ); + + $this->modifyUnaryCallable($callStack); + return $callStack($call, $optionalArgs + array_filter([ + 'audience' => self::getDefaultAudience() + ])); + } + + /** + * @param string $interfaceName + * @param string $methodName + * + * @return string + */ + private function buildMethod(?string $interfaceName = null, ?string $methodName = null) + { + return sprintf( + '%s/%s', + $interfaceName ?: $this->serviceName, + $methodName + ); + } + + /** + * @param array $headerParams + * @param Message|null $request + * + * @return array + */ + private function buildRequestParamsHeader(array $headerParams, ?Message $request = null) + { + $headers = []; + + // No request message means no request-based headers. + if (!$request) { + return $headers; + } + + foreach ($headerParams as $headerParam) { + $msg = $request; + $value = null; + foreach ($headerParam['fieldAccessors'] as $accessor) { + $value = $msg->$accessor(); + + // In case the field in question is nested in another message, + // skip the header param when the nested message field is unset. + $msg = $value; + if (is_null($msg)) { + break; + } + } + + $keyName = $headerParam['keyName']; + + // If there are value pattern matchers configured and the target + // field was set, evaluate the matchers in the order that they were + // annotated in with last one matching wins. + $original = $value; + $matchers = isset($headerParam['matchers']) && !is_null($value) ? + $headerParam['matchers'] : + []; + foreach ($matchers as $matcher) { + $matches = []; + if (preg_match($matcher, $original, $matches)) { + $value = $matches[$keyName]; + } + } + + // If there are no matches or the target field was unset, skip this + // header param. + if (!$value) { + continue; + } + + $headers[$keyName] = $value; + } + + $requestParams = new RequestParamsHeaderDescriptor($headers); + + return $requestParams->getHeader(); + } + + /** + * The SERVICE_ADDRESS constant is set by GAPIC clients + */ + private static function getDefaultAudience() + { + if (!defined('self::SERVICE_ADDRESS')) { + return null; + } + return 'https://' . self::SERVICE_ADDRESS . '/'; // @phpstan-ignore-line + } + + /** + * Modify the unary callable. + * + * @param callable $callable + * @access private + */ + protected function modifyUnaryCallable(callable &$callable) + { + // Do nothing - this method exists to allow callable modification by partial veneers. + } + + /** + * Modify the streaming callable. + * + * @param callable $callable + * @access private + */ + protected function modifyStreamingCallable(callable &$callable) + { + // Do nothing - this method exists to allow callable modification by partial veneers. + } + + /** + * @internal + */ + private function isBackwardsCompatibilityMode(): bool + { + return $this->backwardsCompatibilityMode + ?? $this->backwardsCompatibilityMode = substr(__CLASS__, -11) === 'GapicClient'; + } +} diff --git a/vendor/google/gax/src/GrpcSupportTrait.php b/vendor/google/gax/src/GrpcSupportTrait.php new file mode 100644 index 0000000..85251ee --- /dev/null +++ b/vendor/google/gax/src/GrpcSupportTrait.php @@ -0,0 +1,63 @@ +baseUri, + $path + )); + if ($queryParams) { + $uri = $this->buildUriWithQuery( + $uri, + $queryParams + ); + } + return $uri; + } +} diff --git a/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php b/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php new file mode 100644 index 0000000..7d89098 --- /dev/null +++ b/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php @@ -0,0 +1,65 @@ +nextHandler = $nextHandler; + $this->credentialsWrapper = $credentialsWrapper; + } + + public function __invoke(Call $call, array $options) + { + $next = $this->nextHandler; + return $next( + $call, + $options + ['credentialsWrapper' => $this->credentialsWrapper] + ); + } +} diff --git a/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php b/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php new file mode 100644 index 0000000..43fbb50 --- /dev/null +++ b/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php @@ -0,0 +1,72 @@ +nextHandler = $nextHandler; + $this->headers = $headers; + $this->overrideUserHeaders = $overrideUserHeaders; + } + + public function __invoke(Call $call, array $options) + { + $userHeaders = $options['headers'] ?? []; + if ($this->overrideUserHeaders) { + $options['headers'] = $this->headers + $userHeaders; + } else { + $options['headers'] = $userHeaders + $this->headers; + } + + $next = $this->nextHandler; + return $next( + $call, + $options + ); + } +} diff --git a/vendor/google/gax/src/Middleware/MiddlewareInterface.php b/vendor/google/gax/src/Middleware/MiddlewareInterface.php new file mode 100644 index 0000000..224006f --- /dev/null +++ b/vendor/google/gax/src/Middleware/MiddlewareInterface.php @@ -0,0 +1,91 @@ +handler = $handler; + * } + * public function __invoke(Call $call, array $options) + * { + * echo "Logging info about the call: " . $call->getMethod(); + * return ($this->handler)($call, $options); + * } + * } + * ``` + * + * Next, add the middleware to any class implementing `GapicClientTrait` by passing in a + * callable which returns the new middleware: + * + * ``` + * $client = new ExampleGoogleApiServiceClient(); + * $client->addMiddleware(function (MiddlewareInterface $handler) { + * return new MyTestMiddleware($handler); + * }); + * ``` + */ +interface MiddlewareInterface +{ + /** + * Modify or observe the API call request and response. + * The returned value must include the result of the next MiddlewareInterface invocation in the + * chain. + * + * @param Call $call + * @param array $options + * @return PromiseInterface|ClientStream|ServerStream|BidiStream + */ + public function __invoke(Call $call, array $options); +} diff --git a/vendor/google/gax/src/Middleware/OperationsMiddleware.php b/vendor/google/gax/src/Middleware/OperationsMiddleware.php new file mode 100644 index 0000000..2da3ed3 --- /dev/null +++ b/vendor/google/gax/src/Middleware/OperationsMiddleware.php @@ -0,0 +1,73 @@ +nextHandler = $nextHandler; + $this->operationsClient = $operationsClient; + $this->descriptor = $descriptor; + } + + public function __invoke(Call $call, array $options) + { + $next = $this->nextHandler; + return $next( + $call, + $options + )->then(function (Message $response) { + $options = $this->descriptor + [ + 'lastProtoResponse' => $response + ]; + $operationNameMethod = $options['operationNameMethod'] ?? 'getName'; + $operationName = call_user_func([$response, $operationNameMethod]); + return new OperationResponse($operationName, $this->operationsClient, $options); + }); + } +} diff --git a/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php b/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php new file mode 100644 index 0000000..bcc4052 --- /dev/null +++ b/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php @@ -0,0 +1,65 @@ +nextHandler = $nextHandler; + $this->permittedOptions = $permittedOptions; + } + + public function __invoke(Call $call, array $options) + { + $next = $this->nextHandler; + $filteredOptions = $this->pluckArray($this->permittedOptions, $options); + return $next( + $call, + $filteredOptions + ); + } +} diff --git a/vendor/google/gax/src/Middleware/PagedMiddleware.php b/vendor/google/gax/src/Middleware/PagedMiddleware.php new file mode 100644 index 0000000..e518763 --- /dev/null +++ b/vendor/google/gax/src/Middleware/PagedMiddleware.php @@ -0,0 +1,78 @@ +nextHandler = $nextHandler; + $this->descriptor = $descriptor; + } + + public function __invoke(Call $call, array $options) + { + $next = $this->nextHandler; + $descriptor = $this->descriptor; + return $next($call, $options)->then( + function (Message $response) use ($call, $next, $options, $descriptor) { + $page = new Page( + $call, + $options, + $next, + $descriptor, + $response + ); + return new PagedListResponse($page); + } + ); + } +} diff --git a/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php b/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php new file mode 100644 index 0000000..4811664 --- /dev/null +++ b/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php @@ -0,0 +1,104 @@ + */ + private $autoPopulationSettings; + + public function __construct( + callable $nextHandler, + array $autoPopulationSettings + ) { + $this->nextHandler = $nextHandler; + $this->autoPopulationSettings = $autoPopulationSettings; + } + + /** + * @param Call $call + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(Call $call, array $options) + { + $next = $this->nextHandler; + + if (empty($this->autoPopulationSettings)) { + return $next($call, $options); + } + + $request = $call->getMessage(); + foreach ($this->autoPopulationSettings as $fieldName => $valueType) { + $getFieldName = 'get' . ucwords($fieldName); + // We use a getter instead of a hazzer here because there's no need to + // differentiate between isset and an empty default value. Even if a + // field is explicitly set to an empty string, we want to autopopulate it. + if (empty($request->$getFieldName())) { + $setFieldName = 'set' . ucwords($fieldName); + switch ($valueType) { + case Format::UUID4: + $request->$setFieldName(Uuid::uuid4()->toString()); + break; + default: + throw new \UnexpectedValueException(sprintf( + 'Value type %s::%s not supported for auto population of the field %s', + Format::class, + Format::name($valueType), + $fieldName + )); + } + } + } + $call = $call->withMessage($request); + return $next( + $call, + $options + ); + } +} diff --git a/vendor/google/gax/src/Middleware/ResponseMetadataMiddleware.php b/vendor/google/gax/src/Middleware/ResponseMetadataMiddleware.php new file mode 100644 index 0000000..c8f1608 --- /dev/null +++ b/vendor/google/gax/src/Middleware/ResponseMetadataMiddleware.php @@ -0,0 +1,71 @@ +nextHandler = $nextHandler; + } + + public function __invoke(Call $call, array $options) + { + $metadataReceiver = new Promise(); + $options['metadataCallback'] = function ($metadata) use ($metadataReceiver) { + $metadataReceiver->resolve($metadata); + }; + $next = $this->nextHandler; + return $next($call, $options)->then( + function ($response) use ($metadataReceiver) { + if ($metadataReceiver->getState() === PromiseInterface::FULFILLED) { + return [$response, $metadataReceiver->wait()]; + } else { + return [$response, []]; + } + } + ); + } +} diff --git a/vendor/google/gax/src/Middleware/RetryMiddleware.php b/vendor/google/gax/src/Middleware/RetryMiddleware.php new file mode 100644 index 0000000..4e8f6e7 --- /dev/null +++ b/vendor/google/gax/src/Middleware/RetryMiddleware.php @@ -0,0 +1,199 @@ +nextHandler = $nextHandler; + $this->retrySettings = $retrySettings; + $this->deadlineMs = $deadlineMs; + $this->retryAttempts = $retryAttempts; + } + + /** + * @param Call $call + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(Call $call, array $options) + { + $nextHandler = $this->nextHandler; + + if (!isset($options['timeoutMillis'])) { + // default to "noRetriesRpcTimeoutMillis" when retries are disabled, otherwise use "initialRpcTimeoutMillis" + if (!$this->retrySettings->retriesEnabled() && $this->retrySettings->getNoRetriesRpcTimeoutMillis() > 0) { + $options['timeoutMillis'] = $this->retrySettings->getNoRetriesRpcTimeoutMillis(); + } elseif ($this->retrySettings->getInitialRpcTimeoutMillis() > 0) { + $options['timeoutMillis'] = $this->retrySettings->getInitialRpcTimeoutMillis(); + } + } + + // Setting the retry attempt for logging + if ($this->retryAttempts > 0) { + $options['retryAttempt'] = $this->retryAttempts; + } + + // Call the handler immediately if retry settings are disabled. + if (!$this->retrySettings->retriesEnabled()) { + return $nextHandler($call, $options); + } + + return $nextHandler($call, $options)->then(null, function ($e) use ($call, $options) { + $retryFunction = $this->getRetryFunction(); + + // If the number of retries has surpassed the max allowed retries + // then throw the exception as we normally would. + // If the maxRetries is set to 0, then we don't check this condition. + if (0 !== $this->retrySettings->getMaxRetries() + && $this->retryAttempts >= $this->retrySettings->getMaxRetries() + ) { + throw $e; + } + // If the retry function returns false then throw the + // exception as we normally would. + if (!$retryFunction($e, $options)) { + throw $e; + } + + // Retry function returned true, so we attempt another retry + return $this->retry($call, $options, $e->getStatus()); + }); + } + + /** + * @param Call $call + * @param array $options + * @param string $status + * + * @return PromiseInterface + * @throws ApiException + */ + private function retry(Call $call, array $options, string $status) + { + $delayMult = $this->retrySettings->getRetryDelayMultiplier(); + $maxDelayMs = $this->retrySettings->getMaxRetryDelayMillis(); + $timeoutMult = $this->retrySettings->getRpcTimeoutMultiplier(); + $maxTimeoutMs = $this->retrySettings->getMaxRpcTimeoutMillis(); + $totalTimeoutMs = $this->retrySettings->getTotalTimeoutMillis(); + + $delayMs = $this->retrySettings->getInitialRetryDelayMillis(); + $timeoutMs = $options['timeoutMillis']; + $currentTimeMs = $this->getCurrentTimeMs(); + $deadlineMs = $this->deadlineMs ?: $currentTimeMs + $totalTimeoutMs; + + if ($currentTimeMs >= $deadlineMs) { + throw new ApiException( + 'Retry total timeout exceeded.', + \Google\Rpc\Code::DEADLINE_EXCEEDED, + ApiStatus::DEADLINE_EXCEEDED + ); + } + + $delayMs = min($delayMs * $delayMult, $maxDelayMs); + $timeoutMs = (int) min( + $timeoutMs * $timeoutMult, + $maxTimeoutMs, + $deadlineMs - $this->getCurrentTimeMs() + ); + + $nextHandler = new RetryMiddleware( + $this->nextHandler, + $this->retrySettings->with([ + 'initialRetryDelayMillis' => $delayMs, + ]), + $deadlineMs, + $this->retryAttempts + 1 + ); + + // Set the timeout for the call + $options['timeoutMillis'] = $timeoutMs; + + return $nextHandler( + $call, + $options + ); + } + + protected function getCurrentTimeMs() + { + return microtime(true) * 1000.0; + } + + /** + * This is the default retry behaviour. + */ + private function getRetryFunction() + { + return $this->retrySettings->getRetryFunction() ?? + function (\Throwable $e, array $options): bool { + // This is the default retry behaviour, i.e. we don't retry an ApiException + // and for other exception types, we only retry when the error code is in + // the list of retryable error codes. + if (!$e instanceof ApiException) { + return false; + } + + if (!in_array($e->getStatus(), $this->retrySettings->getRetryableCodes())) { + return false; + } + + return true; + }; + } +} diff --git a/vendor/google/gax/src/OperationResponse.php b/vendor/google/gax/src/OperationResponse.php new file mode 100644 index 0000000..8e58c81 --- /dev/null +++ b/vendor/google/gax/src/OperationResponse.php @@ -0,0 +1,539 @@ + self::DEFAULT_POLLING_INTERVAL, + 'pollDelayMultiplier' => self::DEFAULT_POLLING_MULTIPLIER, + 'maxPollDelayMillis' => self::DEFAULT_MAX_POLLING_INTERVAL, + 'totalPollTimeoutMillis' => self::DEFAULT_MAX_POLLING_DURATION, + ]; + + private ?object $lastProtoResponse; + private bool $deleted = false; + + private array $additionalArgs; + private string $getOperationMethod; + private ?string $cancelOperationMethod; + private ?string $deleteOperationMethod; + private string $getOperationRequest; + private ?string $cancelOperationRequest; + private ?string $deleteOperationRequest; + private string $operationStatusMethod; + /** @var mixed */ + private $operationStatusDoneValue; + private ?string $operationErrorCodeMethod; + private ?string $operationErrorMessageMethod; + + /** + * OperationResponse constructor. + * + * @param string $operationName + * @param object $operationsClient + * @param array $options { + * Optional. Options for configuring the operation response object. + * + * @type string $operationReturnType The return type of the longrunning operation. + * @type string $metadataReturnType The type of the metadata returned in the operation response. + * @type int $initialPollDelayMillis The initial polling interval to use, in milliseconds. + * @type int $pollDelayMultiplier Multiplier applied to the polling interval on each retry. + * @type int $maxPollDelayMillis The maximum polling interval to use, in milliseconds. + * @type int $totalPollTimeoutMillis The maximum amount of time to continue polling. + * @type object $lastProtoResponse A response already received from the server. + * @type string $getOperationMethod The method on $operationsClient to get the operation. + * @type string $cancelOperationMethod The method on $operationsClient to cancel the operation. + * @type string $deleteOperationMethod The method on $operationsClient to delete the operation. + * @type string $operationStatusMethod The method on the operation to get the status. + * @type string $operationStatusDoneValue The method on the operation to determine if the status is done. + * @type array $additionalOperationArguments Additional arguments to pass to $operationsClient methods. + * @type string $operationErrorCodeMethod The method on the operation to get the error code + * @type string $operationErrorMessageMethod The method on the operation to get the error status + * } + */ + public function __construct(string $operationName, $operationsClient, array $options = []) + { + $this->operationName = $operationName; + $this->operationsClient = $operationsClient; + $options += [ + 'operationReturnType' => null, + 'metadataReturnType' => null, + 'lastProtoResponse' => null, + 'getOperationMethod' => 'getOperation', + 'cancelOperationMethod' => 'cancelOperation', + 'deleteOperationMethod' => 'deleteOperation', + 'operationStatusMethod' => 'getDone', + 'operationStatusDoneValue' => true, + 'additionalOperationArguments' => [], + 'operationErrorCodeMethod' => null, + 'operationErrorMessageMethod' => null, + 'getOperationRequest' => GetOperationRequest::class, + 'cancelOperationRequest' => CancelOperationRequest::class, + 'deleteOperationRequest' => DeleteOperationRequest::class, + ]; + $this->operationReturnType = $options['operationReturnType']; + $this->metadataReturnType = $options['metadataReturnType']; + $this->lastProtoResponse = $options['lastProtoResponse']; + $this->getOperationMethod = $options['getOperationMethod']; + $this->cancelOperationMethod = $options['cancelOperationMethod']; + $this->deleteOperationMethod = $options['deleteOperationMethod']; + $this->additionalArgs = $options['additionalOperationArguments']; + $this->operationStatusMethod = $options['operationStatusMethod']; + $this->operationStatusDoneValue = $options['operationStatusDoneValue']; + $this->operationErrorCodeMethod = $options['operationErrorCodeMethod']; + $this->operationErrorMessageMethod = $options['operationErrorMessageMethod']; + $this->getOperationRequest = $options['getOperationRequest']; + $this->cancelOperationRequest = $options['cancelOperationRequest']; + $this->deleteOperationRequest = $options['deleteOperationRequest']; + + if (isset($options['initialPollDelayMillis'])) { + $this->defaultPollSettings['initialPollDelayMillis'] = $options['initialPollDelayMillis']; + } + if (isset($options['pollDelayMultiplier'])) { + $this->defaultPollSettings['pollDelayMultiplier'] = $options['pollDelayMultiplier']; + } + if (isset($options['maxPollDelayMillis'])) { + $this->defaultPollSettings['maxPollDelayMillis'] = $options['maxPollDelayMillis']; + } + if (isset($options['totalPollTimeoutMillis'])) { + $this->defaultPollSettings['totalPollTimeoutMillis'] = $options['totalPollTimeoutMillis']; + } + } + + /** + * Check whether the operation has completed. + * + * @return bool + */ + public function isDone() + { + if (!$this->hasProtoResponse()) { + return false; + } + + $status = call_user_func([$this->lastProtoResponse, $this->operationStatusMethod]); + if (is_null($status)) { + return false; + } + + return $status === $this->operationStatusDoneValue; + } + + /** + * Check whether the operation completed successfully. If the operation is not complete, or if the operation + * failed, return false. + * + * @return bool + */ + public function operationSucceeded() + { + if (!$this->hasProtoResponse()) { + return false; + } + + if (!$this->canHaveResult()) { + // For Operations which do not have a result, we consider a successful + // operation when the operation has completed without errors. + return $this->isDone() && !$this->hasErrors(); + } + + return !is_null($this->getResult()); + } + + /** + * Check whether the operation failed. If the operation is not complete, or if the operation + * succeeded, return false. + * + * @return bool + */ + public function operationFailed() + { + return $this->hasErrors(); + } + + /** + * Get the formatted name of the operation + * + * @return string The formatted name of the operation + */ + public function getName() + { + return $this->operationName; + } + + /** + * Poll the server in a loop until the operation is complete. + * + * Return true if the operation completed, otherwise return false. If the + * $options['totalPollTimeoutMillis'] setting is not set (or set <= 0) then + * pollUntilComplete will continue polling until the operation completes, + * and therefore will always return true. + * + * @param array $options { + * Options for configuring the polling behaviour. + * + * @type int $initialPollDelayMillis The initial polling interval to use, in milliseconds. + * @type int $pollDelayMultiplier Multiplier applied to the polling interval on each retry. + * @type int $maxPollDelayMillis The maximum polling interval to use, in milliseconds. + * @type int $totalPollTimeoutMillis The maximum amount of time to continue polling, in milliseconds. + * } + * @throws ApiException If an API call fails. + * @throws ValidationException + * @return bool Indicates if the operation completed. + */ + public function pollUntilComplete(array $options = []) + { + if ($this->isDone()) { + return true; + } + + $pollSettings = array_merge($this->defaultPollSettings, $options); + return $this->poll(function () { + $this->reload(); + return $this->isDone(); + }, $pollSettings); + } + + /** + * Reload the status of the operation with a request to the service. + * + * @throws ApiException If the API call fails. + * @throws ValidationException If called on a deleted operation. + */ + public function reload() + { + if ($this->deleted) { + throw new ValidationException('Cannot call reload() on a deleted operation'); + } + + $requestClass = $this->isNewSurfaceOperationsClient() ? $this->getOperationRequest : null; + $this->lastProtoResponse = $this->operationsCall($this->getOperationMethod, $requestClass); + } + + /** + * Return the result of the operation. If operationSucceeded() is false, + * return null. + * + * @return T|null + */ + public function getResult() + { + if (!$this->hasProtoResponse()) { + return null; + } + + if (!$this->canHaveResult()) { + return null; + } + + if (!$this->isDone()) { + return null; + } + + /** @var Any|null $anyResponse */ + $anyResponse = $this->lastProtoResponse->getResponse(); + if (is_null($anyResponse)) { + return null; + } + if (is_null($this->operationReturnType)) { + return $anyResponse; + } + $operationReturnType = $this->operationReturnType; + /** @var Message $response */ + $response = new $operationReturnType(); + $response->mergeFromString($anyResponse->getValue()); + return $response; + } + + /** + * If the operation failed, return the status. If operationFailed() is false, return null. + * + * @return Status|null The status of the operation in case of failure, or null if + * operationFailed() is false. + */ + public function getError() + { + if (!$this->hasProtoResponse() || !$this->isDone()) { + return null; + } + + if ($this->operationErrorCodeMethod || $this->operationErrorMessageMethod) { + $errorCode = $this->operationErrorCodeMethod + ? call_user_func([$this->lastProtoResponse, $this->operationErrorCodeMethod]) + : null; + $errorMessage = $this->operationErrorMessageMethod + ? call_user_func([$this->lastProtoResponse, $this->operationErrorMessageMethod]) + : null; + return (new Status()) + ->setCode(ApiStatus::rpcCodeFromHttpStatusCode($errorCode)) + ->setMessage($errorMessage); + } + + if (method_exists($this->lastProtoResponse, 'getError')) { + return $this->lastProtoResponse->getError(); + } + + return null; + } + + /** + * Get an array containing the values of 'operationReturnType', 'metadataReturnType', and + * the polling options `initialPollDelayMillis`, `pollDelayMultiplier`, `maxPollDelayMillis`, + * and `totalPollTimeoutMillis`. The array can be passed as the $options argument to the + * constructor when creating another OperationResponse object. + * + * @return array + */ + public function getDescriptorOptions() + { + return [ + 'operationReturnType' => $this->operationReturnType, + 'metadataReturnType' => $this->metadataReturnType, + ] + $this->defaultPollSettings; + } + + /** + * @return Operation|mixed|null The last Operation object received from the server. + */ + public function getLastProtoResponse() + { + return $this->lastProtoResponse; + } + + /** + * @return object The OperationsClient object used to make + * requests to the operations API. + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Cancel the long-running operation. + * + * For operations of type Google\LongRunning\Operation, this method starts + * asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it will throw an + * ApiException with code \Google\Rpc\Code::UNIMPLEMENTED. Clients can continue + * to use reload and pollUntilComplete methods to check whether the cancellation + * succeeded or whether the operation completed despite cancellation. + * On successful cancellation, the operation is not deleted; instead, it becomes + * an operation with a getError() value with a \Google\Rpc\Status code of 1, + * corresponding to \Google\Rpc\Code::CANCELLED. + * + * @throws ApiException If the API call fails. + * @throws LogicException If the API call method has not been configured + */ + public function cancel() + { + if (is_null($this->cancelOperationMethod)) { + throw new LogicException('The cancel operation is not supported by this API'); + } + + $requestClass = $this->isNewSurfaceOperationsClient() ? $this->cancelOperationRequest : null; + $this->operationsCall($this->cancelOperationMethod, $requestClass); + } + + /** + * Delete the long-running operation. + * + * For operations of type Google\LongRunning\Operation, this method + * indicates that the client is no longer interested in the operation result. + * It does not cancel the operation. If the server doesn't support this method, + * it will throw an ApiException with code \Google\Rpc\Code::UNIMPLEMENTED. + * + * @throws ApiException If the API call fails. + * @throws LogicException If the API call method has not been configured + */ + public function delete() + { + if (is_null($this->deleteOperationMethod)) { + throw new LogicException('The delete operation is not supported by this API'); + } + + $requestClass = $this->isNewSurfaceOperationsClient() ? $this->deleteOperationRequest : null; + $this->operationsCall($this->deleteOperationMethod, $requestClass); + $this->deleted = true; + } + + /** + * Get the metadata returned with the last proto response. If a metadata type was provided, then + * the return value will be of that type - otherwise, the return value will be of type Any. If + * no metadata object is available, returns null. + * + * @return mixed The metadata returned from the server in the last response. + */ + public function getMetadata() + { + if (!$this->hasProtoResponse()) { + return null; + } + + if (!method_exists($this->lastProtoResponse, 'getMetadata')) { + // The call to getMetadata is only for OnePlatform LROs, and is not + // supported by other LRO GAPIC clients (e.g. Compute) + return null; + } + + /** @var Any|null $any */ + $any = $this->lastProtoResponse->getMetadata(); + if (is_null($this->metadataReturnType)) { + return $any; + } + if (is_null($any)) { + return null; + } + // @TODO: This is probably not doing anything and can be removed in the next release. + if (is_null($any->getValue())) { + return null; + } + $metadataReturnType = $this->metadataReturnType; + /** @var Message $metadata */ + $metadata = new $metadataReturnType(); + $metadata->mergeFromString($any->getValue()); + return $metadata; + } + + /** + * Call the operations client to perform an operation. + * + * @param string $method The method to call on the operations client. + * @param string|null $requestClass The request class to use for the call. + * Will be null for legacy operations clients. + */ + private function operationsCall(string $method, ?string $requestClass) + { + // V1 GAPIC clients have an empty $requestClass + if (empty($requestClass)) { + if ($this->additionalArgs) { + return $this->operationsClient->$method( + $this->getName(), + ...array_values($this->additionalArgs) + ); + } + return $this->operationsClient->$method($this->getName()); + } + + if (!method_exists($requestClass, 'build')) { + throw new LogicException('Request class must support the static build method'); + } + // In V2 of Compute, the Request "build" methods contain the operation ID last instead + // of first. Compute is the only API which uses $additionalArgs, so switching the order + // will not break anything. + $request = $requestClass::build(...array_merge( + array_values($this->additionalArgs), + [$this->getName()] + )); + return $this->operationsClient->$method($request); + } + + private function canHaveResult() + { + // The call to getResponse is only for OnePlatform LROs, and is not + // supported by other LRO GAPIC clients (e.g. Compute) + return method_exists($this->lastProtoResponse, 'getResponse'); + } + + private function hasErrors() + { + if (!$this->hasProtoResponse()) { + return false; + } + + if (method_exists($this->lastProtoResponse, 'getError')) { + return !empty($this->lastProtoResponse->getError()); + } + + if ($this->operationErrorCodeMethod) { + $errorCode = call_user_func([$this->lastProtoResponse, $this->operationErrorCodeMethod]); + return !empty($errorCode); + } + + // This should never happen unless an API is misconfigured + throw new LogicException('Unable to determine operation error status for this service'); + } + + private function hasProtoResponse() + { + return !is_null($this->lastProtoResponse); + } + + private function isNewSurfaceOperationsClient(): bool + { + return !$this->operationsClient instanceof LegacyOperationsClient + && false !== strpos(get_class($this->operationsClient), self::NEW_CLIENT_NAMESPACE); + } +} diff --git a/vendor/google/gax/src/Options/CallOptions.php b/vendor/google/gax/src/Options/CallOptions.php new file mode 100644 index 0000000..bae69dd --- /dev/null +++ b/vendor/google/gax/src/Options/CallOptions.php @@ -0,0 +1,160 @@ +> $headers + * Key-value array containing headers. + * @type int $timeoutMillis + * The timeout in milliseconds for the call. + * @type array $transportOptions + * Transport-specific call options. See {@see CallOptions::setTransportOptions}. + * @type RetrySettings|array $retrySettings + * A retry settings override for the call. If $retrySettings is an + * array, the settings will be merged with the method's default + * retry settings. If $retrySettings is a RetrySettings object, + * that object will be used instead of the method defaults. + * } + */ + public function __construct(array $options) + { + $this->fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setHeaders($arr['headers'] ?? []); + $this->setTimeoutMillis($arr['timeoutMillis'] ?? null); + $this->setTransportOptions($arr['transportOptions'] ?? []); + $this->setRetrySettings($arr['retrySettings'] ?? null); + } + + /** + * @param array $headers + */ + public function setHeaders(array $headers): self + { + $this->headers = $headers; + + return $this; + } + + /** + * @param int|null $timeoutMillis + */ + public function setTimeoutMillis(?int $timeoutMillis): self + { + $this->timeoutMillis = $timeoutMillis; + + return $this; + } + + /** + * @param array $transportOptions { + * Transport-specific call-time options. + * + * @type array $grpcOptions + * Key-value pairs for gRPC-specific options passed as the `$options` argument to {@see \Grpc\BaseStub} + * request methods. Current options are `call_credentials_callback` and `timeout`. + * **NOTE**: This library sets `call_credentials_callback` using {@see CredentialsWrapper}, and `timeout` + * using the `timeoutMillis` call option, so these options are not very useful. + * @type array $grpcFallbackOptions + * Key-value pairs for gRPC fallback specific options passed as the `$options` argument to the + * `$httpHandler` callable. By default these are passed to {@see \GuzzleHttp\Client} as request options. + * See {@link https://docs.guzzlephp.org/en/stable/request-options.html}. + * @type array $restOptions + * Key-value pairs for REST-specific options passed as the `$options` argument to the `$httpHandler` + * callable. By default these are passed to {@see \GuzzleHttp\Client} as request options. + * See {@link https://docs.guzzlephp.org/en/stable/request-options.html}. + * } + */ + public function setTransportOptions(array $transportOptions): self + { + $this->transportOptions = $transportOptions; + + return $this; + } + + /** + * @deprecated use CallOptions::setTransportOptions + */ + public function setTransportSpecificOptions(array $transportSpecificOptions): self + { + $this->setTransportOptions($transportSpecificOptions); + + return $this; + } + + /** + * @param RetrySettings|array|null $retrySettings + * + * @return $this + */ + public function setRetrySettings($retrySettings): self + { + $this->retrySettings = $retrySettings; + + return $this; + } +} diff --git a/vendor/google/gax/src/Options/ClientOptions.php b/vendor/google/gax/src/Options/ClientOptions.php new file mode 100644 index 0000000..c121cc1 --- /dev/null +++ b/vendor/google/gax/src/Options/ClientOptions.php @@ -0,0 +1,419 @@ + '/path/to/my/credentials.json' + * ]); + * $secretManager = new SecretManagerClient($options->toArray()); + * ``` + * + * Note: It's possible to pass an associative array to the API clients as well, + * as ClientOptions will still be used internally for validation. + */ +class ClientOptions implements ArrayAccess, OptionsInterface +{ + use OptionsTrait; + + private ?string $apiEndpoint; + + private bool $disableRetries; + + private array $clientConfig; + + /** @var string|array|FetchAuthTokenInterface|CredentialsWrapper|null */ + private $credentials; + + private array $credentialsConfig; + + /** @var string|TransportInterface|null $transport */ + private $transport; + + private TransportOptions $transportConfig; + + private ?string $versionFile; + + private ?string $descriptorsConfigPath; + + private ?string $serviceName; + + private ?string $libName; + + private ?string $libVersion; + + private ?string $gapicVersion; + + private ?Closure $clientCertSource; + + private ?string $universeDomain; + + private ?string $apiKey; + + private null|false|LoggerInterface $logger; + + /** + * @param array $options { + * @type string $apiEndpoint + * The address of the API remote host, for example "example.googleapis.com. May also + * include the port, for example "example.googleapis.com:443" + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either a + * path to a JSON file, or a PHP array containing the decoded JSON data. + * By default this settings points to the default client config file, which is provided + * in the resources folder. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * \Google\Auth\FetchAuthTokenInterface object or \Google\ApiCore\CredentialsWrapper + * object. Note that when one of these objects are provided, any settings in + * $authConfig will be ignored. + * *Important*: If you accept a credential configuration (credential JSON/File/Stream) + * from an external source for authentication to Google Cloud Platform, you must + * validate it before providing it to any Google API or library. Providing an + * unvalidated credential configuration to Google APIs can compromise the security of + * your systems and data. For more information + * {@see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the client. + * For a full list of supporting configuration options, see + * \Google\ApiCore\CredentialsWrapper::build. + * @type string|TransportInterface|null $transport + * The transport used for executing network requests. May be either the string `rest`, + * `grpc`, or 'grpc-fallback'. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already instantiated + * TransportInterface object. Note that when this objects is provided, any settings in + * $transportConfig, and any `$apiEndpoint` setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * 'grpc-fallback' => [...], + * ]; + * See the GrpcTransport::build and RestTransport::build + * methods for the supported options. + * @type string $versionFile + * The path to a file which contains the current version of the client. + * @type string $descriptorsConfigPath + * The path to a descriptor configuration file. + * @type string $serviceName + * The name of the service. + * @type string $libName + * The name of the client application. + * @type string $libVersion + * The version of the client application. + * @type string $gapicVersion + * The code generator version of the GAPIC library. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. + * @type string $universeDomain + * The default service domain for a given Cloud universe. + * @type string $apiKey + * The API key to be used for the client. + * @type null|false|LoggerInterface + * A PSR-3 compliant logger. + * } + */ + public function __construct(array $options) + { + $this->fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setApiEndpoint($arr['apiEndpoint'] ?? null); + $this->setDisableRetries($arr['disableRetries'] ?? false); + $this->setClientConfig($arr['clientConfig'] ?? []); + $this->setCredentials($arr['credentials'] ?? null); + $this->setCredentialsConfig($arr['credentialsConfig'] ?? []); + $this->setTransport($arr['transport'] ?? null); + $this->setTransportConfig(new TransportOptions($arr['transportConfig'] ?? [])); + $this->setVersionFile($arr['versionFile'] ?? null); + $this->setDescriptorsConfigPath($arr['descriptorsConfigPath'] ?? null); + $this->setServiceName($arr['serviceName'] ?? null); + $this->setLibName($arr['libName'] ?? null); + $this->setLibVersion($arr['libVersion'] ?? null); + $this->setGapicVersion($arr['gapicVersion'] ?? null); + $this->setClientCertSource($arr['clientCertSource'] ?? null); + $this->setUniverseDomain($arr['universeDomain'] ?? null); + $this->setApiKey($arr['apiKey'] ?? null); + $this->setLogger($arr['logger'] ?? null); + } + + /** + * @param ?string $apiEndpoint + * + * @return $this + */ + public function setApiEndpoint(?string $apiEndpoint): self + { + $this->apiEndpoint = $apiEndpoint; + + return $this; + } + + /** + * @param bool $disableRetries + * + * @return $this + */ + public function setDisableRetries(bool $disableRetries): self + { + $this->disableRetries = $disableRetries; + + return $this; + } + + /** + * @param string|array $clientConfig + * + * @return $this + * @throws InvalidArgumentException + */ + public function setClientConfig($clientConfig): self + { + if (is_string($clientConfig)) { + $this->clientConfig = json_decode(file_get_contents($clientConfig), true); + } elseif (is_array($clientConfig)) { + $this->clientConfig = $clientConfig; + } else { + throw new InvalidArgumentException('Invalid client config'); + } + + return $this; + } + + /** + * @param string|array|FetchAuthTokenInterface|CredentialsWrapper|null $credentials + * + * @return $this + */ + public function setCredentials($credentials): self + { + $this->credentials = $credentials; + + return $this; + } + + /** + * @param array $credentialsConfig + * + * @return $this + */ + public function setCredentialsConfig(array $credentialsConfig): self + { + $this->credentialsConfig = $credentialsConfig; + + return $this; + } + + /** + * @param string|TransportInterface|null $transport + * + * @return $this + */ + public function setTransport($transport): self + { + $this->transport = $transport; + + return $this; + } + + /** + * @param TransportOptions $transportConfig + * + * @return $this + */ + public function setTransportConfig(TransportOptions $transportConfig): self + { + $this->transportConfig = $transportConfig; + + return $this; + } + + /** + * @param ?string $versionFile + * + * @return $this + */ + public function setVersionFile(?string $versionFile): self + { + $this->versionFile = $versionFile; + + return $this; + } + + /** + * @param ?string $descriptorsConfigPath + * + * @return $this + */ + private function setDescriptorsConfigPath(?string $descriptorsConfigPath): self + { + if (!is_null($descriptorsConfigPath)) { + self::validateFileExists($descriptorsConfigPath); + } + $this->descriptorsConfigPath = $descriptorsConfigPath; + + return $this; + } + + /** + * @param ?string $serviceName + * + * @return $this + */ + public function setServiceName(?string $serviceName): self + { + $this->serviceName = $serviceName; + + return $this; + } + + /** + * @param ?string $libName + * + * @return $this + */ + public function setLibName(?string $libName): self + { + $this->libName = $libName; + + return $this; + } + + /** + * @param ?string $libVersion + * + * @return $this + */ + public function setLibVersion(?string $libVersion): self + { + $this->libVersion = $libVersion; + + return $this; + } + + /** + * @param ?string $gapicVersion + * + * @return $this + */ + public function setGapicVersion(?string $gapicVersion): self + { + $this->gapicVersion = $gapicVersion; + + return $this; + } + + /** + * @param ?callable $clientCertSource + * + * @return $this + */ + public function setClientCertSource(?callable $clientCertSource): self + { + if (!is_null($clientCertSource)) { + $clientCertSource = Closure::fromCallable($clientCertSource); + } + $this->clientCertSource = $clientCertSource; + + return $this; + } + + /** + * @param string $universeDomain + * + * @return $this + */ + public function setUniverseDomain(?string $universeDomain): self + { + $this->universeDomain = $universeDomain; + + return $this; + } + + /** + * @param string $apiKey + * + * @return $this + */ + public function setApiKey(?string $apiKey): self + { + $this->apiKey = $apiKey; + + return $this; + } + + /** + * @param null|false|LoggerInterface $logger + * + * @return $this + */ + public function setLogger(null|false|LoggerInterface $logger): self + { + $this->logger = $logger; + + return $this; + } +} diff --git a/vendor/google/gax/src/Options/OptionsInterface.php b/vendor/google/gax/src/Options/OptionsInterface.php new file mode 100644 index 0000000..684d27e --- /dev/null +++ b/vendor/google/gax/src/Options/OptionsInterface.php @@ -0,0 +1,38 @@ +$offset); + } + + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->$offset; + } + + /** + * @throws BadMethodCallException + */ + public function offsetSet($offset, $value): void + { + throw new BadMethodCallException('Cannot set options through array access. Use the setters instead'); + } + + /** + * @throws BadMethodCallException + */ + public function offsetUnset($offset): void + { + throw new BadMethodCallException('Cannot unset options through array access. Use the setters instead'); + } + + public function toArray(): array + { + $arr = []; + foreach (get_object_vars($this) as $key => $value) { + $arr[$key] = $value instanceof OptionsInterface + ? $value->toArray() + : $value; + } + return $arr; + } +} diff --git a/vendor/google/gax/src/Options/TransportOptions.php b/vendor/google/gax/src/Options/TransportOptions.php new file mode 100644 index 0000000..3334d6f --- /dev/null +++ b/vendor/google/gax/src/Options/TransportOptions.php @@ -0,0 +1,111 @@ +fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setGrpc(new GrpcTransportOptions($arr['grpc'] ?? [])); + $this->setGrpcFallback(new GrpcFallbackTransportOptions($arr['grpc-fallback'] ?? [])); + $this->setRest(new RestTransportOptions($arr['rest'] ?? [])); + } + + /** + * @param GrpcTransportOptions $grpc + * + * @return $this + */ + public function setGrpc(GrpcTransportOptions $grpc): self + { + $this->grpc = $grpc; + + return $this; + } + + /** + * @param GrpcFallbackTransportOptions $grpcFallback + * + * @return $this + */ + public function setGrpcFallback(GrpcFallbackTransportOptions $grpcFallback): self + { + $this->grpcFallback = $grpcFallback; + + return $this; + } + + /** + * @param RestTransportOptions $rest + * + * @return $this + */ + public function setRest(RestTransportOptions $rest): self + { + $this->rest = $rest; + + return $this; + } +} diff --git a/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php b/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php new file mode 100644 index 0000000..9f94b23 --- /dev/null +++ b/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php @@ -0,0 +1,125 @@ +fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setClientCertSource($arr['clientCertSource'] ?? null); + $this->setHttpHandler($arr['httpHandler'] ?? null); + $this->setLogger($arr['logger'] ?? null); + } + + /** + * @param ?callable $httpHandler + * + * @return $this + */ + public function setHttpHandler(?callable $httpHandler): self + { + if (!is_null($httpHandler)) { + $httpHandler = Closure::fromCallable($httpHandler); + } + $this->httpHandler = $httpHandler; + + return $this; + } + + /** + * @param ?callable $clientCertSource + * + * @return $this + */ + public function setClientCertSource(?callable $clientCertSource): self + { + if (!is_null($clientCertSource)) { + $clientCertSource = Closure::fromCallable($clientCertSource); + } + $this->clientCertSource = $clientCertSource; + + return $this; + } + + /** + * @param null|false|LoggerInterface $logger + * + * @return $this + */ + public function setLogger(null|false|LoggerInterface $logger): self + { + $this->logger = $logger; + + return $this; + } +} diff --git a/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php b/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php new file mode 100644 index 0000000..051b57b --- /dev/null +++ b/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php @@ -0,0 +1,165 @@ +fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setStubOpts($arr['stubOpts'] ?? []); + $this->setChannel($arr['channel'] ?? null); + $this->setInterceptors($arr['interceptors'] ?? []); + $this->setClientCertSource($arr['clientCertSource'] ?? null); + $this->setLogger($arr['logger'] ?? null); + } + + /** + * @param array $stubOpts + * + * @return $this + */ + public function setStubOpts(array $stubOpts): self + { + $this->stubOpts = $stubOpts; + + return $this; + } + + /** + * @param ?Channel $channel + * + * @return $this + */ + public function setChannel(?Channel $channel): self + { + $this->channel = $channel; + + return $this; + } + + /** + * @param Interceptor[]|UnaryInterceptorInterface[] $interceptors + * + * @return $this + */ + public function setInterceptors(array $interceptors): self + { + $this->interceptors = $interceptors; + + return $this; + } + + /** + * @param ?callable $clientCertSource + * + * @return $this + */ + public function setClientCertSource(?callable $clientCertSource): self + { + if (!is_null($clientCertSource)) { + $clientCertSource = Closure::fromCallable($clientCertSource); + } + $this->clientCertSource = $clientCertSource; + + return $this; + } + + /** + * @param null|false|LoggerInterface $logger + * + * @return $this + */ + public function setLogger(null|false|LoggerInterface $logger): self + { + $this->logger = $logger; + + return $this; + } +} diff --git a/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php b/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php new file mode 100644 index 0000000..ea55e2e --- /dev/null +++ b/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php @@ -0,0 +1,142 @@ +fromArray($options); + } + + /** + * Sets the array of options as class properites. + * + * @param array $arr See the constructor for the list of supported options. + */ + private function fromArray(array $arr): void + { + $this->setHttpHandler($arr['httpHandler'] ?? null); + $this->setClientCertSource($arr['clientCertSource'] ?? null); + $this->setRestClientConfigPath($arr['restClientConfigPath'] ?? null); + $this->setLogger($arr['logger'] ?? null); + } + + /** + * @param ?callable $httpHandler + * + * @return $this + */ + public function setHttpHandler(?callable $httpHandler): self + { + if (!is_null($httpHandler)) { + $httpHandler = Closure::fromCallable($httpHandler); + } + $this->httpHandler = $httpHandler; + + return $this; + } + + /** + * @param ?callable $clientCertSource + * + * @return $this + */ + public function setClientCertSource(?callable $clientCertSource): self + { + if (!is_null($clientCertSource)) { + $clientCertSource = Closure::fromCallable($clientCertSource); + } + $this->clientCertSource = $clientCertSource; + + return $this; + } + + /** + * @param ?string $restClientConfigPath + * + * @return $this + */ + public function setRestClientConfigPath(?string $restClientConfigPath): self + { + $this->restClientConfigPath = $restClientConfigPath; + + return $this; + } + + /** + * @param null|false|LoggerInterface $logger + * + * @return $this + */ + public function setLogger(null|false|LoggerInterface $logger): self + { + $this->logger = $logger; + + return $this; + } +} diff --git a/vendor/google/gax/src/Page.php b/vendor/google/gax/src/Page.php new file mode 100644 index 0000000..996cadf --- /dev/null +++ b/vendor/google/gax/src/Page.php @@ -0,0 +1,271 @@ +call = $call; + $this->options = $options; + $this->callable = $callable; + $this->pageStreamingDescriptor = $pageStreamingDescriptor; + $this->response = $response; + + $requestPageTokenGetMethod = $this->pageStreamingDescriptor->getRequestPageTokenGetMethod(); + $this->pageToken = $this->call->getMessage()->$requestPageTokenGetMethod(); + } + + /** + * Returns true if there are more pages that can be retrieved from the + * API. + * + * @return bool + */ + public function hasNextPage() + { + return strcmp($this->getNextPageToken(), Page::FINAL_PAGE_TOKEN) != 0; + } + + /** + * Returns the next page token from the response. + * + * @return string + */ + public function getNextPageToken() + { + $responsePageTokenGetMethod = $this->pageStreamingDescriptor->getResponsePageTokenGetMethod(); + return $this->getResponseObject()->$responsePageTokenGetMethod(); + } + + /** + * Retrieves the next Page object using the next page token. + * + * @param int|null $pageSize + * @throws ValidationException if there are no pages remaining, or if pageSize is supplied but + * is not supported by the API + * @throws ApiException if the call to fetch the next page fails. + * @return Page + */ + public function getNextPage(?int $pageSize = null) + { + if (!$this->hasNextPage()) { + throw new ValidationException( + 'Could not complete getNextPage operation: ' . + 'there are no more pages to retrieve.' + ); + } + + $oldRequest = $this->getRequestObject(); + $requestClass = get_class($oldRequest); + $newRequest = new $requestClass(); + $newRequest->mergeFrom($oldRequest); + + $requestPageTokenSetMethod = $this->pageStreamingDescriptor->getRequestPageTokenSetMethod(); + $newRequest->$requestPageTokenSetMethod($this->getNextPageToken()); + + if (isset($pageSize)) { + if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) { + throw new ValidationException( + 'pageSize argument was defined, but the method does not ' . + 'support a page size parameter in the optional array argument' + ); + } + $requestPageSizeSetMethod = $this->pageStreamingDescriptor->getRequestPageSizeSetMethod(); + $newRequest->$requestPageSizeSetMethod($pageSize); + } + $this->call = $this->call->withMessage($newRequest); + + $callable = $this->callable; + $response = $callable( + $this->call, + $this->options + )->wait(); + + return new Page( + $this->call, + $this->options, + $this->callable, + $this->pageStreamingDescriptor, + $response + ); + } + + /** + * Return the number of elements in the response. + * + * @return int + */ + public function getPageElementCount() + { + $resourcesGetMethod = $this->pageStreamingDescriptor->getResourcesGetMethod(); + return count($this->getResponseObject()->$resourcesGetMethod()); + } + + /** + * Return an iterator over the elements in the response. + * + * @return Generator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + $resourcesGetMethod = $this->pageStreamingDescriptor->getResourcesGetMethod(); + $items = $this->getResponseObject()->$resourcesGetMethod(); + foreach ($items as $key => $element) { + if ($items instanceof MapField) { + yield $key => $element; + } else { + yield $element; + } + } + } + + /** + * Return an iterator over Page objects, beginning with this object. + * Additional Page objects are retrieved lazily via API calls until + * all elements have been retrieved. + * + * @return Generator|array + * @throws ValidationException + * @throws ApiException + */ + public function iteratePages() + { + $currentPage = $this; + yield $this; + while ($currentPage->hasNextPage()) { + $currentPage = $currentPage->getNextPage(); + yield $currentPage; + } + } + + /** + * Gets the request object used to generate the Page. + * + * @return mixed|Message + */ + public function getRequestObject() + { + return $this->call->getMessage(); + } + + /** + * Gets the API response object. + * + * @return mixed|Message + */ + public function getResponseObject() + { + return $this->response; + } + + /** + * Returns a collection of elements with a fixed size set by + * the collectionSize parameter. The collection will only contain + * fewer than collectionSize elements if there are no more + * pages to be retrieved from the server. + * + * NOTE: it is an error to call this method if an optional parameter + * to set the page size is not supported or has not been set in the + * API call that was used to create this page. It is also an error + * if the collectionSize parameter is less than the page size that + * has been set. + * + * @param int $collectionSize + * @throws ValidationException if a FixedSizeCollection of the specified size cannot be constructed + * @return FixedSizeCollection + */ + public function expandToFixedSizeCollection($collectionSize) + { + if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) { + throw new ValidationException( + 'FixedSizeCollection is not supported for this method, because ' . + 'the method does not support an optional argument to set the ' . + 'page size.' + ); + } + $request = $this->getRequestObject(); + $pageSizeGetMethod = $this->pageStreamingDescriptor->getRequestPageSizeGetMethod(); + $pageSize = $request->$pageSizeGetMethod(); + if (is_null($pageSize)) { + throw new ValidationException( + 'Error while expanding Page to FixedSizeCollection: No page size ' . + 'parameter found. The page size parameter must be set in the API ' . + 'optional arguments array, and must be less than the collectionSize ' . + 'parameter, in order to create a FixedSizeCollection object.' + ); + } + if ($pageSize > $collectionSize) { + throw new ValidationException( + 'Error while expanding Page to FixedSizeCollection: collectionSize ' . + 'parameter is less than the page size optional argument specified in ' . + "the API call. collectionSize: $collectionSize, page size: $pageSize" + ); + } + return new FixedSizeCollection($this, $collectionSize); + } +} diff --git a/vendor/google/gax/src/PageStreamingDescriptor.php b/vendor/google/gax/src/PageStreamingDescriptor.php new file mode 100644 index 0000000..351eaf7 --- /dev/null +++ b/vendor/google/gax/src/PageStreamingDescriptor.php @@ -0,0 +1,178 @@ +descriptor = $descriptor; + } + + /** + * @param array $fields { + * Required. + * + * @type string $requestPageTokenField the page token field in the request object. + * @type string $responsePageTokenField the page token field in the response object. + * @type string $resourceField the resource field in the response object. + * + * Optional. + * @type string $requestPageSizeField the page size field in the request object. + * } + * @return PageStreamingDescriptor + */ + public static function createFromFields(array $fields) + { + $requestPageToken = $fields['requestPageTokenField']; + $responsePageToken = $fields['responsePageTokenField']; + $resources = $fields['resourceField']; + + $descriptor = [ + 'requestPageTokenGetMethod' => PageStreamingDescriptor::getMethod($requestPageToken), + 'requestPageTokenSetMethod' => PageStreamingDescriptor::setMethod($requestPageToken), + 'responsePageTokenGetMethod' => PageStreamingDescriptor::getMethod($responsePageToken), + 'resourcesGetMethod' => PageStreamingDescriptor::getMethod($resources), + ]; + + if (isset($fields['requestPageSizeField'])) { + $requestPageSize = $fields['requestPageSizeField']; + $descriptor['requestPageSizeGetMethod'] = PageStreamingDescriptor::getMethod($requestPageSize); + $descriptor['requestPageSizeSetMethod'] = PageStreamingDescriptor::setMethod($requestPageSize); + } + + return new PageStreamingDescriptor($descriptor); + } + + private static function getMethod(string $field) + { + return 'get' . ucfirst($field); + } + + private static function setMethod(string $field) + { + return 'set' . ucfirst($field); + } + + /** + * @return string The page token get method on the request object + */ + public function getRequestPageTokenGetMethod() + { + return $this->descriptor['requestPageTokenGetMethod']; + } + + /** + * @return string The page size get method on the request object + */ + public function getRequestPageSizeGetMethod() + { + return $this->descriptor['requestPageSizeGetMethod']; + } + + /** + * @return bool True if the request object has a page size field + */ + public function requestHasPageSizeField() + { + return array_key_exists('requestPageSizeGetMethod', $this->descriptor); + } + + /** + * @return string The page token get method on the response object + */ + public function getResponsePageTokenGetMethod() + { + return $this->descriptor['responsePageTokenGetMethod']; + } + + /** + * @return string The resources get method on the response object + */ + public function getResourcesGetMethod() + { + return $this->descriptor['resourcesGetMethod']; + } + + /** + * @return string The page token set method on the request object + */ + public function getRequestPageTokenSetMethod() + { + return $this->descriptor['requestPageTokenSetMethod']; + } + + /** + * @return string The page size set method on the request object + */ + public function getRequestPageSizeSetMethod() + { + return $this->descriptor['requestPageSizeSetMethod']; + } + + private static function validate(array $descriptor) + { + $requiredFields = [ + 'requestPageTokenGetMethod', + 'requestPageTokenSetMethod', + 'responsePageTokenGetMethod', + 'resourcesGetMethod', + ]; + foreach ($requiredFields as $field) { + if (empty($descriptor[$field])) { + throw new InvalidArgumentException( + "$field is required for PageStreamingDescriptor" + ); + } + } + } +} diff --git a/vendor/google/gax/src/PagedListResponse.php b/vendor/google/gax/src/PagedListResponse.php new file mode 100644 index 0000000..62e6511 --- /dev/null +++ b/vendor/google/gax/src/PagedListResponse.php @@ -0,0 +1,197 @@ +getList(...); + * foreach ($pagedListResponse as $element) { + * // doSomethingWith($element); + * } + * ``` + * + * Example of iterating over each page of elements: + * ``` + * $pagedListResponse = $client->getList(...); + * foreach ($pagedListResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * ``` + * + * Example of accessing the current page, and manually iterating + * over pages: + * ``` + * $pagedListResponse = $client->getList(...); + * $page = $pagedListResponse->getPage(); + * // doSomethingWith($page); + * while ($page->hasNextPage()) { + * $page = $page->getNextPage(); + * // doSomethingWith($page); + * } + * ``` + */ +class PagedListResponse implements IteratorAggregate +{ + private $firstPage; + + /** + * PagedListResponse constructor. + * + * @param Page $firstPage A page containing response details. + */ + public function __construct( + Page $firstPage + ) { + $this->firstPage = $firstPage; + } + + /** + * Returns an iterator over the full list of elements. If the + * API response contains a (non-empty) next page token, then + * the PagedListResponse object will make calls to the underlying + * API to retrieve additional elements as required. + * + * NOTE: The result of this method is the same as getIterator(). + * Prefer using getIterator(), or iterate directly on the + * PagedListResponse object. + * + * @return Generator + * @throws ValidationException + */ + public function iterateAllElements() + { + return $this->getIterator(); + } + + /** + * Returns an iterator over the full list of elements. If the + * API response contains a (non-empty) next page token, then + * the PagedListResponse object will make calls to the underlying + * API to retrieve additional elements as required. + * + * @return Generator + * @throws ValidationException + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + foreach ($this->iteratePages() as $page) { + foreach ($page as $key => $element) { + yield $key => $element; + } + } + } + + /** + * Return the current page of results. + * + * @return Page + */ + public function getPage() + { + return $this->firstPage; + } + + /** + * Returns an iterator over pages of results. The pages are + * retrieved lazily from the underlying API. + * + * @return Page[] + * @throws ValidationException + */ + public function iteratePages() + { + return $this->getPage()->iteratePages(); + } + + /** + * Returns a collection of elements with a fixed size set by + * the collectionSize parameter. The collection will only contain + * fewer than collectionSize elements if there are no more + * pages to be retrieved from the server. + * + * NOTE: it is an error to call this method if an optional parameter + * to set the page size is not supported or has not been set in the + * original API call. It is also an error if the collectionSize parameter + * is less than the page size that has been set. + * + * @param int $collectionSize + * @throws ValidationException if a FixedSizeCollection of the specified size cannot be constructed + * @return FixedSizeCollection + */ + public function expandToFixedSizeCollection(int $collectionSize) + { + return $this->getPage()->expandToFixedSizeCollection($collectionSize); + } + + /** + * Returns an iterator over fixed size collections of results. + * The collections are retrieved lazily from the underlying API. + * + * Each collection will have collectionSize elements, with the + * exception of the final collection which may contain fewer + * elements. + * + * NOTE: it is an error to call this method if an optional parameter + * to set the page size is not supported or has not been set in the + * original API call. It is also an error if the collectionSize parameter + * is less than the page size that has been set. + * + * @param int $collectionSize + * @throws ValidationException if a FixedSizeCollection of the specified size cannot be constructed + * @return Generator|FixedSizeCollection[] + */ + public function iterateFixedSizeCollections(int $collectionSize) + { + return $this->expandToFixedSizeCollection($collectionSize)->iterateCollections(); + } +} diff --git a/vendor/google/gax/src/PathTemplate.php b/vendor/google/gax/src/PathTemplate.php new file mode 100644 index 0000000..4556acf --- /dev/null +++ b/vendor/google/gax/src/PathTemplate.php @@ -0,0 +1,113 @@ +resourceTemplate = new AbsoluteResourceTemplate($path); + } else { + $this->resourceTemplate = new RelativeResourceTemplate($path); + } + } + + /** + * @return string A string representation of the path template + */ + public function __toString() + { + return $this->resourceTemplate->__toString(); + } + + /** + * Renders a path template using the provided bindings. + * + * @param array $bindings An array matching var names to binding strings. + * @throws ValidationException if a key isn't provided or if a sub-template + * can't be parsed. + * @return string A rendered representation of this path template. + */ + public function render(array $bindings) + { + return $this->resourceTemplate->render($bindings); + } + + /** + * Check if $path matches a resource string. + * + * @param string $path A resource string. + * @return bool + */ + public function matches(string $path) + { + return $this->resourceTemplate->matches($path); + } + + /** + * Matches a fully qualified path template string. + * + * @param string $path A fully qualified path template string. + * @throws ValidationException if path can't be matched to the template. + * @return array Array matching var names to binding values. + */ + public function match(string $path) + { + return $this->resourceTemplate->match($path); + } +} diff --git a/vendor/google/gax/src/PollingTrait.php b/vendor/google/gax/src/PollingTrait.php new file mode 100644 index 0000000..526b012 --- /dev/null +++ b/vendor/google/gax/src/PollingTrait.php @@ -0,0 +1,97 @@ + 0.0; + $endTime = $this->getCurrentTimeMillis() + $totalPollTimeoutMillis; + + while (true) { + if ($hasTotalPollTimeout && $this->getCurrentTimeMillis() > $endTime) { + return false; + } + $this->sleepMillis($currentPollDelayMillis); + if ($pollCallable()) { + return true; + } + $currentPollDelayMillis = (int) min([ + $currentPollDelayMillis * $pollDelayMultiplier, + $maxPollDelayMillis + ]); + } + } + + /** + * Protected to allow overriding for tests + * + * @return float Current time in milliseconds + */ + protected function getCurrentTimeMillis() + { + return microtime(true) * 1000.0; + } + + /** + * Protected to allow overriding for tests + * + * @param int $millis + */ + protected function sleepMillis(int $millis) + { + usleep($millis * 1000); + } +} diff --git a/vendor/google/gax/src/RequestBuilder.php b/vendor/google/gax/src/RequestBuilder.php new file mode 100644 index 0000000..b0d589d --- /dev/null +++ b/vendor/google/gax/src/RequestBuilder.php @@ -0,0 +1,290 @@ +baseUri = $baseUri; + $this->restConfig = require($restConfigPath); + } + + /** + * @param string $path + * @return bool + */ + public function pathExists(string $path) + { + list($interface, $method) = explode('/', $path); + return isset($this->restConfig['interfaces'][$interface][$method]); + } + + /** + * @param string $path + * @param Message $message + * @param array $headers + * @return RequestInterface + * @throws ValidationException + */ + public function build(string $path, Message $message, array $headers = []) + { + list($interface, $method) = explode('/', $path); + + if (!isset($this->restConfig['interfaces'][$interface][$method])) { + throw new ValidationException( + "Failed to build request, as the provided path ($path) was not found in the configuration." + ); + } + + $numericEnums = isset($this->restConfig['numericEnums']) && $this->restConfig['numericEnums']; + $methodConfig = $this->restConfig['interfaces'][$interface][$method] + [ + 'placeholders' => [], + 'body' => null, + 'additionalBindings' => null, + ]; + $bindings = $this->buildBindings($methodConfig['placeholders'], $message); + $uriTemplateConfigs = $this->getConfigsForUriTemplates($methodConfig); + + foreach ($uriTemplateConfigs as $config) { + $pathTemplate = $this->tryRenderPathTemplate($config['uriTemplate'], $bindings); + + if ($pathTemplate) { + // We found a valid uriTemplate - now build and return the Request + + list($body, $queryParams) = $this->constructBodyAndQueryParameters($message, $config); + + // Request enum fields will be encoded as numbers rather than strings (in the response). + if ($numericEnums) { + $queryParams['$alt'] = 'json;enum-encoding=int'; + } + + $uri = $this->buildUri($pathTemplate, $queryParams); + + return new Request( + $config['method'], + $uri, + ['Content-Type' => 'application/json'] + $headers, + $body + ); + } + } + + // No valid uriTemplate found - construct an exception + $uriTemplates = []; + foreach ($uriTemplateConfigs as $config) { + $uriTemplates[] = $config['uriTemplate']; + } + + throw new ValidationException("Could not map bindings for $path to any Uri template.\n" . + 'Bindings: ' . print_r($bindings, true) . + 'UriTemplates: ' . print_r($uriTemplates, true)); + } + + /** + * Create a list of all possible configs using the additionalBindings + * + * @param array $config + * @return array[] An array of configs + */ + private function getConfigsForUriTemplates(array $config) + { + $configs = [$config]; + + if ($config['additionalBindings']) { + foreach ($config['additionalBindings'] as $additionalBinding) { + $configs[] = $additionalBinding + $config; + } + } + + return $configs; + } + + /** + * @param Message $message + * @param array $config + * @return array Tuple [$body, $queryParams] + */ + private function constructBodyAndQueryParameters(Message $message, array $config) + { + $messageDataJson = $message->serializeToJsonString(); + + if ($config['body'] === '*') { + return [$messageDataJson, []]; + } + + $body = null; + $queryParams = []; + $messageData = json_decode($messageDataJson, true); + foreach ($messageData as $name => $value) { + if (array_key_exists($name, $config['placeholders'])) { + continue; + } + + if (Serializer::toSnakeCase($name) === $config['body']) { + if (($bodyMessage = $message->{"get$name"}()) instanceof Message) { + $body = $bodyMessage->serializeToJsonString(); + } else { + $body = json_encode($value); + } + continue; + } + + if (is_array($value) && $this->isAssoc($value)) { + foreach ($value as $key => $value2) { + $queryParams[$name . '.' . $key] = $value2; + } + } else { + $queryParams[$name] = $value; + } + } + + // Ensures required query params with default values are always sent + // over the wire. + if (isset($config['queryParams'])) { + foreach ($config['queryParams'] as $requiredQueryParam) { + $requiredQueryParam = Serializer::toCamelCase($requiredQueryParam); + if (!array_key_exists($requiredQueryParam, $queryParams)) { + $getter = Serializer::getGetter($requiredQueryParam); + $queryParamValue = $message->$getter(); + if ($queryParamValue instanceof Message) { + // Decode message for the query parameter. + $queryParamValue = json_decode($queryParamValue->serializeToJsonString(), true); + } + if (is_array($queryParamValue)) { + // If the message has properties, add them as nested querystring values. + // NOTE: This only supports nesting at one level of depth. + foreach ($queryParamValue as $key => $value) { + $queryParams[$requiredQueryParam . '.' . $key] = $value; + } + } else { + $queryParams[$requiredQueryParam] = $queryParamValue; + } + } + } + } + + return [$body, $queryParams]; + } + + /** + * @param array $placeholders + * @param Message $message + * @return array Bindings from path template fields to values from message + */ + private function buildBindings(array $placeholders, Message $message) + { + $bindings = []; + foreach ($placeholders as $placeholder => $metadata) { + $value = array_reduce( + $metadata['getters'], + function (?Message $result = null, $getter = null) { + if ($result && $getter) { + return $result->$getter(); + } + }, + $message + ); + + $bindings[$placeholder] = $value; + } + return $bindings; + } + + /** + * Try to render the resource name. The rendered resource name will always contain a leading '/' + * + * @param string $uriTemplate + * @param array $bindings + * @return null|string + * @throws ValidationException + */ + private function tryRenderPathTemplate(string $uriTemplate, array $bindings) + { + $template = new AbsoluteResourceTemplate($uriTemplate); + + try { + return $template->render($bindings); + } catch (ValidationException $e) { + return null; + } + } + + /** + * @param string $path + * @param array $queryParams + * @return UriInterface + */ + protected function buildUri(string $path, array $queryParams) + { + $uri = Utils::uriFor( + sprintf( + 'https://%s%s', + $this->baseUri, + $path + ) + ); + if ($queryParams) { + $uri = $this->buildUriWithQuery( + $uri, + $queryParams + ); + } + return $uri; + } +} diff --git a/vendor/google/gax/src/RequestParamsHeaderDescriptor.php b/vendor/google/gax/src/RequestParamsHeaderDescriptor.php new file mode 100644 index 0000000..73e9af3 --- /dev/null +++ b/vendor/google/gax/src/RequestParamsHeaderDescriptor.php @@ -0,0 +1,78 @@ + value]. + */ + public function __construct(array $requestParams) + { + $headerKey = self::HEADER_KEY; + + $headerValue = ''; + foreach ($requestParams as $key => $value) { + if ('' !== $headerValue) { + $headerValue .= '&'; + } + + $headerValue .= $key . '=' . urlencode(strval($value)); + } + + $this->header = [$headerKey => [$headerValue]]; + } + + /** + * Returns an associative array that contains request params header metadata. + * + * @return array + */ + public function getHeader() + { + return $this->header; + } +} diff --git a/vendor/google/gax/src/ResourceHelperTrait.php b/vendor/google/gax/src/ResourceHelperTrait.php new file mode 100644 index 0000000..7f16841 --- /dev/null +++ b/vendor/google/gax/src/ResourceHelperTrait.php @@ -0,0 +1,108 @@ + $template) { + self::$templateMap[$name] = new PathTemplate($template); + } + } + + private static function getPathTemplate(string $key) + { + // TODO: Add nullable return type reference once PHP 7.1 is minimum. + if (is_null(self::$templateMap)) { + self::registerPathTemplates(); + } + return self::$templateMap[$key] ?? null; + } + + private static function parseFormattedName(string $formattedName, ?string $template = null): array + { + if (is_null(self::$templateMap)) { + self::registerPathTemplates(); + } + if ($template) { + if (!isset(self::$templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return self::$templateMap[$template]->match($formattedName); + } + + foreach (self::$templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } +} diff --git a/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php b/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php new file mode 100644 index 0000000..e6cb492 --- /dev/null +++ b/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php @@ -0,0 +1,146 @@ +"). + * + * Examples: + * /projects + * /projects/{project} + * /foo/{bar=**}/fizz/*:action + * + * Templates use the syntax of the API platform; see + * https://github.com/googleapis/api-common-protos/blob/master/google/api/http.proto + * for details. A template consists of a sequence of literals, wildcards, and variable bindings, + * where each binding can have a sub-path. A string representation can be parsed into an + * instance of AbsoluteResourceTemplate, which can then be used to perform matching and instantiation. + * + * @internal + */ +class AbsoluteResourceTemplate implements ResourceTemplateInterface +{ + private RelativeResourceTemplate $resourceTemplate; + /** @var string|bool */ + private $verb; + + /** + * AbsoluteResourceTemplate constructor. + * @param string $path + * @throws ValidationException + */ + public function __construct(string $path) + { + if (empty($path)) { + throw new ValidationException('Cannot construct AbsoluteResourceTemplate from empty string'); + } + if ($path[0] !== '/') { + throw new ValidationException( + "Could not construct AbsoluteResourceTemplate from '$path': must begin with '/'" + ); + } + $verbSeparatorPos = $this->verbSeparatorPos($path); + $this->resourceTemplate = new RelativeResourceTemplate(substr($path, 1, $verbSeparatorPos - 1)); + $this->verb = substr($path, $verbSeparatorPos + 1); + } + + /** + * @inheritdoc + */ + public function __toString() + { + return sprintf('/%s%s', $this->resourceTemplate, $this->renderVerb()); + } + + /** + * @inheritdoc + */ + public function render(array $bindings) + { + return sprintf('/%s%s', $this->resourceTemplate->render($bindings), $this->renderVerb()); + } + + /** + * @inheritdoc + */ + public function matches(string $path) + { + try { + $this->match($path); + return true; + } catch (ValidationException $ex) { + return false; + } + } + + /** + * @inheritdoc + */ + public function match(string $path) + { + if (empty($path)) { + throw $this->matchException($path, 'path cannot be empty'); + } + if ($path[0] !== '/') { + throw $this->matchException($path, "missing leading '/'"); + } + $verbSeparatorPos = $this->verbSeparatorPos($path); + if (substr($path, $verbSeparatorPos + 1) !== $this->verb) { + throw $this->matchException($path, "trailing verb did not match '{$this->verb}'"); + } + return $this->resourceTemplate->match(substr($path, 1, $verbSeparatorPos - 1)); + } + + private function matchException(string $path, string $reason) + { + return new ValidationException("Could not match path '$path' to template '$this': $reason"); + } + + private function renderVerb() + { + return $this->verb ? ':' . $this->verb : ''; + } + + private function verbSeparatorPos(string $path) + { + $finalSeparatorPos = strrpos($path, '/'); + $verbSeparatorPos = strrpos($path, ':', $finalSeparatorPos); + if ($verbSeparatorPos === false) { + $verbSeparatorPos = strlen($path); + } + return $verbSeparatorPos; + } +} diff --git a/vendor/google/gax/src/ResourceTemplate/Parser.php b/vendor/google/gax/src/ResourceTemplate/Parser.php new file mode 100644 index 0000000..2bc70ad --- /dev/null +++ b/vendor/google/gax/src/ResourceTemplate/Parser.php @@ -0,0 +1,227 @@ += strlen($path)) { + // A trailing '/' has caused the index to exceed the bounds + // of the string - provide a helpful error message. + throw self::parseError($path, strlen($path) - 1, "invalid trailing '/'"); + } + if ($path[$index] === '{') { + // Validate that the { has a matching } + $closingBraceIndex = strpos($path, '}', $index); + if ($closingBraceIndex === false) { + throw self::parseError( + $path, + strlen($path), + "Expected '}' to match '{' at index $index, got end of string" + ); + } + + $segmentStringLengthWithoutBraces = $closingBraceIndex - $index - 1; + $segmentStringWithoutBraces = substr($path, $index + 1, $segmentStringLengthWithoutBraces); + $index = $closingBraceIndex + 1; + + $nextLiteral = '/'; + $remainingPath = substr($path, $index); + if (!empty($remainingPath)) { + // Find the firstnon-slash separator seen, if any. + $nextSlashIndex = strpos($remainingPath, '/', 0); + $nonSlashSeparators = ['-', '_', '~', '.']; + foreach ($nonSlashSeparators as $nonSlashSeparator) { + $nonSlashSeparatorIndex = strpos($remainingPath, $nonSlashSeparator, 0); + $nextOpenBraceIndex = strpos($remainingPath, '{', 0); + if ($nonSlashSeparatorIndex !== false && $nonSlashSeparatorIndex === $nextOpenBraceIndex - 1) { + $index += $nonSlashSeparatorIndex; + $nextLiteral = $nonSlashSeparator; + break; + } + } + } + + return self::parseVariableSegment($segmentStringWithoutBraces, $nextLiteral); + } else { + $nextSlash = strpos($path, '/', $index); + if ($nextSlash === false) { + $nextSlash = strlen($path); + } + $segmentString = substr($path, $index, $nextSlash - $index); + $nextLiteral = '/'; + $index = $nextSlash; + return self::parse($segmentString, $path, $index); + } + } + + /** + * @param string $segmentString + * @param string $path + * @param int $index + * @return Segment + * @throws ValidationException + */ + private static function parse(string $segmentString, string $path, int $index) + { + if ($segmentString === '*') { + return new Segment(Segment::WILDCARD_SEGMENT); + } elseif ($segmentString === '**') { + return new Segment(Segment::DOUBLE_WILDCARD_SEGMENT); + } else { + if (!self::isValidLiteral($segmentString)) { + if (empty($segmentString)) { + // Create user friendly message in case of empty segment + throw self::parseError($path, $index, "Unexpected empty segment (consecutive '/'s are invalid)"); + } else { + throw self::parseError($path, $index, "Unexpected characters in literal segment $segmentString"); + } + } + return new Segment(Segment::LITERAL_SEGMENT, $segmentString); + } + } + + /** + * @param string $segmentStringWithoutBraces + * @param string $separatorLiteral + * @return Segment + * @throws ValidationException + */ + private static function parseVariableSegment(string $segmentStringWithoutBraces, string $separatorLiteral) + { + // Validate there are no nested braces + $nestedOpenBracket = strpos($segmentStringWithoutBraces, '{'); + if ($nestedOpenBracket !== false) { + throw new ValidationException( + "Unexpected '{' parsing segment $segmentStringWithoutBraces at index $nestedOpenBracket" + ); + } + + $equalsIndex = strpos($segmentStringWithoutBraces, '='); + if ($equalsIndex === false) { + // If the variable does not contain '=', we assume the pattern is '*' as per google.rpc.Http + $variableKey = $segmentStringWithoutBraces; + $nestedResource = new RelativeResourceTemplate('*'); + } else { + $variableKey = substr($segmentStringWithoutBraces, 0, $equalsIndex); + $nestedResourceString = substr($segmentStringWithoutBraces, $equalsIndex + 1); + $nestedResource = new RelativeResourceTemplate($nestedResourceString); + } + + if (!self::isValidLiteral($variableKey)) { + throw new ValidationException( + "Unexpected characters in variable name $variableKey" + ); + } + return new Segment(Segment::VARIABLE_SEGMENT, null, $variableKey, $nestedResource, $separatorLiteral); + } + + /** + * @param string $literal + * @param string $path + * @param int $index + * @return string + * @throws ValidationException + */ + private static function parseLiteralFromPath(string $literal, string $path, int &$index) + { + $literalLength = strlen($literal); + if (strlen($path) < ($index + $literalLength)) { + throw self::parseError($path, $index, "expected '$literal'"); + } + $consumedLiteral = substr($path, $index, $literalLength); + if ($consumedLiteral !== $literal) { + throw self::parseError($path, $index, "expected '$literal'"); + } + $index += $literalLength; + return $consumedLiteral; + } + + private static function parseError(string $path, int $index, string $reason) + { + return new ValidationException("Error parsing '$path' at index $index: $reason"); + } + + /** + * Check if $literal is a valid segment literal. Segment literals may only contain numbers, + * letters, and any of the following: .-~_ + * + * @param string $literal + * @return bool + */ + private static function isValidLiteral(string $literal) + { + return preg_match('/^[0-9a-zA-Z\\.\\-~_]+$/', $literal) === 1; + } +} diff --git a/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php b/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php new file mode 100644 index 0000000..9415088 --- /dev/null +++ b/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php @@ -0,0 +1,390 @@ +"). + * + * Examples: + * projects + * projects/{project} + * foo/{bar=**}/fizz/* + * + * Templates use the syntax of the API platform; see + * https://github.com/googleapis/api-common-protos/blob/master/google/api/http.proto + * for details. A template consists of a sequence of literals, wildcards, and variable bindings, + * where each binding can have a sub-path. A string representation can be parsed into an + * instance of AbsoluteResourceTemplate, which can then be used to perform matching and instantiation. + * + * @internal + */ +class RelativeResourceTemplate implements ResourceTemplateInterface +{ + /** @var Segment[] */ + private array $segments; + + /** + * RelativeResourceTemplate constructor. + * + * @param string $path + * @throws ValidationException + */ + public function __construct(string $path) + { + if (empty($path)) { + throw new ValidationException('Cannot construct RelativeResourceTemplate from empty string'); + } + $this->segments = Parser::parseSegments($path); + + $doubleWildcardCount = self::countDoubleWildcards($this->segments); + if ($doubleWildcardCount > 1) { + throw new ValidationException( + "Cannot parse '$path': cannot contain more than one path wildcard" + ); + } + + // Check for duplicate keys + $keys = []; + foreach ($this->segments as $segment) { + if ($segment->getSegmentType() === Segment::VARIABLE_SEGMENT) { + if (isset($keys[$segment->getKey()])) { + throw new ValidationException( + "Duplicate key '{$segment->getKey()}' in path $path" + ); + } + $keys[$segment->getKey()] = true; + } + } + } + + /** + * @inheritdoc + */ + public function __toString() + { + return self::renderSegments($this->segments); + } + + /** + * @inheritdoc + */ + public function render(array $bindings) + { + $literalSegments = []; + $keySegmentTuples = self::buildKeySegmentTuples($this->segments); + foreach ($keySegmentTuples as list($key, $segment)) { + /** @var Segment $segment */ + if ($segment->getSegmentType() === Segment::LITERAL_SEGMENT) { + $literalSegments[] = $segment; + continue; + } + if (!array_key_exists($key, $bindings)) { + throw $this->renderingException($bindings, "missing required binding '$key' for segment '$segment'"); + } + $value = $bindings[$key]; + if (!is_null($value) && $segment->matches($value)) { + $literalSegments[] = new Segment( + Segment::LITERAL_SEGMENT, + $value, + $segment->getValue(), + $segment->getTemplate(), + $segment->getSeparator() + ); + } else { + $valueString = is_null($value) ? 'null' : "'$value'"; + throw $this->renderingException( + $bindings, + "expected binding '$key' to match segment '$segment', instead got $valueString" + ); + } + } + return self::renderSegments($literalSegments); + } + + /** + * @inheritdoc + */ + public function matches(string $path) + { + try { + $this->match($path); + return true; + } catch (ValidationException $ex) { + return false; + } + } + + /** + * @inheritdoc + */ + public function match(string $path) + { + // High level strategy for matching: + // - Build a list of Segments from our template, where any variable segments are + // flattened into a single, non-nested list + // - Break $path into pieces based on '/'. + // - Use the segments to further subdivide the pieces using any applicable non-slash separators. + // - Match pieces of the path with Segments in the flattened list + + // In order to build correct bindings after we match the $path against our template, we + // need to (a) calculate the correct positional keys for our wildcards, and (b) maintain + // information about the variable identifier of any flattened segments. To do this, we + // build a list of [string, Segment] tuples, where the string component is the appropriate + // key. + $keySegmentTuples = self::buildKeySegmentTuples($this->segments); + + $flattenedKeySegmentTuples = self::flattenKeySegmentTuples($keySegmentTuples); + $flattenedKeySegmentTuplesCount = count($flattenedKeySegmentTuples); + assert($flattenedKeySegmentTuplesCount > 0); + + $slashPathPieces = explode('/', $path); + $pathPieces = []; + $pathPiecesIndex = 0; + $startIndex = 0; + $slashPathPiecesCount = count($slashPathPieces); + $doubleWildcardPieceCount = $slashPathPiecesCount - $flattenedKeySegmentTuplesCount + 1; + + for ($i = 0; $i < count($flattenedKeySegmentTuples); $i++) { + $segmentKey = $flattenedKeySegmentTuples[$i][0]; + $segment = $flattenedKeySegmentTuples[$i][1]; + // In our flattened list of segments, we should never encounter a variable segment + assert($segment->getSegmentType() !== Segment::VARIABLE_SEGMENT); + + if ($segment->getSegmentType() == Segment::DOUBLE_WILDCARD_SEGMENT) { + $pathPiecesForSegment = array_slice($slashPathPieces, $pathPiecesIndex, $doubleWildcardPieceCount); + $pathPiece = implode('/', $pathPiecesForSegment); + $pathPiecesIndex += $doubleWildcardPieceCount; + $pathPieces[] = $pathPiece; + continue; + } + + if ($segment->getSegmentType() == Segment::WILDCARD_SEGMENT) { + if ($pathPiecesIndex >= $slashPathPiecesCount) { + break; + } + } + if ($segment->getSeparator() === '/') { + if ($pathPiecesIndex >= $slashPathPiecesCount) { + throw $this->matchException($path, 'segment and path length mismatch'); + } + $pathPiece = substr($slashPathPieces[$pathPiecesIndex++], $startIndex); + $startIndex = 0; + } else { + $rawPiece = substr($slashPathPieces[$pathPiecesIndex], $startIndex); + $pathPieceLength = strpos($rawPiece, $segment->getSeparator()); + $pathPiece = substr($rawPiece, 0, $pathPieceLength); + $startIndex += $pathPieceLength + 1; + } + $pathPieces[] = $pathPiece; + } + + if ($flattenedKeySegmentTuples[$i - 1][1]->getSegmentType() !== Segment::DOUBLE_WILDCARD_SEGMENT) { + // Process any remaining pieces. The binding logic will throw exceptions for any invalid paths. + for (; $pathPiecesIndex < count($slashPathPieces); $pathPiecesIndex++) { + $pathPieces[] = $slashPathPieces[$pathPiecesIndex]; + } + } + $pathPiecesCount = count($pathPieces); + + // We would like to match pieces of our path 1:1 with the segments of our template. However, + // this is confounded by the presence of double wildcards ('**') in the template, which can + // match multiple segments in the path. + // Because there can only be one '**' present, we can determine how many segments it must + // match by examining the difference in count between the template segments and the + // path pieces. + + if ($pathPiecesCount < $flattenedKeySegmentTuplesCount) { + // Each segment in $flattenedKeyedSegments must consume at least one + // segment in $pathSegments, so matching must fail. + throw $this->matchException($path, 'path does not contain enough segments to be matched'); + } + + $doubleWildcardPieceCount = $pathPiecesCount - $flattenedKeySegmentTuplesCount + 1; + + $bindings = []; + $pathPiecesIndex = 0; + /** @var Segment $segment */ + foreach ($flattenedKeySegmentTuples as list($segmentKey, $segment)) { + $pathPiece = $pathPieces[$pathPiecesIndex++]; + if (!$segment->matches($pathPiece)) { + throw $this->matchException($path, "expected path element matching '$segment', got '$pathPiece'"); + } + + // If we have a valid key, add our $pathPiece to the $bindings array. Note that there + // may be multiple copies of the same $segmentKey. This is because a flattened variable + // segment can match multiple pieces from the path. We can add these to an array and + // collapse them all once the bindings are complete. + if (isset($segmentKey)) { + $bindings += [$segmentKey => []]; + $bindings[$segmentKey][] = $pathPiece; + } + } + + // It is possible that we have left over path pieces, which can occur if our template does + // not have a double wildcard. In that case, the match should fail. + if ($pathPiecesIndex !== $pathPiecesCount) { + throw $this->matchException($path, "expected end of path, got '$pathPieces[$pathPiecesIndex]'"); + } + + // Collapse the bindings from lists into strings + $collapsedBindings = []; + foreach ($bindings as $key => $boundPieces) { + $collapsedBindings[$key] = implode('/', $boundPieces); + } + + return $collapsedBindings; + } + + private function matchException(string $path, string $reason) + { + return new ValidationException("Could not match path '$path' to template '$this': $reason"); + } + + private function renderingException(array $bindings, string $reason) + { + $bindingsString = print_r($bindings, true); + return new ValidationException( + "Error rendering '$this': $reason\n" . + "Provided bindings: $bindingsString" + ); + } + + /** + * @param Segment[] $segments + * @param string|null $separator An optional string separator + * @return array[] A list of [string, Segment] tuples + */ + private static function buildKeySegmentTuples(array $segments, ?string $separator = null) + { + $keySegmentTuples = []; + $positionalArgumentCounter = 0; + foreach ($segments as $segment) { + switch ($segment->getSegmentType()) { + case Segment::WILDCARD_SEGMENT: + case Segment::DOUBLE_WILDCARD_SEGMENT: + $positionalKey = "\$$positionalArgumentCounter"; + $positionalArgumentCounter++; + $newSegment = $segment; + if ($separator !== null) { + $newSegment = new Segment( + $segment->getSegmentType(), + $segment->getValue(), + $segment->getKey(), + $segment->getTemplate(), + $separator + ); + } + $keySegmentTuples[] = [$positionalKey, $newSegment]; + break; + default: + $keySegmentTuples[] = [$segment->getKey(), $segment]; + } + } + return $keySegmentTuples; + } + + /** + * @param array[] $keySegmentTuples A list of [string, Segment] tuples + * @return array[] A list of [string, Segment] tuples + */ + private static function flattenKeySegmentTuples(array $keySegmentTuples) + { + $flattenedKeySegmentTuples = []; + foreach ($keySegmentTuples as list($key, $segment)) { + /** @var Segment $segment */ + switch ($segment->getSegmentType()) { + case Segment::VARIABLE_SEGMENT: + // For segment variables, replace the segment with the segments of its children + $template = $segment->getTemplate(); + $nestedKeySegmentTuples = self::buildKeySegmentTuples( + $template->segments, + $segment->getSeparator() + ); + foreach ($nestedKeySegmentTuples as list($nestedKey, $nestedSegment)) { + /** @var Segment $nestedSegment */ + // Nested variables are not allowed + assert($nestedSegment->getSegmentType() !== Segment::VARIABLE_SEGMENT); + // Insert the nested segment with key set to the outer key of the + // parent variable segment + $flattenedKeySegmentTuples[] = [$key, $nestedSegment]; + } + break; + default: + // For all other segments, don't change the key or segment + $flattenedKeySegmentTuples[] = [$key, $segment]; + } + } + return $flattenedKeySegmentTuples; + } + + /** + * @param Segment[] $segments + * @return int + */ + private static function countDoubleWildcards(array $segments) + { + $doubleWildcardCount = 0; + foreach ($segments as $segment) { + switch ($segment->getSegmentType()) { + case Segment::DOUBLE_WILDCARD_SEGMENT: + $doubleWildcardCount++; + break; + case Segment::VARIABLE_SEGMENT: + $doubleWildcardCount += self::countDoubleWildcards($segment->getTemplate()->segments); + break; + } + } + return $doubleWildcardCount; + } + + /** + * Joins segments using their separators. + * @param array $segmentsToRender + * @return string + */ + private static function renderSegments(array $segmentsToRender) + { + $renderResult = ''; + for ($i = 0; $i < count($segmentsToRender); $i++) { + $segment = $segmentsToRender[$i]; + $renderResult .= $segment; + if ($i < count($segmentsToRender) - 1) { + $renderResult .= $segment->getSeparator(); + } + } + return $renderResult; + } +} diff --git a/vendor/google/gax/src/ResourceTemplate/ResourceTemplateInterface.php b/vendor/google/gax/src/ResourceTemplate/ResourceTemplateInterface.php new file mode 100644 index 0000000..ffa3c81 --- /dev/null +++ b/vendor/google/gax/src/ResourceTemplate/ResourceTemplateInterface.php @@ -0,0 +1,91 @@ +"). (Note that a trailing verb without a + * leading slash is not permitted). + * + * Examples: + * projects + * /projects + * foo/{bar=**}/fizz/* + * /foo/{bar=**}/fizz/*:action + * + * Templates use the syntax of the API platform; see + * https://github.com/googleapis/api-common-protos/blob/master/google/api/http.proto + * for details. A template consists of a sequence of literals, wildcards, and variable bindings, + * where each binding can have a sub-path. A string representation can be parsed into an + * instance of AbsoluteResourceTemplate, which can then be used to perform matching and instantiation. + * + * @internal + */ +interface ResourceTemplateInterface +{ + /** + * @return string A string representation of the resource template + */ + public function __toString(); + + /** + * Renders a resource template using the provided bindings. + * + * @param array $bindings An array matching var names to binding strings. + * @return string A rendered representation of this resource template. + * @throws ValidationException If $bindings does not contain all required keys + * or if a sub-template can't be parsed. + */ + public function render(array $bindings); + + /** + * Check if $path matches a resource string. + * + * @param string $path A resource string. + * @return bool + */ + public function matches(string $path); + + /** + * Matches a given $path to a resource template, and returns an array of bindings between + * wildcards / variables in the template and values in the path. If $path does not match the + * template, then a ValidationException is thrown. + * + * @param string $path A resource string. + * @throws ValidationException if path can't be matched to the template. + * @return array Array matching var names to binding values. + */ + public function match(string $path); +} diff --git a/vendor/google/gax/src/ResourceTemplate/Segment.php b/vendor/google/gax/src/ResourceTemplate/Segment.php new file mode 100644 index 0000000..fb9dc6d --- /dev/null +++ b/vendor/google/gax/src/ResourceTemplate/Segment.php @@ -0,0 +1,195 @@ +segmentType = $segmentType; + $this->value = $value; + $this->key = $key; + $this->template = $template; + $this->separator = $separator; + + switch ($this->segmentType) { + case Segment::LITERAL_SEGMENT: + $this->stringRepr = "{$this->value}"; + break; + case Segment::WILDCARD_SEGMENT: + $this->stringRepr = '*'; + break; + case Segment::DOUBLE_WILDCARD_SEGMENT: + $this->stringRepr = '**'; + break; + case Segment::VARIABLE_SEGMENT: + $this->stringRepr = "{{$this->key}={$this->template}}"; + break; + default: + throw new ValidationException( + "Unexpected Segment type: {$this->segmentType}" + ); + } + } + + /** + * @return string A string representation of the segment. + */ + public function __toString() + { + return $this->stringRepr; + } + + /** + * Checks if $value matches this Segment. + * + * @param string $value + * @return bool + * @throws ValidationException + */ + public function matches(string $value) + { + switch ($this->segmentType) { + case Segment::LITERAL_SEGMENT: + return $this->value === $value; + case Segment::WILDCARD_SEGMENT: + return self::isValidBinding($value); + case Segment::DOUBLE_WILDCARD_SEGMENT: + return self::isValidDoubleWildcardBinding($value); + case Segment::VARIABLE_SEGMENT: + return $this->template->matches($value); + default: + throw new ValidationException( + "Unexpected Segment type: {$this->segmentType}" + ); + } + } + + /** + * @return int + */ + public function getSegmentType() + { + return $this->segmentType; + } + + /** + * @return string|null + */ + public function getKey() + { + return $this->key; + } + + /** + * @return string|null + */ + public function getValue() + { + return $this->value; + } + + /** + * @return RelativeResourceTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + /** + * @return string + */ + public function getSeparator() + { + return $this->separator; + } + + /** + * Check if $binding is a valid segment binding. Segment bindings may contain any characters + * except a forward slash ('/'), and may not be empty. + * + * @param string $binding + * @return bool + */ + private static function isValidBinding(string $binding) + { + return preg_match('-^[^/]+$-', $binding) === 1; + } + + /** + * Check if $binding is a valid double wildcard binding. Segment bindings may contain any + * characters, but may not be empty. + * + * @param string $binding + * @return bool + */ + private static function isValidDoubleWildcardBinding(string $binding) + { + return preg_match('-^.+$-', $binding) === 1; + } +} diff --git a/vendor/google/gax/src/RetrySettings.php b/vendor/google/gax/src/RetrySettings.php new file mode 100644 index 0000000..0ca1288 --- /dev/null +++ b/vendor/google/gax/src/RetrySettings.php @@ -0,0 +1,547 @@ + 100, + * 'retryDelayMultiplier' => 1.3, + * 'maxRetryDelayMillis' => 60000, + * 'initialRpcTimeoutMillis' => 20000, + * 'rpcTimeoutMultiplier' => 1.0, + * 'maxRpcTimeoutMillis' => 20000, + * 'totalTimeoutMillis' => 600000, + * 'retryableCodes' => [ApiStatus::DEADLINE_EXCEEDED, ApiStatus::UNAVAILABLE], + * ]); + * ``` + * + * It is also possible to create a new RetrySettings object from an existing + * object using the {@see \Google\ApiCore\RetrySettings::with()} method. + * + * Example modifying an existing RetrySettings object using `with()`: + * ``` + * $newRetrySettings = $retrySettings->with([ + * 'totalTimeoutMillis' => 700000, + * ]); + * ``` + * + * Modifying the retry behavior of an RPC method + * --------------------------------------------- + * + * RetrySettings objects can be used to control retries for many RPC methods in + * [google-cloud-php](https://github.com/googleapis/google-cloud-php). + * The examples below make use of the + * [GroupServiceClient](https://cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Client.GroupServiceClient) + * from the [Monitoring V3 API](https://github.com/googleapis/google-cloud-php/tree/master/src/Monitoring/V3), + * but they can be applied to other APIs in the + * [google-cloud-php](https://github.com/googleapis/google-cloud-php) repository. + * + * It is possible to specify the retry behavior to be used by an RPC via the + * `retrySettings` field in the `optionalArgs` parameter. The `retrySettings` + * field can contain either a RetrySettings object, or a PHP array containing + * the particular retry parameters to be updated. + * + * Example of disabling retries for a single call to the + * [listGroups](https://cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Client.GroupServiceClient#_Google_Cloud_Monitoring_V3_Client_GroupServiceClient__listGroups__) + * method, and setting a custom timeout: + * ``` + * $result = $client->listGroups($name, [ + * 'retrySettings' => [ + * 'retriesEnabled' => false, + * 'noRetriesRpcTimeoutMillis' => 5000, + * ] + * ]); + * ``` + * + * Example of creating a new RetrySettings object and using it to override + * the retry settings for a call to the + * [listGroups](https://cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Client.GroupServiceClient#_Google_Cloud_Monitoring_V3_Client_GroupServiceClient__listGroups__) + * method: + * ``` + * $customRetrySettings = new RetrySettings([ + * 'initialRetryDelayMillis' => 100, + * 'retryDelayMultiplier' => 1.3, + * 'maxRetryDelayMillis' => 60000, + * 'initialRpcTimeoutMillis' => 20000, + * 'rpcTimeoutMultiplier' => 1.0, + * 'maxRpcTimeoutMillis' => 20000, + * 'totalTimeoutMillis' => 600000, + * 'retryableCodes' => [ApiStatus::DEADLINE_EXCEEDED, ApiStatus::UNAVAILABLE], + * ]); + * + * $result = $client->listGroups($name, [ + * 'retrySettings' => $customRetrySettings + * ]); + * ``` + * + * Modifying the default retry behavior for RPC methods on a Client object + * ----------------------------------------------------------------------- + * + * It is also possible to specify the retry behavior for RPC methods when + * constructing a client object using the 'retrySettingsArray'. The examples + * below again make use of the + * [GroupServiceClient](https://cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Client.GroupServiceClient) + * from the [Monitoring V3 API](https://github.com/googleapis/google-cloud-php/tree/main/Monitoring/src/V3), + * but they can be applied to other APIs in the + * [google-cloud-php](https://github.com/googleapis/google-cloud-php) repository. + * + * The GroupServiceClient object accepts an optional `retrySettingsArray` + * parameter, which can be used to specify retry behavior for RPC methods + * on the client. The `retrySettingsArray` accepts a PHP array in which keys + * are the names of RPC methods on the client, and values are either a + * RetrySettings object or a PHP array containing the particular retry + * parameters to be updated. + * + * Example updating the retry settings for four methods of GroupServiceClient: + * ``` + * use Google\Cloud\Monitoring\V3\GroupServiceClient; + * + * $customRetrySettings = new RetrySettings([ + * 'initialRetryDelayMillis' => 100, + * 'retryDelayMultiplier' => 1.3, + * 'maxRetryDelayMillis' => 60000, + * 'initialRpcTimeoutMillis' => 20000, + * 'rpcTimeoutMultiplier' => 1.0, + * 'maxRpcTimeoutMillis' => 20000, + * 'totalTimeoutMillis' => 600000, + * 'retryableCodes' => [ApiStatus::DEADLINE_EXCEEDED, ApiStatus::UNAVAILABLE], + * ]); + * + * $updatedCustomRetrySettings = $customRetrySettings->with([ + * 'totalTimeoutMillis' => 700000 + * ]); + * + * $client = new GroupServiceClient([ + * 'retrySettingsArray' => [ + * 'listGroups' => ['retriesEnabled' => false], + * 'getGroup' => [ + * 'initialRpcTimeoutMillis' => 10000, + * 'maxRpcTimeoutMillis' => 30000, + * 'totalTimeoutMillis' => 60000, + * ], + * 'deleteGroup' => $customRetrySettings, + * 'updateGroup' => $updatedCustomRetrySettings + * ], + * ]); + * ``` + * + * Configure the use of logical timeout + * ------------------------------------ + * + * To configure the use of a logical timeout, where a logical timeout is the + * duration a method is given to complete one or more RPC attempts, with each + * attempt using only the time remaining in the logical timeout, use + * {@see \Google\ApiCore\RetrySettings::logicalTimeout()} combined with + * {@see \Google\ApiCore\RetrySettings::with()}. + * + * ``` + * $timeoutSettings = RetrySettings::logicalTimeout(30000); + * + * $customRetrySettings = $customRetrySettings->with($timeoutSettings); + * + * $result = $client->listGroups($name, [ + * 'retrySettings' => $customRetrySettings + * ]); + * ``` + * + * {@see \Google\ApiCore\RetrySettings::logicalTimeout()} can also be used on a + * method call independent of a RetrySettings instance. + * + * ``` + * $timeoutSettings = RetrySettings::logicalTimeout(30000); + * + * $result = $client->listGroups($name, [ + * 'retrySettings' => $timeoutSettings + * ]); + * ``` + */ +class RetrySettings +{ + use ValidationTrait; + + const DEFAULT_MAX_RETRIES = 0; + + private $retriesEnabled; + + private $retryableCodes; + + private $initialRetryDelayMillis; + private $retryDelayMultiplier; + private $maxRetryDelayMillis; + private $initialRpcTimeoutMillis; + private $rpcTimeoutMultiplier; + private $maxRpcTimeoutMillis; + private $totalTimeoutMillis; + + private $noRetriesRpcTimeoutMillis; + + /** + * The number of maximum retries an operation can do. + * This doesn't include the original API call. + * Setting this to 0 means no limit. + */ + private int $maxRetries; + + /** + * When set, this function will be used to evaluate if the retry should + * take place or not. The callable will have the following signature: + * function (Exception $e, array $options): bool + */ + private ?Closure $retryFunction; + + /** + * Constructs an instance. + * + * @param array $settings { + * Required. Settings for configuring the retry behavior. All parameters are required except + * $retriesEnabled and $noRetriesRpcTimeoutMillis, which are optional and have defaults + * determined based on the other settings provided. + * + * @type bool $retriesEnabled Optional. Enables retries. If not specified, the value is + * determined using the $retryableCodes setting. If $retryableCodes is empty, + * then $retriesEnabled is set to false; otherwise, it is set to true. + * @type int $noRetriesRpcTimeoutMillis Optional. The timeout of the rpc call to be used + * if $retriesEnabled is false, in milliseconds. It not specified, the value + * of $initialRpcTimeoutMillis is used. + * @type array $retryableCodes The Status codes that are retryable. Each status should be + * either one of the string constants defined on {@see \Google\ApiCore\ApiStatus} + * or an integer constant defined on {@see \Google\Rpc\Code}. + * @type int $initialRetryDelayMillis The initial delay of retry in milliseconds. + * @type int $retryDelayMultiplier The exponential multiplier of retry delay. + * @type int $maxRetryDelayMillis The max delay of retry in milliseconds. + * @type int $initialRpcTimeoutMillis The initial timeout of rpc call in milliseconds. + * @type int $rpcTimeoutMultiplier The exponential multiplier of rpc timeout. + * @type int $maxRpcTimeoutMillis The max timeout of rpc call in milliseconds. + * @type int $totalTimeoutMillis The max accumulative timeout in total. + * @type int $maxRetries The max retries allowed for an operation. + * Defaults to the value of the DEFAULT_MAX_RETRIES constant. + * This option is experimental. + * @type callable $retryFunction This function will be used to decide if we should retry or not. + * Callable signature: `function (Exception $e, array $options): bool` + * This option is experimental. + * } + */ + public function __construct(array $settings) + { + $this->validateNotNull($settings, [ + 'initialRetryDelayMillis', + 'retryDelayMultiplier', + 'maxRetryDelayMillis', + 'initialRpcTimeoutMillis', + 'rpcTimeoutMultiplier', + 'maxRpcTimeoutMillis', + 'totalTimeoutMillis', + 'retryableCodes' + ]); + $this->initialRetryDelayMillis = $settings['initialRetryDelayMillis']; + $this->retryDelayMultiplier = $settings['retryDelayMultiplier']; + $this->maxRetryDelayMillis = $settings['maxRetryDelayMillis']; + $this->initialRpcTimeoutMillis = $settings['initialRpcTimeoutMillis']; + $this->rpcTimeoutMultiplier = $settings['rpcTimeoutMultiplier']; + $this->maxRpcTimeoutMillis = $settings['maxRpcTimeoutMillis']; + $this->totalTimeoutMillis = $settings['totalTimeoutMillis']; + $this->retryableCodes = $settings['retryableCodes']; + $this->retriesEnabled = array_key_exists('retriesEnabled', $settings) + ? $settings['retriesEnabled'] + : (count($this->retryableCodes) > 0); + $this->noRetriesRpcTimeoutMillis = array_key_exists('noRetriesRpcTimeoutMillis', $settings) + ? $settings['noRetriesRpcTimeoutMillis'] + : $this->initialRpcTimeoutMillis; + $this->maxRetries = $settings['maxRetries'] ?? self::DEFAULT_MAX_RETRIES; + $this->retryFunction = $settings['retryFunction'] ?? null; + } + + /** + * Constructs an array mapping method names to CallSettings. + * + * @param string $serviceName + * The fully-qualified name of this service, used as a key into + * the client config file. + * @param array $clientConfig + * An array parsed from the standard API client config file. + * @param bool $disableRetries + * Disable retries in all loaded RetrySettings objects. Defaults to false. + * @throws ValidationException + * @return RetrySettings[] $retrySettings + */ + public static function load( + string $serviceName, + array $clientConfig, + bool $disableRetries = false + ) { + $serviceRetrySettings = []; + + $serviceConfig = $clientConfig['interfaces'][$serviceName]; + $retryCodes = $serviceConfig['retry_codes']; + $retryParams = $serviceConfig['retry_params']; + foreach ($serviceConfig['methods'] as $methodName => $methodConfig) { + $timeoutMillis = $methodConfig['timeout_millis']; + + if (empty($methodConfig['retry_codes_name']) || empty($methodConfig['retry_params_name'])) { + // Construct a RetrySettings object with retries disabled + $retrySettings = self::constructDefault()->with([ + 'noRetriesRpcTimeoutMillis' => $timeoutMillis, + ]); + } else { + $retryCodesName = $methodConfig['retry_codes_name']; + $retryParamsName = $methodConfig['retry_params_name']; + + if (!array_key_exists($retryCodesName, $retryCodes)) { + throw new ValidationException("Invalid retry_codes_name setting: '$retryCodesName'"); + } + if (!array_key_exists($retryParamsName, $retryParams)) { + throw new ValidationException("Invalid retry_params_name setting: '$retryParamsName'"); + } + + foreach ($retryCodes[$retryCodesName] as $status) { + if (!ApiStatus::isValidStatus($status)) { + throw new ValidationException("Invalid status code: '$status'"); + } + } + + $retryParameters = self::convertArrayFromSnakeCase($retryParams[$retryParamsName]) + [ + 'retryableCodes' => $retryCodes[$retryCodesName], + 'noRetriesRpcTimeoutMillis' => $timeoutMillis, + ]; + if ($disableRetries) { + $retryParameters['retriesEnabled'] = false; + } + + $retrySettings = new RetrySettings($retryParameters); + } + + $serviceRetrySettings[$methodName] = $retrySettings; + } + + return $serviceRetrySettings; + } + + public static function constructDefault() + { + return new RetrySettings([ + 'retriesEnabled' => false, + 'noRetriesRpcTimeoutMillis' => 30000, + 'initialRetryDelayMillis' => 100, + 'retryDelayMultiplier' => 1.3, + 'maxRetryDelayMillis' => 60000, + 'initialRpcTimeoutMillis' => 20000, + 'rpcTimeoutMultiplier' => 1, + 'maxRpcTimeoutMillis' => 20000, + 'totalTimeoutMillis' => 600000, + 'retryableCodes' => [], + 'maxRetries' => self::DEFAULT_MAX_RETRIES, + 'retryFunction' => null]); + } + + /** + * Creates a new instance of RetrySettings that updates the settings in the existing instance + * with the settings specified in the $settings parameter. + * + * @param array $settings { + * Settings for configuring the retry behavior. Supports all of the options supported by + * the constructor; see {@see \Google\ApiCore\RetrySettings::__construct()}. All parameters + * are optional - all unset parameters will default to the value in the existing instance. + * } + * @return RetrySettings + */ + public function with(array $settings) + { + $existingSettings = [ + 'initialRetryDelayMillis' => $this->getInitialRetryDelayMillis(), + 'retryDelayMultiplier' => $this->getRetryDelayMultiplier(), + 'maxRetryDelayMillis' => $this->getMaxRetryDelayMillis(), + 'initialRpcTimeoutMillis' => $this->getInitialRpcTimeoutMillis(), + 'rpcTimeoutMultiplier' => $this->getRpcTimeoutMultiplier(), + 'maxRpcTimeoutMillis' => $this->getMaxRpcTimeoutMillis(), + 'totalTimeoutMillis' => $this->getTotalTimeoutMillis(), + 'retryableCodes' => $this->getRetryableCodes(), + 'retriesEnabled' => $this->retriesEnabled(), + 'noRetriesRpcTimeoutMillis' => $this->getNoRetriesRpcTimeoutMillis(), + 'maxRetries' => $this->getMaxRetries(), + 'retryFunction' => $this->getRetryFunction(), + ]; + return new RetrySettings($settings + $existingSettings); + } + + /** + * Creates an associative array of the {@see \Google\ApiCore\RetrySettings} timeout fields configured + * with the given timeout specified in the $timeout parameter interpreted as a logical timeout. + * + * @param int $timeout The timeout in milliseconds to be used as a logical call timeout. + * @return array + */ + public static function logicalTimeout(int $timeout) + { + return [ + 'initialRpcTimeoutMillis' => $timeout, + 'maxRpcTimeoutMillis' => $timeout, + 'totalTimeoutMillis' => $timeout, + 'noRetriesRpcTimeoutMillis' => $timeout, + 'rpcTimeoutMultiplier' => 1.0 + ]; + } + + /** + * @return bool Returns true if retries are enabled, otherwise returns false. + */ + public function retriesEnabled() + { + return $this->retriesEnabled; + } + + /** + * @return int The timeout of the rpc call to be used if $retriesEnabled is false, + * in milliseconds. + */ + public function getNoRetriesRpcTimeoutMillis() + { + return $this->noRetriesRpcTimeoutMillis; + } + + /** + * @return int[] Status codes to retry + */ + public function getRetryableCodes() + { + return $this->retryableCodes; + } + + /** + * @return int The initial retry delay in milliseconds. If $this->retriesEnabled() + * is false, this setting is unused. + */ + public function getInitialRetryDelayMillis() + { + return $this->initialRetryDelayMillis; + } + + /** + * @return float The retry delay multiplier. If $this->retriesEnabled() + * is false, this setting is unused. + */ + public function getRetryDelayMultiplier() + { + return $this->retryDelayMultiplier; + } + + /** + * @return int The maximum retry delay in milliseconds. If $this->retriesEnabled() + * is false, this setting is unused. + */ + public function getMaxRetryDelayMillis() + { + return $this->maxRetryDelayMillis; + } + + /** + * @return int The initial rpc timeout in milliseconds. If $this->retriesEnabled() + * is false, this setting is unused - use noRetriesRpcTimeoutMillis to + * set the timeout in that case. + */ + public function getInitialRpcTimeoutMillis() + { + return $this->initialRpcTimeoutMillis; + } + + /** + * @return float The rpc timeout multiplier. If $this->retriesEnabled() + * is false, this setting is unused. + */ + public function getRpcTimeoutMultiplier() + { + return $this->rpcTimeoutMultiplier; + } + + /** + * @return int The maximum rpc timeout in milliseconds. If $this->retriesEnabled() + * is false, this setting is unused - use noRetriesRpcTimeoutMillis to + * set the timeout in that case. + */ + public function getMaxRpcTimeoutMillis() + { + return $this->maxRpcTimeoutMillis; + } + + /** + * @return int The total time in milliseconds to spend on the call, including all + * retry attempts and delays between attempts. If $this->retriesEnabled() + * is false, this setting is unused - use noRetriesRpcTimeoutMillis to + * set the timeout in that case. + */ + public function getTotalTimeoutMillis() + { + return $this->totalTimeoutMillis; + } + + /** + * @experimental + */ + public function getMaxRetries() + { + return $this->maxRetries; + } + + /** + * @experimental + */ + public function getRetryFunction() + { + return $this->retryFunction; + } + + private static function convertArrayFromSnakeCase(array $settings) + { + $camelCaseSettings = []; + foreach ($settings as $key => $value) { + $camelCaseKey = str_replace(' ', '', ucwords(str_replace('_', ' ', $key))); + $camelCaseSettings[lcfirst($camelCaseKey)] = $value; + } + return $camelCaseSettings; + } +} diff --git a/vendor/google/gax/src/Serializer.php b/vendor/google/gax/src/Serializer.php new file mode 100644 index 0000000..a4e404d --- /dev/null +++ b/vendor/google/gax/src/Serializer.php @@ -0,0 +1,541 @@ + \Google\Rpc\RetryInfo::class, + 'google.rpc.debuginfo-bin' => \Google\Rpc\DebugInfo::class, + 'google.rpc.quotafailure-bin' => \Google\Rpc\QuotaFailure::class, + 'google.rpc.badrequest-bin' => \Google\Rpc\BadRequest::class, + 'google.rpc.requestinfo-bin' => \Google\Rpc\RequestInfo::class, + 'google.rpc.resourceinfo-bin' => \Google\Rpc\ResourceInfo::class, + 'google.rpc.errorinfo-bin' => \Google\Rpc\ErrorInfo::class, + 'google.rpc.help-bin' => \Google\Rpc\Help::class, + 'google.rpc.localizedmessage-bin' => \Google\Rpc\LocalizedMessage::class, + ]; + + private $fieldTransformers; + private $messageTypeTransformers; + private $decodeFieldTransformers; + private $decodeMessageTypeTransformers; + // Array of key-value pairs which specify a custom encoding function. + // The key is the proto class and the value is the function + // which will be used to convert the proto instead of the + // encodeMessage method from the Serializer class. + private $customEncoders; + + private $descriptorMaps = []; + + /** + * Serializer constructor. + * + * @param array $fieldTransformers An array mapping field names to transformation functions + * @param array $messageTypeTransformers An array mapping message names to transformation functions + * @param array $decodeFieldTransformers An array mapping field names to transformation functions + * @param array $decodeMessageTypeTransformers An array mapping message names to transformation functions + */ + public function __construct( + $fieldTransformers = [], + $messageTypeTransformers = [], + $decodeFieldTransformers = [], + $decodeMessageTypeTransformers = [], + $customEncoders = [], + ) { + $this->fieldTransformers = $fieldTransformers; + $this->messageTypeTransformers = $messageTypeTransformers; + $this->decodeFieldTransformers = $decodeFieldTransformers; + $this->decodeMessageTypeTransformers = $decodeMessageTypeTransformers; + $this->customEncoders = $customEncoders; + } + + /** + * Encode protobuf message as a PHP array + * + * @param mixed $message + * @return array + * @throws ValidationException + */ + public function encodeMessage($message) + { + $cls = get_class($message); + + // If we have supplied a customEncoder for this class type, + // then we use that instead of the general encodeMessage definition. + if (array_key_exists($cls, $this->customEncoders)) { + $func = $this->customEncoders[$cls]; + return call_user_func($func, $message); + } + // Get message descriptor + $pool = DescriptorPool::getGeneratedPool(); + $messageType = $pool->getDescriptorByClassName(get_class($message)); + try { + return $this->encodeMessageImpl($message, $messageType); + } catch (\Exception $e) { + throw new ValidationException( + 'Error encoding message: ' . $e->getMessage(), + $e->getCode(), + $e + ); + } + } + + /** + * Decode PHP array into the specified protobuf message + * + * @param mixed $message + * @param array $data + * @return mixed + * @throws ValidationException + */ + public function decodeMessage($message, array $data) + { + // Get message descriptor + $pool = DescriptorPool::getGeneratedPool(); + $messageType = $pool->getDescriptorByClassName(get_class($message)); + try { + return $this->decodeMessageImpl($message, $messageType, $data); + } catch (\Exception $e) { + throw new ValidationException( + 'Error decoding message: ' . $e->getMessage(), + $e->getCode(), + $e + ); + } + } + + /** + * @param Message $message + * @return string Json representation of $message + * @throws ValidationException + */ + public static function serializeToJson(Message $message) + { + return json_encode(self::serializeToPhpArray($message), JSON_PRETTY_PRINT); + } + + /** + * @param Message $message + * @return array PHP array representation of $message + * @throws ValidationException + */ + public static function serializeToPhpArray(Message $message) + { + return self::getPhpArraySerializer()->encodeMessage($message); + } + + /** + * Decode metadata received from gRPC status object + * + * @param array $metadata + * @return array + */ + public static function decodeMetadata(array $metadata) + { + if (count($metadata) == 0) { + return []; + } + $result = []; + foreach ($metadata as $key => $values) { + foreach ($values as $value) { + $decodedValue = [ + '@type' => $key, + ]; + if (self::hasBinaryHeaderSuffix($key)) { + if (isset(self::$metadataKnownTypes[$key])) { + $class = self::$metadataKnownTypes[$key]; + /** @var Message $message */ + $message = new $class(); + try { + $message->mergeFromString($value); + $decodedValue += self::serializeToPhpArray($message); + } catch (\Exception $e) { + // We encountered an error trying to deserialize the data + $decodedValue += [ + 'data' => '', + ]; + } + } else { + // The metadata contains an unexpected binary type + $decodedValue += [ + 'data' => '', + ]; + } + } else { + $decodedValue += [ + 'data' => $value, + ]; + } + $result[] = $decodedValue; + } + } + return $result; + } + + /** + * Decode an array of Any messages into a printable PHP array. + * + * @param iterable $anyArray + * @return array + */ + public static function decodeAnyMessages($anyArray) + { + $results = []; + foreach ($anyArray as $any) { + try { + /** @var Any $any */ + /** @var Message $unpacked */ + $unpacked = $any->unpack(); + $results[] = self::serializeToPhpArray($unpacked); + } catch (\Exception $ex) { + echo "$ex\n"; + // failed to unpack the $any object - show as unknown binary data + $results[] = [ + 'typeUrl' => $any->getTypeUrl(), + 'value' => '', + ]; + } + } + return $results; + } + + /** + * @param FieldDescriptor $field + * @param Message|array|string $data + * @return mixed + * @throws \Exception + */ + private function encodeElement(FieldDescriptor $field, $data) + { + switch ($field->getType()) { + case GPBType::MESSAGE: + if (is_array($data)) { + $result = $data; + } else { + $result = $this->encodeMessageImpl($data, $field->getMessageType()); + } + $messageType = $field->getMessageType()->getFullName(); + if (isset($this->messageTypeTransformers[$messageType])) { + $result = $this->messageTypeTransformers[$messageType]($result); + } + break; + default: + $result = $data; + break; + } + + if (isset($this->fieldTransformers[$field->getName()])) { + $result = $this->fieldTransformers[$field->getName()]($result); + } + return $result; + } + + private function getDescriptorMaps(Descriptor $descriptor) + { + if (!isset($this->descriptorMaps[$descriptor->getFullName()])) { + $fieldsByName = []; + $fieldCount = $descriptor->getFieldCount(); + for ($i = 0; $i < $fieldCount; $i++) { + $field = $descriptor->getField($i); + $fieldsByName[$field->getName()] = $field; + } + $fieldToOneof = []; + $oneofCount = $descriptor->getOneofDeclCount(); + for ($i = 0; $i < $oneofCount; $i++) { + $oneof = $descriptor->getOneofDecl($i); + $oneofFieldCount = $oneof->getFieldCount(); + for ($j = 0; $j < $oneofFieldCount; $j++) { + $field = $oneof->getField($j); + $fieldToOneof[$field->getName()] = $oneof->getName(); + } + } + $this->descriptorMaps[$descriptor->getFullName()] = [$fieldsByName, $fieldToOneof]; + } + return $this->descriptorMaps[$descriptor->getFullName()]; + } + + /** + * @param Message $message + * @param Descriptor $messageType + * @return array + * @throws \Exception + */ + private function encodeMessageImpl(Message $message, Descriptor $messageType) + { + $data = []; + + // Call the getDescriptorMaps outside of the loop to save processing. + // Use the same set of fields to loop over, instead of using field count. + list($fields, $fieldsToOneof) = $this->getDescriptorMaps($messageType); + foreach ($fields as $field) { + $key = $field->getName(); + $getter = $this->getGetter($key); + $v = $message->$getter(); + + if (is_null($v)) { + continue; + } + + // Check and skip unset fields inside oneofs + if (isset($fieldsToOneof[$key])) { + $oneofName = $fieldsToOneof[$key]; + $oneofGetter = $this->getGetter($oneofName); + if ($message->$oneofGetter() !== $key) { + continue; + } + } + + if ($field->isMap()) { + list($mapFieldsByName, $_) = $this->getDescriptorMaps($field->getMessageType()); + $keyField = $mapFieldsByName[self::MAP_KEY_FIELD_NAME]; + $valueField = $mapFieldsByName[self::MAP_VALUE_FIELD_NAME]; + $arr = []; + foreach ($v as $k => $vv) { + $arr[$this->encodeElement($keyField, $k)] = $this->encodeElement($valueField, $vv); + } + $v = $arr; + } elseif ($this->checkFieldRepeated($field)) { + $arr = []; + foreach ($v as $k => $vv) { + $arr[$k] = $this->encodeElement($field, $vv); + } + $v = $arr; + } else { + $v = $this->encodeElement($field, $v); + } + + $key = self::toCamelCase($key); + $data[$key] = $v; + } + + return $data; + } + + /** + * @param FieldDescriptor $field + * @param mixed $data + * @return mixed + * @throws \Exception + */ + private function decodeElement(FieldDescriptor $field, $data) + { + if (isset($this->decodeFieldTransformers[$field->getName()])) { + $data = $this->decodeFieldTransformers[$field->getName()]($data); + } + + switch ($field->getType()) { + case GPBType::MESSAGE: + if ($data instanceof Message) { + return $data; + } + $messageType = $field->getMessageType(); + $messageTypeName = $messageType->getFullName(); + $klass = $messageType->getClass(); + $msg = new $klass(); + if (isset($this->decodeMessageTypeTransformers[$messageTypeName])) { + $data = $this->decodeMessageTypeTransformers[$messageTypeName]($data); + } + + return $this->decodeMessageImpl($msg, $messageType, $data); + default: + return $data; + } + } + + /** + * @param Message $message + * @param Descriptor $messageType + * @param array $data + * @return mixed + * @throws \Exception + */ + private function decodeMessageImpl(Message $message, Descriptor $messageType, array $data) + { + list($fieldsByName, $_) = $this->getDescriptorMaps($messageType); + foreach ($data as $key => $v) { + // Get the field by tag number or name + $fieldName = self::toSnakeCase($key); + + // Unknown field found + if (!isset($fieldsByName[$fieldName])) { + throw new RuntimeException(sprintf( + 'cannot handle unknown field %s on message %s', + $fieldName, + $messageType->getFullName() + )); + } + + /** @var FieldDescriptor $field */ + $field = $fieldsByName[$fieldName]; + + if ($field->isMap()) { + list($mapFieldsByName, $_) = $this->getDescriptorMaps($field->getMessageType()); + $keyField = $mapFieldsByName[self::MAP_KEY_FIELD_NAME]; + $valueField = $mapFieldsByName[self::MAP_VALUE_FIELD_NAME]; + $arr = []; + foreach ($v as $k => $vv) { + $arr[$this->decodeElement($keyField, $k)] = $this->decodeElement($valueField, $vv); + } + $value = $arr; + } elseif ($this->checkFieldRepeated($field)) { + $arr = []; + foreach ($v as $k => $vv) { + $arr[$k] = $this->decodeElement($field, $vv); + } + $value = $arr; + } else { + $value = $this->decodeElement($field, $v); + } + + $setter = $this->getSetter($field->getName()); + $message->$setter($value); + + // We must unset $value here, otherwise the protobuf c extension will mix up the references + // and setting one value will change all others + unset($value); + } + return $message; + } + + /** + * @param FieldDescriptor $field + * @return bool + */ + private function checkFieldRepeated(FieldDescriptor $field): bool + { + return method_exists($field, 'isRepeated') + ? $field->isRepeated() + : $field->getLabel() === GPBLabel::REPEATED; + } + + /** + * @param string $name + * @return string Getter function + */ + public static function getGetter(string $name) + { + if (!isset(self::$getterMap[$name])) { + self::$getterMap[$name] = 'get' . ucfirst(self::toCamelCase($name)); + } + return self::$getterMap[$name]; + } + + /** + * @param string $name + * @return string Setter function + */ + public static function getSetter(string $name) + { + if (!isset(self::$setterMap[$name])) { + self::$setterMap[$name] = 'set' . ucfirst(self::toCamelCase($name)); + } + return self::$setterMap[$name]; + } + + /** + * Convert string from camelCase to snake_case + * + * @param string $key + * @return string + */ + public static function toSnakeCase(string $key) + { + if (!isset(self::$snakeCaseMap[$key])) { + self::$snakeCaseMap[$key] = strtolower( + preg_replace(['/([a-z\d])([A-Z])/', '/([^_])([A-Z][a-z])/'], '$1_$2', $key) + ); + } + return self::$snakeCaseMap[$key]; + } + + /** + * Convert string from snake_case to camelCase + * + * @param string $key + * @return string + */ + public static function toCamelCase(string $key) + { + if (!isset(self::$camelCaseMap[$key])) { + self::$camelCaseMap[$key] = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))); + } + return self::$camelCaseMap[$key]; + } + + private static function hasBinaryHeaderSuffix(string $key) + { + return substr_compare($key, '-bin', strlen($key) - 4) === 0; + } + + private static function getPhpArraySerializer() + { + if (is_null(self::$phpArraySerializer)) { + self::$phpArraySerializer = new Serializer(); + } + return self::$phpArraySerializer; + } + + public static function loadKnownMetadataTypes() + { + foreach (self::$metadataKnownTypes as $key => $class) { + new $class(); + } + } +} + +// It is necessary to call this when this file is included. Otherwise we cannot be +// guaranteed that the relevant classes will be loaded into the protobuf descriptor +// pool when we try to unpack an Any object containing that class. +// phpcs:disable PSR1.Files.SideEffects +Serializer::loadKnownMetadataTypes(); +// phpcs:enable diff --git a/vendor/google/gax/src/ServerStream.php b/vendor/google/gax/src/ServerStream.php new file mode 100644 index 0000000..3257e65 --- /dev/null +++ b/vendor/google/gax/src/ServerStream.php @@ -0,0 +1,128 @@ +call = $serverStreamingCall; + if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) { + $this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod']; + } + $this->logger = $logger; + } + + /** + * A generator which yields results from the server until the streaming call + * completes. Throws an ApiException if the streaming call failed. + * + * @throws ApiException + * @return \Generator|mixed + */ + public function readAll() + { + $resourcesGetMethod = $this->resourcesGetMethod; + foreach ($this->call->responses() as $response) { + if ($this->logger && $response instanceof Message) { + $responseEvent = new RpcLogEvent(); + $responseEvent->payload = $response->serializeToJsonString(); + $responseEvent->processId = (int) getmypid(); + $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + $this->logResponse($responseEvent); + } + + if (!is_null($resourcesGetMethod)) { + foreach ($response->$resourcesGetMethod() as $resource) { + yield $resource; + } + } else { + yield $response; + } + } + + // Errors in the REST transport will be thrown from there and not reach + // this handling. Successful REST server-streams will have an OK status. + $status = $this->call->getStatus(); + + if ($this->logger) { + $statusEvent = new RpcLogEvent(); + $statusEvent->status = $status->code; + $statusEvent->processId = (int) getmypid(); + $statusEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); + + $this->logResponse($statusEvent); + } + + if ($status->code !== Code::OK) { + throw ApiException::createFromStdClass($status); + } + } + + /** + * Return the underlying call object. + * + * @return ServerStreamingCallInterface + */ + public function getServerStreamingCall() + { + return $this->call; + } +} diff --git a/vendor/google/gax/src/ServerStreamingCallInterface.php b/vendor/google/gax/src/ServerStreamingCallInterface.php new file mode 100644 index 0000000..a78ff27 --- /dev/null +++ b/vendor/google/gax/src/ServerStreamingCallInterface.php @@ -0,0 +1,95 @@ + $metadata Metadata to send with the call, if applicable + * (optional) + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + * @return void + */ + public function start($data, array $metadata = [], array $options = []); + + /** + * @return mixed An iterator of response values. + */ + public function responses(); + + /** + * Return the status of the server stream. + * + * @return \stdClass The API status. + */ + public function getStatus(); + + /** + * @return mixed The metadata sent by the server. + */ + public function getMetadata(); + + /** + * @return mixed The trailing metadata sent by the server. + */ + public function getTrailingMetadata(); + + /** + * @return string The URI of the endpoint. + */ + public function getPeer(); + + /** + * Cancels the call. + * + * @return void + */ + public function cancel(); + + /** + * Set the CallCredentials for the underlying Call. + * + * @param mixed $call_credentials The CallCredentials object + * + * @return void + */ + public function setCallCredentials($call_credentials); +} diff --git a/vendor/google/gax/src/ServiceAddressTrait.php b/vendor/google/gax/src/ServiceAddressTrait.php new file mode 100644 index 0000000..1343a23 --- /dev/null +++ b/vendor/google/gax/src/ServiceAddressTrait.php @@ -0,0 +1,64 @@ +assertSame($expected, $actual); + + return; + } + + if (is_array($expected) || $expected instanceof RepeatedField) { + if (is_array($expected) === is_array($actual)) { + $this->assertEquals($expected, $actual); + } + + $this->assertCount(count($expected), $actual); + + $expectedValues = $this->getValues($expected); + $actualValues = $this->getValues($actual); + + for ($i = 0; $i < count($expectedValues); $i++) { + $expectedElement = $expectedValues[$i]; + $actualElement = $actualValues[$i]; + $this->assertProtobufEquals($expectedElement, $actualElement); + } + } else { + $this->assertEquals($expected, $actual); + if ($expected instanceof Message) { + $pool = DescriptorPool::getGeneratedPool(); + $descriptor = $pool->getDescriptorByClassName(get_class($expected)); + + $fieldCount = $descriptor->getFieldCount(); + for ($i = 0; $i < $fieldCount; $i++) { + $field = $descriptor->getField($i); + $getter = Serializer::getGetter($field->getName()); + $expectedFieldValue = $expected->$getter(); + $actualFieldValue = $actual->$getter(); + $this->assertProtobufEquals($expectedFieldValue, $actualFieldValue); + } + } + } + } + + /** + * @param iterable $field + */ + private function getValues($field) + { + return array_values( + is_array($field) + ? $field + : iterator_to_array($field) + ); + } +} diff --git a/vendor/google/gax/src/Testing/MessageAwareArrayComparator.php b/vendor/google/gax/src/Testing/MessageAwareArrayComparator.php new file mode 100644 index 0000000..9feedb0 --- /dev/null +++ b/vendor/google/gax/src/Testing/MessageAwareArrayComparator.php @@ -0,0 +1,32 @@ +exporter = new MessageAwareExporter(); + } +} diff --git a/vendor/google/gax/src/Testing/MessageAwareExporter.php b/vendor/google/gax/src/Testing/MessageAwareExporter.php new file mode 100644 index 0000000..2aeb29c --- /dev/null +++ b/vendor/google/gax/src/Testing/MessageAwareExporter.php @@ -0,0 +1,47 @@ +responses = $responses; + $this->deserialize = $deserialize; + if (is_null($status)) { + $status = new MockStatus(Code::OK); + } + $this->status = $status; + } + + /** + * @return mixed|null + * @throws ApiException + */ + public function read() + { + if (count($this->responses) > 0) { + $resp = array_shift($this->responses); + if (is_null($resp)) { + // Null was added to the responses list to simulate a failed stream + // To ensure that getStatus can now be called, we clear the remaining + // responses and set writesDone to true + $this->responses = []; + $this->writesDone(); + return null; + } + $obj = $this->deserializeMessage($resp, $this->deserialize); + return $obj; + } elseif ($this->writesDone) { + return null; + } else { + throw new ApiException( + 'No more responses to read, but closeWrite() not called - ' + . 'this would be blocking', + Grpc\STATUS_INTERNAL, + null + ); + } + } + + /** + * @return stdClass|null + * @throws ApiException + */ + public function getStatus() + { + if (count($this->responses) > 0) { + throw new ApiException( + 'Calls to getStatus() will block if all responses are not read', + Grpc\STATUS_INTERNAL, + null + ); + } + if (!$this->writesDone) { + throw new ApiException( + 'Calls to getStatus() will block if closeWrite() not called', + Grpc\STATUS_INTERNAL, + null + ); + } + return $this->status; + } + + /** + * Save the request object, to be retrieved via getReceivedCalls() + * @param Message|mixed $request The request object + * @param array $options An array of options. + * @throws ApiException + */ + public function write($request, array $options = []) + { + if ($this->writesDone) { + throw new ApiException( + 'Cannot call write() after writesDone()', + Grpc\STATUS_INTERNAL, + null + ); + } + if (is_a($request, '\Google\Protobuf\Internal\Message')) { + /** @var Message $newRequest */ + $newRequest = new $request(); + $newRequest->mergeFromString($request->serializeToString()); + $request = $newRequest; + } + $this->receivedWrites[] = $request; + } + + /** + * Set writesDone to true + */ + public function writesDone() + { + $this->writesDone = true; + } + + /** + * Return a list of calls made to write(), and clear $receivedFuncCalls. + * + * @return mixed[] An array of received requests + */ + public function popReceivedCalls() + { + $receivedFuncCallsTemp = $this->receivedWrites; + $this->receivedWrites = []; + return $receivedFuncCallsTemp; + } +} diff --git a/vendor/google/gax/src/Testing/MockClientStreamingCall.php b/vendor/google/gax/src/Testing/MockClientStreamingCall.php new file mode 100644 index 0000000..ca28e3d --- /dev/null +++ b/vendor/google/gax/src/Testing/MockClientStreamingCall.php @@ -0,0 +1,111 @@ +mockUnaryCall = new MockUnaryCall($response, $deserialize, $status); + } + + /** + * Immediately return the preset response object and status. + * @return array The response object and status. + */ + public function wait() + { + $this->waitCalled = true; + return $this->mockUnaryCall->wait(); + } + + /** + * Save the request object, to be retrieved via getReceivedCalls() + * @param Message|mixed $request The request object + * @param array $options An array of options + * @throws ApiException + */ + public function write($request, array $options = []) + { + if ($this->waitCalled) { + throw new ApiException('Cannot call write() after wait()', Code::INTERNAL, ApiStatus::INTERNAL); + } + if (is_a($request, '\Google\Protobuf\Internal\Message')) { + /** @var Message $newRequest */ + $newRequest = new $request(); + $newRequest->mergeFromString($request->serializeToString()); + $request = $newRequest; + } + $this->receivedWrites[] = $request; + } + + /** + * Return a list of calls made to write(), and clear $receivedFuncCalls. + * + * @return mixed[] An array of received requests + */ + public function popReceivedCalls() + { + $receivedFuncCallsTemp = $this->receivedWrites; + $this->receivedWrites = []; + return $receivedFuncCallsTemp; + } +} diff --git a/vendor/google/gax/src/Testing/MockGrpcTransport.php b/vendor/google/gax/src/Testing/MockGrpcTransport.php new file mode 100644 index 0000000..d6af2fe --- /dev/null +++ b/vendor/google/gax/src/Testing/MockGrpcTransport.php @@ -0,0 +1,142 @@ +mockCall = $mockCall; + $opts = ['credentials' => ChannelCredentials::createSsl()]; + parent::__construct('', $opts, logger: $logger); + } + + /** + * @param string $method + * @param array $arguments + * @param callable $deserialize + */ + protected function _simpleRequest( + $method, + $arguments, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->logCall($method, $deserialize, $metadata, $options, $arguments); + return $this->mockCall; + } + + /** + * @param string $method + * @param callable $deserialize + */ + protected function _clientStreamRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->logCall($method, $deserialize, $metadata, $options); + return $this->mockCall; + } + + /** + * @param string $method + * @param array $arguments + * @param callable $deserialize + */ + protected function _serverStreamRequest( + $method, + $arguments, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->logCall($method, $deserialize, $metadata, $options, $arguments); + return $this->mockCall; + } + + /** + * @param string $method + * @param callable $deserialize + */ + protected function _bidiRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->logCall($method, $deserialize, $metadata, $options); + return $this->mockCall; + } + + /** + * @param string $method + * @param callable $deserialize + * @param array $arguments + */ + private function logCall( + $method, + $deserialize, + array $metadata = [], + array $options = [], + $arguments = null + ) { + $this->requestArguments = [ + 'method' => $method, + 'arguments' => $arguments, + 'deserialize' => $deserialize, + 'metadata' => $metadata, + 'options' => $options, + ]; + } + + public function getRequestArguments() + { + return $this->requestArguments; + } +} diff --git a/vendor/google/gax/src/Testing/MockRequest.php b/vendor/google/gax/src/Testing/MockRequest.php new file mode 100644 index 0000000..f7a23a3 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockRequest.php @@ -0,0 +1,86 @@ +google.apicore.testing.MockRequest + * + * @internal + */ +class MockRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string page_token = 1; + */ + protected $page_token = ''; + /** + * Generated from protobuf field uint64 page_size = 2; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $page_token + * @type int|string $page_size + * } + */ + public function __construct($data = null) + { + Mocks::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string page_token = 1; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Generated from protobuf field string page_token = 1; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, true); + $this->page_token = $var; + + return $this; + } + + /** + * Generated from protobuf field uint64 page_size = 2; + * @return int|string + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Generated from protobuf field uint64 page_size = 2; + * @param int|string $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkUint64($var); + $this->page_size = $var; + + return $this; + } + +} diff --git a/vendor/google/gax/src/Testing/MockRequestBody.php b/vendor/google/gax/src/Testing/MockRequestBody.php new file mode 100644 index 0000000..7d877d8 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockRequestBody.php @@ -0,0 +1,647 @@ +google.apicore.testing.MockRequestBody + * + * @internal + */ +class MockRequestBody extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Generated from protobuf field uint64 number = 2; + */ + protected $number = 0; + /** + * Generated from protobuf field repeated string repeated_field = 3; + */ + private $repeated_field; + /** + * Generated from protobuf field .google.apicore.testing.MockRequestBody nested_message = 4; + */ + protected $nested_message = null; + /** + * Generated from protobuf field .google.protobuf.BytesValue bytes_value = 5; + */ + protected $bytes_value = null; + /** + * Generated from protobuf field .google.protobuf.Duration duration_value = 6; + */ + protected $duration_value = null; + /** + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 7; + */ + protected $field_mask = null; + /** + * Generated from protobuf field .google.protobuf.Int64Value int64_value = 8; + */ + protected $int64_value = null; + /** + * Generated from protobuf field .google.protobuf.ListValue list_value = 9; + */ + protected $list_value = null; + /** + * Generated from protobuf field .google.protobuf.StringValue string_value = 10; + */ + protected $string_value = null; + /** + * Generated from protobuf field .google.protobuf.Struct struct_value = 11; + */ + protected $struct_value = null; + /** + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 12; + */ + protected $timestamp_value = null; + /** + * Generated from protobuf field .google.protobuf.Value value_value = 13; + */ + protected $value_value = null; + protected $oneof_field; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int|string $number + * @type string[]|\Google\Protobuf\RepeatedField $repeated_field + * @type \Google\ApiCore\Testing\MockRequestBody $nested_message + * @type \Google\Protobuf\BytesValue $bytes_value + * @type \Google\Protobuf\Duration $duration_value + * @type \Google\Protobuf\FieldMask $field_mask + * @type \Google\Protobuf\Int64Value $int64_value + * @type \Google\Protobuf\ListValue $list_value + * @type \Google\Protobuf\StringValue $string_value + * @type \Google\Protobuf\Struct $struct_value + * @type \Google\Protobuf\Timestamp $timestamp_value + * @type \Google\Protobuf\Value $value_value + * @type string $field_1 + * @type string $field_2 + * @type string $field_3 + * } + */ + public function __construct($data = null) + { + \GPBMetadata\ApiCore\Testing\Mocks::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, true); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field uint64 number = 2; + * @return int|string + */ + public function getNumber() + { + return $this->number; + } + + /** + * Generated from protobuf field uint64 number = 2; + * @param int|string $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkUint64($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated string repeated_field = 3; + * @return \Google\Protobuf\RepeatedField + */ + public function getRepeatedField() + { + return $this->repeated_field; + } + + /** + * Generated from protobuf field repeated string repeated_field = 3; + * @param string[]|\Google\Protobuf\RepeatedField $var + * @return $this + */ + public function setRepeatedField($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->repeated_field = $arr; + + return $this; + } + + /** + * Generated from protobuf field .google.apicore.testing.MockRequestBody nested_message = 4; + * @return \Google\ApiCore\Testing\MockRequestBody + */ + public function getNestedMessage() + { + return isset($this->nested_message) ? $this->nested_message : null; + } + + public function hasNestedMessage() + { + return isset($this->nested_message); + } + + public function clearNestedMessage() + { + unset($this->nested_message); + } + + /** + * Generated from protobuf field .google.apicore.testing.MockRequestBody nested_message = 4; + * @param \Google\ApiCore\Testing\MockRequestBody $var + * @return $this + */ + public function setNestedMessage($var) + { + GPBUtil::checkMessage($var, \Google\ApiCore\Testing\MockRequestBody::class); + $this->nested_message = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.BytesValue bytes_value = 5; + * @return \Google\Protobuf\BytesValue + */ + public function getBytesValue() + { + return isset($this->bytes_value) ? $this->bytes_value : null; + } + + public function hasBytesValue() + { + return isset($this->bytes_value); + } + + public function clearBytesValue() + { + unset($this->bytes_value); + } + + /** + * Returns the unboxed value from getBytesValue() + + * Generated from protobuf field .google.protobuf.BytesValue bytes_value = 5; + * @return string|null + */ + public function getBytesValueUnwrapped() + { + return $this->readWrapperValue('bytes_value'); + } + + /** + * Generated from protobuf field .google.protobuf.BytesValue bytes_value = 5; + * @param \Google\Protobuf\BytesValue $var + * @return $this + */ + public function setBytesValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BytesValue::class); + $this->bytes_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BytesValue object. + + * Generated from protobuf field .google.protobuf.BytesValue bytes_value = 5; + * @param string|null $var + * @return $this + */ + public function setBytesValueUnwrapped($var) + { + $this->writeWrapperValue('bytes_value', $var); + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.Duration duration_value = 6; + * @return \Google\Protobuf\Duration + */ + public function getDurationValue() + { + return isset($this->duration_value) ? $this->duration_value : null; + } + + public function hasDurationValue() + { + return isset($this->duration_value); + } + + public function clearDurationValue() + { + unset($this->duration_value); + } + + /** + * Generated from protobuf field .google.protobuf.Duration duration_value = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDurationValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration_value = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 7; + * @return \Google\Protobuf\FieldMask + */ + public function getFieldMask() + { + return isset($this->field_mask) ? $this->field_mask : null; + } + + public function hasFieldMask() + { + return isset($this->field_mask); + } + + public function clearFieldMask() + { + unset($this->field_mask); + } + + /** + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 7; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setFieldMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->field_mask = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.Int64Value int64_value = 8; + * @return \Google\Protobuf\Int64Value + */ + public function getInt64Value() + { + return isset($this->int64_value) ? $this->int64_value : null; + } + + public function hasInt64Value() + { + return isset($this->int64_value); + } + + public function clearInt64Value() + { + unset($this->int64_value); + } + + /** + * Returns the unboxed value from getInt64Value() + + * Generated from protobuf field .google.protobuf.Int64Value int64_value = 8; + * @return int|string|null + */ + public function getInt64ValueUnwrapped() + { + return $this->readWrapperValue('int64_value'); + } + + /** + * Generated from protobuf field .google.protobuf.Int64Value int64_value = 8; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setInt64Value($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->int64_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Generated from protobuf field .google.protobuf.Int64Value int64_value = 8; + * @param int|string|null $var + * @return $this + */ + public function setInt64ValueUnwrapped($var) + { + $this->writeWrapperValue('int64_value', $var); + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.ListValue list_value = 9; + * @return \Google\Protobuf\ListValue + */ + public function getListValue() + { + return isset($this->list_value) ? $this->list_value : null; + } + + public function hasListValue() + { + return isset($this->list_value); + } + + public function clearListValue() + { + unset($this->list_value); + } + + /** + * Generated from protobuf field .google.protobuf.ListValue list_value = 9; + * @param \Google\Protobuf\ListValue $var + * @return $this + */ + public function setListValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class); + $this->list_value = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.StringValue string_value = 10; + * @return \Google\Protobuf\StringValue + */ + public function getStringValue() + { + return isset($this->string_value) ? $this->string_value : null; + } + + public function hasStringValue() + { + return isset($this->string_value); + } + + public function clearStringValue() + { + unset($this->string_value); + } + + /** + * Returns the unboxed value from getStringValue() + + * Generated from protobuf field .google.protobuf.StringValue string_value = 10; + * @return string|null + */ + public function getStringValueUnwrapped() + { + return $this->readWrapperValue('string_value'); + } + + /** + * Generated from protobuf field .google.protobuf.StringValue string_value = 10; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->string_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * Generated from protobuf field .google.protobuf.StringValue string_value = 10; + * @param string|null $var + * @return $this + */ + public function setStringValueUnwrapped($var) + { + $this->writeWrapperValue('string_value', $var); + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.Struct struct_value = 11; + * @return \Google\Protobuf\Struct + */ + public function getStructValue() + { + return isset($this->struct_value) ? $this->struct_value : null; + } + + public function hasStructValue() + { + return isset($this->struct_value); + } + + public function clearStructValue() + { + unset($this->struct_value); + } + + /** + * Generated from protobuf field .google.protobuf.Struct struct_value = 11; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_value = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 12; + * @return \Google\Protobuf\Timestamp + */ + public function getTimestampValue() + { + return isset($this->timestamp_value) ? $this->timestamp_value : null; + } + + public function hasTimestampValue() + { + return isset($this->timestamp_value); + } + + public function clearTimestampValue() + { + unset($this->timestamp_value); + } + + /** + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestampValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->timestamp_value = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.protobuf.Value value_value = 13; + * @return \Google\Protobuf\Value + */ + public function getValueValue() + { + return isset($this->value_value) ? $this->value_value : null; + } + + public function hasValueValue() + { + return isset($this->value_value); + } + + public function clearValueValue() + { + unset($this->value_value); + } + + /** + * Generated from protobuf field .google.protobuf.Value value_value = 13; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setValueValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->value_value = $var; + + return $this; + } + + /** + * Generated from protobuf field string field_1 = 14; + * @return string + */ + public function getField1() + { + return $this->readOneof(14); + } + + public function hasField1() + { + return $this->hasOneof(14); + } + + /** + * Generated from protobuf field string field_1 = 14; + * @param string $var + * @return $this + */ + public function setField1($var) + { + GPBUtil::checkString($var, true); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Generated from protobuf field string field_2 = 15; + * @return string + */ + public function getField2() + { + return $this->readOneof(15); + } + + public function hasField2() + { + return $this->hasOneof(15); + } + + /** + * Generated from protobuf field string field_2 = 15; + * @param string $var + * @return $this + */ + public function setField2($var) + { + GPBUtil::checkString($var, true); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Generated from protobuf field string field_3 = 16; + * @return string + */ + public function getField3() + { + return $this->readOneof(16); + } + + public function hasField3() + { + return $this->hasOneof(16); + } + + /** + * Generated from protobuf field string field_3 = 16; + * @param string $var + * @return $this + */ + public function setField3($var) + { + GPBUtil::checkString($var, true); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * @return string + */ + public function getOneofField() + { + return $this->whichOneof('oneof_field'); + } + +} diff --git a/vendor/google/gax/src/Testing/MockResponse.php b/vendor/google/gax/src/Testing/MockResponse.php new file mode 100644 index 0000000..6d93ad9 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockResponse.php @@ -0,0 +1,166 @@ +google.apicore.testing.MockResponse + * + * @internal + */ +class MockResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Generated from protobuf field uint64 number = 2; + */ + protected $number = 0; + /** + * Generated from protobuf field repeated string resources_list = 3; + */ + private $resources_list; + /** + * Generated from protobuf field string next_page_token = 4; + */ + protected $next_page_token = ''; + /** + * Generated from protobuf field map resources_map = 5; + */ + private $resources_map; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int|string $number + * @type string[]|\Google\Protobuf\RepeatedField $resources_list + * @type string $next_page_token + * @type array|\Google\Protobuf\Internal\MapField $resources_map + * } + */ + public function __construct($data = null) + { + \GPBMetadata\ApiCore\Testing\Mocks::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, true); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field uint64 number = 2; + * @return int|string + */ + public function getNumber() + { + return $this->number; + } + + /** + * Generated from protobuf field uint64 number = 2; + * @param int|string $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkUint64($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated string resources_list = 3; + * @return \Google\Protobuf\RepeatedField + */ + public function getResourcesList() + { + return $this->resources_list; + } + + /** + * Generated from protobuf field repeated string resources_list = 3; + * @param string[]|\Google\Protobuf\RepeatedField $var + * @return $this + */ + public function setResourcesList($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resources_list = $arr; + + return $this; + } + + /** + * Generated from protobuf field string next_page_token = 4; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Generated from protobuf field string next_page_token = 4; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, true); + $this->next_page_token = $var; + + return $this; + } + + /** + * Generated from protobuf field map resources_map = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourcesMap() + { + return $this->resources_map; + } + + /** + * Generated from protobuf field map resources_map = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourcesMap($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resources_map = $arr; + + return $this; + } + +} diff --git a/vendor/google/gax/src/Testing/MockServerStreamingCall.php b/vendor/google/gax/src/Testing/MockServerStreamingCall.php new file mode 100644 index 0000000..d0dcead --- /dev/null +++ b/vendor/google/gax/src/Testing/MockServerStreamingCall.php @@ -0,0 +1,98 @@ +responses = $responses; + $this->deserialize = $deserialize; + if (is_null($status)) { + $status = new MockStatus(Code::OK, 'OK', []); + } elseif ($status instanceof stdClass) { + if (!property_exists($status, 'metadata')) { + $status->metadata = []; + } + } + $this->status = $status; + } + + public function responses() + { + while (count($this->responses) > 0) { + $resp = array_shift($this->responses); + $obj = $this->deserializeMessage($resp, $this->deserialize); + yield $obj; + } + } + + /** + * @return stdClass|null + * @throws ApiException + */ + public function getStatus() + { + if (count($this->responses) > 0) { + throw new ApiException( + 'Calls to getStatus() will block if all responses are not read', + Code::INTERNAL, + ApiStatus::INTERNAL + ); + } + return $this->status; + } +} diff --git a/vendor/google/gax/src/Testing/MockStatus.php b/vendor/google/gax/src/Testing/MockStatus.php new file mode 100644 index 0000000..6f29063 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockStatus.php @@ -0,0 +1,53 @@ +code = $code; + $this->details = $details; + $this->metadata = $metadata; + } +} diff --git a/vendor/google/gax/src/Testing/MockStubTrait.php b/vendor/google/gax/src/Testing/MockStubTrait.php new file mode 100644 index 0000000..db69910 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockStubTrait.php @@ -0,0 +1,296 @@ +deserialize = $deserialize; + } + + /** + * Overrides the _simpleRequest method in \Grpc\BaseStub + * (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) + * Returns a MockUnaryCall object that will return the first item from $responses + * @param string $method The API method name to be called + * @param \Google\Protobuf\Internal\Message $argument The request object to the API method + * @param callable $deserialize A function to deserialize the response object + * @param array $metadata + * @param array $options + * @return MockUnaryCall + */ + public function _simpleRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->receivedFuncCalls[] = new ReceivedRequest($method, $argument, $deserialize, $metadata, $options); + if (count($this->responses) < 1) { + throw new UnderflowException('ran out of responses'); + } + list($response, $status) = array_shift($this->responses); + $call = new MockUnaryCall($response, $deserialize, $status); + $this->callObjects[] = $call; + return $call; + } + + /** + * Overrides the _clientStreamRequest method in \Grpc\BaseStub + * (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) + * Returns a MockClientStreamingCall object that will return the first item from $responses + * + * @param string $method The name of the method to call + * @param callable $deserialize A function that deserializes the responses + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return MockClientStreamingCall The active call object + */ + public function _clientStreamRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $this->receivedFuncCalls[] = new ReceivedRequest($method, null, $deserialize, $metadata, $options); + if (count($this->responses) < 1) { + throw new UnderflowException('ran out of responses'); + } + list($response, $status) = array_shift($this->responses); + $call = new MockClientStreamingCall($response, $deserialize, $status); + $this->callObjects[] = $call; + return $call; + } + + /** + * Overrides the _serverStreamRequest method in \Grpc\BaseStub + * (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) + * Returns a MockServerStreamingCall object that will stream items from $responses, and return + * a final status of $serverStreamingStatus. + * + * @param string $method The name of the method to call + * @param \Google\Protobuf\Internal\Message $argument The argument to the method + * @param callable $deserialize A function that deserializes the responses + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return MockServerStreamingCall The active call object + */ + public function _serverStreamRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + + if (is_a($argument, '\Google\Protobuf\Internal\Message')) { + /** @var Message $newArgument */ + $newArgument = new $argument(); + $newArgument->mergeFromString($argument->serializeToString()); + $argument = $newArgument; + } + $this->receivedFuncCalls[] = new ReceivedRequest($method, $argument, $deserialize, $metadata, $options); + $responses = self::stripStatusFromResponses($this->responses); + $this->responses = []; + $call = new MockServerStreamingCall($responses, $deserialize, $this->serverStreamingStatus); + $this->callObjects[] = $call; + return $call; + } + + /** + * Overrides the _bidiRequest method in \Grpc\BaseStub + * (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) + * Returns a MockBidiStreamingCall object that will stream items from $responses, and return + * a final status of $serverStreamingStatus. + * + * @param string $method The name of the method to call + * @param callable $deserialize A function that deserializes the responses + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return MockBidiStreamingCall The active call object + */ + public function _bidiRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + + $this->receivedFuncCalls[] = new ReceivedRequest($method, null, $deserialize, $metadata, $options); + $responses = self::stripStatusFromResponses($this->responses); + $this->responses = []; + $call = new MockBidiStreamingCall($responses, $deserialize, $this->serverStreamingStatus); + $this->callObjects[] = $call; + return $call; + } + + public static function stripStatusFromResponses($responses) + { + $strippedResponses = []; + foreach ($responses as $response) { + list($resp, $_) = $response; + $strippedResponses[] = $resp; + } + return $strippedResponses; + } + + /** + * Add a response object, and an optional status, to the list of responses to be returned via + * _simpleRequest. + * @param \Google\Protobuf\Internal\Message $response + * @param stdClass $status + */ + public function addResponse($response, ?stdClass $status = null) + { + if (!$this->deserialize && $response) { + $this->deserialize = [get_class($response), 'decode']; + } + + if (is_a($response, '\Google\Protobuf\Internal\Message')) { + $response = $response->serializeToString(); + } + $this->responses[] = [$response, $status]; + } + + /** + * Set the status object to be used when creating streaming calls. + * + * @param stdClass $status + */ + public function setStreamingStatus(stdClass $status) + { + $this->serverStreamingStatus = $status; + } + + /** + * Return a list of calls made to _simpleRequest, and clear $receivedFuncCalls. + * + * @return ReceivedRequest[] An array of received requests + */ + public function popReceivedCalls() + { + $receivedFuncCallsTemp = $this->receivedFuncCalls; + $this->receivedFuncCalls = []; + return $receivedFuncCallsTemp; + } + + /** + * @return int The number of calls received. + */ + public function getReceivedCallCount() + { + return count($this->receivedFuncCalls); + } + + /** + * @return mixed[] The call objects created by calls to the stub + */ + public function popCallObjects() + { + $callObjectsTemp = $this->callObjects; + $this->callObjects = []; + return $callObjectsTemp; + } + + /** + * @return bool True if $receivedFuncCalls and $response are empty. + */ + public function isExhausted() + { + return count($this->receivedFuncCalls) === 0 + && count($this->responses) === 0; + } + + /** + * @param mixed $responseObject + * @param stdClass|null $status + * @param callable $deserialize + * @return static An instance of the current class type. + */ + public static function create($responseObject, ?stdClass $status = null, ?callable $deserialize = null) + { + $stub = new static($deserialize); // @phpstan-ignore-line + $stub->addResponse($responseObject, $status); + return $stub; + } + + /** + * Creates a sequence such that the responses are returned in order. + * @param mixed[] $sequence + * @param callable $deserialize + * @param stdClass $finalStatus + * @return static An instance of the current class type. + */ + public static function createWithResponseSequence(array $sequence, ?callable $deserialize = null, ?stdClass $finalStatus = null) + { + $stub = new static($deserialize); // @phpstan-ignore-line + foreach ($sequence as $elem) { + if (count($elem) == 1) { + list($resp, $status) = [$elem, null]; + } else { + list($resp, $status) = $elem; + } + $stub->addResponse($resp, $status); + } + if ($finalStatus) { + $stub->setStreamingStatus($finalStatus); + } + return $stub; + } +} diff --git a/vendor/google/gax/src/Testing/MockTransport.php b/vendor/google/gax/src/Testing/MockTransport.php new file mode 100644 index 0000000..333cb0b --- /dev/null +++ b/vendor/google/gax/src/Testing/MockTransport.php @@ -0,0 +1,114 @@ +agentHeaderDescriptor = $agentHeaderDescriptor; + } + + public function startUnaryCall(Call $call, array $options) + { + $call = call_user_func([$this, $call->getMethod()], $call, $options); + return $promise = new Promise( + function () use ($call, &$promise) { + list($response, $status) = $call->wait(); + + if ($status->code == Code::OK) { + $promise->resolve($response); + } else { + throw ApiException::createFromStdClass($status); + } + }, + [$call, 'cancel'] + ); + } + + public function startBidiStreamingCall(Call $call, array $options) + { + $newArgs = ['/' . $call->getMethod(), $this->deserialize, $options, $options]; + $response = $this->_bidiRequest(...$newArgs); + return new BidiStream($response, $call->getDescriptor()); + } + + public function startClientStreamingCall(Call $call, array $options) + { + $newArgs = ['/' . $call->getMethod(), $this->deserialize, $options, $options]; + $response = $this->_clientStreamRequest(...$newArgs); + return new ClientStream($response, $call->getDescriptor()); + } + + public function startServerStreamingCall(Call $call, array $options) + { + $newArgs = ['/' . $call->getMethod(), $call->getMessage(), $this->deserialize, $options, $options]; + $response = $this->_serverStreamRequest(...$newArgs); + return new ServerStream($response, $call->getDescriptor()); + } + + public function __call(string $name, array $arguments) + { + $call = $arguments[0]; + $options = $arguments[1]; + $decode = $call->getDecodeType() ? [$call->getDecodeType(), 'decode'] : null; + return $this->_simpleRequest( + '/' . $call->getMethod(), + $call->getMessage(), + $decode, + isset($options['headers']) ? $options['headers'] : [], + $options + ); + } + + public function close() + { + // does nothing + } +} diff --git a/vendor/google/gax/src/Testing/MockUnaryCall.php b/vendor/google/gax/src/Testing/MockUnaryCall.php new file mode 100644 index 0000000..431b041 --- /dev/null +++ b/vendor/google/gax/src/Testing/MockUnaryCall.php @@ -0,0 +1,83 @@ +response = $response; + $this->deserialize = $deserialize; + if (is_null($status)) { + $status = new MockStatus(Code::OK); + } + $this->status = $status; + } + + /** + * Immediately return the preset response object and status. + * @return array The response object and status. + */ + public function wait() + { + return [ + $this->deserializeMessage($this->response, $this->deserialize), + $this->status, + ]; + } +} diff --git a/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php b/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php new file mode 100644 index 0000000..b6871a8 --- /dev/null +++ b/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php @@ -0,0 +1,61 @@ +exporter = new MessageAwareExporter(); + } + + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return $expected instanceof Message && $actual instanceof Message; + } + + /** + * Asserts that two values are equal. + * + * @param Message $expected The first value to compare + * @param Message $actual The second value to compare + * @param float|int $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) + { + if ($expected->serializeToString() !== $actual->serializeToString()) { + throw new ComparisonFailure( + $expected, + $actual, + $this->exporter->shortenedExport($expected), + $this->exporter->shortenedExport($actual), + false, + 'Given 2 Message objects are not the same' + ); + } + } +} diff --git a/vendor/google/gax/src/Testing/ReceivedRequest.php b/vendor/google/gax/src/Testing/ReceivedRequest.php new file mode 100644 index 0000000..97cc1d2 --- /dev/null +++ b/vendor/google/gax/src/Testing/ReceivedRequest.php @@ -0,0 +1,79 @@ +actualCall = [ + 'funcCall' => $funcCall, + 'request' => $requestObject, + 'deserialize' => $deserialize, + 'metadata' => $metadata, + 'options' => $options, + ]; + } + + public function getArray() + { + return $this->actualCall; + } + + public function getFuncCall() + { + return $this->actualCall['funcCall']; + } + + public function getRequestObject() + { + return $this->actualCall['request']; + } + + public function getMetadata() + { + return $this->actualCall['metadata']; + } + + public function getOptions() + { + return $this->actualCall['options']; + } +} diff --git a/vendor/google/gax/src/Testing/SerializationTrait.php b/vendor/google/gax/src/Testing/SerializationTrait.php new file mode 100644 index 0000000..c703f0d --- /dev/null +++ b/vendor/google/gax/src/Testing/SerializationTrait.php @@ -0,0 +1,72 @@ +$deserializeFunc($message); + } elseif (is_string($message)) { + $obj->mergeFromString($message); + } + + return $obj; + } + + // Protobuf-PHP implementation + return call_user_func($deserialize, $message); + } +} diff --git a/vendor/google/gax/src/Testing/mocks.proto b/vendor/google/gax/src/Testing/mocks.proto new file mode 100644 index 0000000..314f131 --- /dev/null +++ b/vendor/google/gax/src/Testing/mocks.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package google.apicore.testing; + +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/wrappers.proto"; + +option php_namespace = "Google\\ApiCore\\Testing"; +option php_metadata_namespace = "GPBMetadata\\ApiCore\\Testing"; + +message MockRequest { + string page_token = 1; + uint64 page_size = 2; +} + +message MockResponse { + string name = 1; + uint64 number = 2; + repeated string resources_list = 3; + string next_page_token = 4; + map resources_map = 5; +} + +message MockRequestBody { + string name = 1; + uint64 number = 2; + repeated string repeated_field = 3; + MockRequestBody nested_message = 4; + google.protobuf.BytesValue bytes_value = 5; + google.protobuf.Duration duration_value = 6; + google.protobuf.FieldMask field_mask = 7; + google.protobuf.Int64Value int64_value = 8; + google.protobuf.ListValue list_value = 9; + google.protobuf.StringValue string_value = 10; + google.protobuf.Struct struct_value = 11; + google.protobuf.Timestamp timestamp_value = 12; + google.protobuf.Value value_value = 13; + oneof oneof_field { + string field_1 = 14; + string field_2 = 15; + string field_3 = 16; + } +} diff --git a/vendor/google/gax/src/Transport/Grpc/ForwardingCall.php b/vendor/google/gax/src/Transport/Grpc/ForwardingCall.php new file mode 100644 index 0000000..2ec4f73 --- /dev/null +++ b/vendor/google/gax/src/Transport/Grpc/ForwardingCall.php @@ -0,0 +1,90 @@ +innerCall = $innerCall; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + return $this->innerCall->getMetadata(); + } + + /** + * @return mixed The trailing metadata sent by the server + */ + public function getTrailingMetadata() + { + return $this->innerCall->getTrailingMetadata(); + } + + /** + * @return string The URI of the endpoint + */ + public function getPeer() + { + return $this->innerCall->getPeer(); + } + + /** + * Cancels the call. + */ + public function cancel() + { + $this->innerCall->cancel(); + } +} diff --git a/vendor/google/gax/src/Transport/Grpc/ForwardingServerStreamingCall.php b/vendor/google/gax/src/Transport/Grpc/ForwardingServerStreamingCall.php new file mode 100644 index 0000000..10e4ee7 --- /dev/null +++ b/vendor/google/gax/src/Transport/Grpc/ForwardingServerStreamingCall.php @@ -0,0 +1,65 @@ +innerCall->responses(); + } + + /** + * Wait for the server to send the status, and return it. + * + * @return \stdClass The status object, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + return $this->innerCall->getStatus(); + } +} diff --git a/vendor/google/gax/src/Transport/Grpc/ForwardingUnaryCall.php b/vendor/google/gax/src/Transport/Grpc/ForwardingUnaryCall.php new file mode 100644 index 0000000..81b0064 --- /dev/null +++ b/vendor/google/gax/src/Transport/Grpc/ForwardingUnaryCall.php @@ -0,0 +1,56 @@ +innerCall->wait(); + } +} diff --git a/vendor/google/gax/src/Transport/Grpc/ServerStreamingCallWrapper.php b/vendor/google/gax/src/Transport/Grpc/ServerStreamingCallWrapper.php new file mode 100644 index 0000000..bdf49d6 --- /dev/null +++ b/vendor/google/gax/src/Transport/Grpc/ServerStreamingCallWrapper.php @@ -0,0 +1,123 @@ +stream = $stream; + } + + /** + * {@inheritdoc} + */ + public function start($data, array $metadata = [], array $callOptions = []) + { + $this->stream->start($data, $metadata, $callOptions); + } + + /** + * {@inheritdoc} + */ + public function responses() + { + foreach ($this->stream->responses() as $response) { + yield $response; + } + } + + /** + * {@inheritdoc} + */ + public function getStatus() + { + return $this->stream->getStatus(); + } + + /** + * {@inheritdoc} + */ + public function getMetadata() + { + return $this->stream->getMetadata(); + } + + /** + * {@inheritdoc} + */ + public function getTrailingMetadata() + { + return $this->stream->getTrailingMetadata(); + } + + /** + * {@inheritdoc} + */ + public function getPeer() + { + return $this->stream->getPeer(); + } + + /** + * {@inheritdoc} + */ + public function cancel() + { + $this->stream->cancel(); + } + + /** + * {@inheritdoc} + */ + public function setCallCredentials($call_credentials) + { + $this->stream->setCallCredentials($call_credentials); + } +} diff --git a/vendor/google/gax/src/Transport/Grpc/UnaryInterceptorInterface.php b/vendor/google/gax/src/Transport/Grpc/UnaryInterceptorInterface.php new file mode 100644 index 0000000..fa510ea --- /dev/null +++ b/vendor/google/gax/src/Transport/Grpc/UnaryInterceptorInterface.php @@ -0,0 +1,61 @@ +baseUri = $baseUri; + $this->httpHandler = $httpHandler; + $this->transportName = 'grpc-fallback'; + } + + /** + * Builds a GrpcFallbackTransport. + * + * @param string $apiEndpoint + * The address of the API remote host, for example "example.googleapis.com". + * @param array $config { + * Config options used to construct the grpc-fallback transport. + * + * @type callable $httpHandler A handler used to deliver PSR-7 requests. + * } + * @return GrpcFallbackTransport + * @throws ValidationException + */ + public static function build(string $apiEndpoint, array $config = []) + { + $config += [ + 'httpHandler' => null, + 'clientCertSource' => null, + 'logger' => null, + ]; + list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint); + $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync(logger: $config['logger']); + $transport = new GrpcFallbackTransport("$baseUri:$port", $httpHandler); + if ($config['clientCertSource']) { + $transport->configureMtlsChannel($config['clientCertSource']); + } + return $transport; + } + + /** + * {@inheritdoc} + */ + public function startUnaryCall(Call $call, array $options) + { + $httpHandler = $this->httpHandler; + + $options['requestId'] = crc32((string) spl_object_id($call) . getmypid()); + + return $httpHandler( + $this->buildRequest($call, $options), + $this->getCallOptions($options) + )->then( + function (ResponseInterface $response) use ($options) { + if (isset($options['metadataCallback'])) { + $metadataCallback = $options['metadataCallback']; + $metadataCallback($response->getHeaders()); + } + return $response; + } + )->then( + function (ResponseInterface $response) use ($call) { + return $this->unpackResponse($call, $response); + }, + function (\Exception $ex) { + throw $this->transformException($ex); + } + ); + } + + /** + * @param Call $call + * @param array $options + * @return RequestInterface + */ + private function buildRequest(Call $call, array $options) + { + // Build common headers and set the content type to 'application/x-protobuf' + $headers = ['Content-Type' => 'application/x-protobuf'] + self::buildCommonHeaders($options); + + // It is necessary to supply 'grpc-web' in the 'x-goog-api-client' header + // when using the grpc-fallback protocol. + $headers += ['x-goog-api-client' => []]; + $headers['x-goog-api-client'][] = 'grpc-web'; + + // Uri format: https:///$rpc/ + $uri = "https://{$this->baseUri}/\$rpc/{$call->getMethod()}"; + + return new Request( + 'POST', + $uri, + $headers, + $call->getMessage()->serializeToString() + ); + } + + /** + * @param Call $call + * @param ResponseInterface $response + * @return Message + */ + private function unpackResponse(Call $call, ResponseInterface $response) + { + $decodeType = $call->getDecodeType(); + /** @var Message $responseMessage */ + $responseMessage = new $decodeType(); + $responseMessage->mergeFromString((string) $response->getBody()); + return $responseMessage; + } + + /** + * @param array $options + * @return array + */ + private function getCallOptions(array $options) + { + $callOptions = $options['transportOptions']['grpcFallbackOptions'] ?? []; + + if (isset($options['timeoutMillis'])) { + $callOptions['timeout'] = $options['timeoutMillis'] / 1000; + } + + if (isset($options['retryAttempt'])) { + $callOptions['retryAttempt'] = $options['retryAttempt']; + } + + if (isset($options['requestId'])) { + $callOptions['requestId'] = $options['requestId']; + } + + if ($this->clientCertSource) { + list($cert, $key) = self::loadClientCertSource($this->clientCertSource); + $callOptions['cert'] = $cert; + $callOptions['key'] = $key; + } + + return $callOptions; + } + + /** + * @param \Exception $ex + * @return \Exception + */ + private function transformException(\Exception $ex) + { + if ($ex instanceof RequestException && $ex->hasResponse()) { + $res = $ex->getResponse(); + $body = (string) $res->getBody(); + $status = new Status(); + try { + $status->mergeFromString($body); + return ApiException::createFromRpcStatus($status); + } catch (\Exception $parseException) { + // We were unable to parse the response body into a $status object. Instead, + // create an ApiException using the unparsed $body as message. + $code = ApiStatus::rpcCodeFromHttpStatusCode($res->getStatusCode()); + return ApiException::createFromApiResponse($body, $code, null, $parseException); + } + } else { + return $ex; + } + } +} diff --git a/vendor/google/gax/src/Transport/GrpcTransport.php b/vendor/google/gax/src/Transport/GrpcTransport.php new file mode 100644 index 0000000..5fd03a6 --- /dev/null +++ b/vendor/google/gax/src/Transport/GrpcTransport.php @@ -0,0 +1,366 @@ +logger = $logger; + } + + /** + * Builds a GrpcTransport. + * + * @param string $apiEndpoint + * The address of the API remote host, for example "example.googleapis.com. May also + * include the port, for example "example.googleapis.com:443" + * @param array $config { + * Config options used to construct the gRPC transport. + * + * @type array $stubOpts Options used to construct the gRPC stub (see + * {@link https://grpc.github.io/grpc/core/group__grpc__arg__keys.html}). + * @type Channel $channel Grpc channel to be used. + * @type Interceptor[]|UnaryInterceptorInterface[] $interceptors *EXPERIMENTAL* + * Interceptors used to intercept RPC invocations before a call starts. + * Please note that implementations of + * {@see \Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface} are + * considered deprecated and support will be removed in a future + * release. To prepare for this, please take the time to convert + * `UnaryInterceptorInterface` implementations over to a class which + * extends {@see Grpc\Interceptor}. + * @type callable $clientCertSource A callable which returns the client cert as a string. + * } + * @return GrpcTransport + * @throws ValidationException + */ + public static function build(string $apiEndpoint, array $config = []) + { + self::validateGrpcSupport(); + $config += [ + 'stubOpts' => [], + 'channel' => null, + 'interceptors' => [], + 'clientCertSource' => null, + 'logger' => null, + ]; + list($addr, $port) = self::normalizeServiceAddress($apiEndpoint); + $host = "$addr:$port"; + $stubOpts = $config['stubOpts']; + // Set the required 'credentials' key in stubOpts if it is not already set. Use + // array_key_exists because null is a valid value. + if (!array_key_exists('credentials', $stubOpts)) { + if (isset($config['clientCertSource'])) { + list($cert, $key) = self::loadClientCertSource($config['clientCertSource']); + $stubOpts['credentials'] = ChannelCredentials::createSsl(null, $key, $cert); + } else { + $stubOpts['credentials'] = ChannelCredentials::createSsl(); + } + } + $channel = $config['channel']; + if (!is_null($channel) && !($channel instanceof Channel)) { + throw new ValidationException( + "Channel argument to GrpcTransport must be of type \Grpc\Channel, " . + 'instead got: ' . print_r($channel, true) + ); + } + try { + if ($config['logger'] === false) { + $config['logger'] = null; + } + return new GrpcTransport($host, $stubOpts, $channel, $config['interceptors'], $config['logger']); + } catch (Exception $ex) { + throw new ValidationException( + 'Failed to build GrpcTransport: ' . $ex->getMessage(), + $ex->getCode(), + $ex + ); + } + } + + /** + * {@inheritdoc} + */ + public function startBidiStreamingCall(Call $call, array $options) + { + $this->verifyUniverseDomain($options); + + $bidiStream = new BidiStream( + $this->_bidiRequest( + '/' . $call->getMethod(), + [$call->getDecodeType(), 'decode'], + isset($options['headers']) ? $options['headers'] : [], + $this->getCallOptions($options) + ), + $call->getDescriptor(), + $this->logger + ); + + if ($this->logger) { + $requestEvent = new RpcLogEvent(); + + $requestEvent->headers = $options['headers'] ?? []; + $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; + $requestEvent->serviceName = $options['serviceName'] ?? null; + $requestEvent->rpcName = $call->getMethod(); + $requestEvent->processId = (int) getmypid(); + $requestEvent->requestId = crc32((string) spl_object_id($bidiStream) . getmypid()); + + $this->logRequest($requestEvent); + } + + return $bidiStream; + } + + /** + * {@inheritdoc} + */ + public function startClientStreamingCall(Call $call, array $options) + { + + $this->verifyUniverseDomain($options); + + return new ClientStream( + $this->_clientStreamRequest( + '/' . $call->getMethod(), + [$call->getDecodeType(), 'decode'], + isset($options['headers']) ? $options['headers'] : [], + $this->getCallOptions($options) + ), + $call->getDescriptor(), + $this->logger + ); + } + + /** + * {@inheritdoc} + */ + public function startServerStreamingCall(Call $call, array $options) + { + $this->verifyUniverseDomain($options); + + $message = $call->getMessage(); + + if (!$message) { + throw new \InvalidArgumentException('A message is required for ServerStreaming calls.'); + } + + // This simultaenously creates and starts a \Grpc\ServerStreamingCall. + $stream = $this->_serverStreamRequest( + '/' . $call->getMethod(), + $message, + [$call->getDecodeType(), 'decode'], + isset($options['headers']) ? $options['headers'] : [], + $this->getCallOptions($options) + ); + + $serverStream = new ServerStream( + new ServerStreamingCallWrapper($stream), + $call->getDescriptor(), + $this->logger + ); + + if ($this->logger) { + $requestEvent = new RpcLogEvent(); + + $requestEvent->headers = $options['headers']; + $requestEvent->payload = $call->getMessage()->serializeToJsonString(); + $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; + $requestEvent->serviceName = $options['serviceName'] ?? null; + $requestEvent->rpcName = $call->getMethod(); + $requestEvent->processId = (int) getmypid(); + $requestEvent->requestId = crc32((string) spl_object_id($serverStream) . getmypid()); + + $this->logRequest($requestEvent); + } + + return $serverStream; + } + + /** + * {@inheritdoc} + */ + public function startUnaryCall(Call $call, array $options) + { + $this->verifyUniverseDomain($options); + $headers = $options['headers'] ?? []; + $requestEvent = null; + + $unaryCall = $this->_simpleRequest( + '/' . $call->getMethod(), + $call->getMessage(), + [$call->getDecodeType(), 'decode'], + isset($options['headers']) ? $options['headers'] : [], + $this->getCallOptions($options) + ); + + if ($this->logger) { + $requestEvent = new RpcLogEvent(); + + $requestEvent->headers = $headers; + $requestEvent->payload = $call->getMessage()->serializeToJsonString(); + $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; + $requestEvent->serviceName = $options['serviceName'] ?? null; + $requestEvent->rpcName = $call->getMethod(); + $requestEvent->processId = (int) getmypid(); + $requestEvent->requestId = crc32((string) spl_object_id($call) . getmypid()); + + $this->logRequest($requestEvent); + } + + /** @var Promise $promise */ + $promise = new Promise( + function () use ($unaryCall, $options, &$promise, $requestEvent) { + list($response, $status) = $unaryCall->wait(); + + if ($this->logger) { + $responseEvent = new RpcLogEvent($requestEvent->milliseconds); + + $responseEvent->headers = $status->metadata; + $responseEvent->payload = ($response) ? $response->serializeToJsonString() : null; + $responseEvent->status = $status->code; + $responseEvent->processId = $requestEvent->processId; + $responseEvent->requestId = $requestEvent->requestId; + + $this->logResponse($responseEvent); + } + + if ($status->code == Code::OK) { + if (isset($options['metadataCallback'])) { + $metadataCallback = $options['metadataCallback']; + $metadataCallback($unaryCall->getMetadata()); + } + $promise->resolve($response); + } else { + throw ApiException::createFromStdClass($status); + } + }, + [$unaryCall, 'cancel'] + ); + + return $promise; + } + + private function verifyUniverseDomain(array $options) + { + if (isset($options['credentialsWrapper'])) { + $options['credentialsWrapper']->checkUniverseDomain(); + } + } + + private function getCallOptions(array $options) + { + $callOptions = $options['transportOptions']['grpcOptions'] ?? []; + + if (isset($options['credentialsWrapper'])) { + $audience = $options['audience'] ?? null; + $credentialsWrapper = $options['credentialsWrapper']; + $callOptions['call_credentials_callback'] = $credentialsWrapper + ->getAuthorizationHeaderCallback($audience); + } + + if (isset($options['timeoutMillis'])) { + $callOptions['timeout'] = $options['timeoutMillis'] * 1000; + } + + return $callOptions; + } + + private static function loadClientCertSource(callable $clientCertSource) + { + return call_user_func($clientCertSource); + } +} diff --git a/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php b/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php new file mode 100644 index 0000000..38c4ca1 --- /dev/null +++ b/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php @@ -0,0 +1,171 @@ +throwUnsupportedException(); + } + + /** + * {@inheritdoc} + * @return never + * @throws \BadMethodCallException + */ + public function startServerStreamingCall(Call $call, array $options) + { + $this->throwUnsupportedException(); + } + + /** + * {@inheritdoc} + * @return never + * @throws \BadMethodCallException + */ + public function startBidiStreamingCall(Call $call, array $options) + { + $this->throwUnsupportedException(); + } + + /** + * {@inheritdoc} + */ + public function close() + { + // Nothing to do. + } + + /** + * @param array $options + * @return array + */ + private static function buildCommonHeaders(array $options) + { + $headers = $options['headers'] ?? []; + + if (!is_array($headers)) { + throw new \InvalidArgumentException( + 'The "headers" option must be an array' + ); + } + + // If not already set, add an auth header to the request + if (!isset($headers['Authorization']) && isset($options['credentialsWrapper'])) { + $credentialsWrapper = $options['credentialsWrapper']; + $audience = $options['audience'] ?? null; + $callback = $credentialsWrapper + ->getAuthorizationHeaderCallback($audience); + // Prevent unexpected behavior, as the authorization header callback + // uses lowercase "authorization" + unset($headers['authorization']); + // Mitigate scenario where InsecureCredentialsWrapper returns null. + $authHeaders = empty($callback) ? [] : $callback(); + if (!is_array($authHeaders)) { + throw new \UnexpectedValueException( + 'Expected array response from authorization header callback' + ); + } + $headers += $authHeaders; + } + + return $headers; + } + + /** + * @return callable + * @throws ValidationException + */ + private static function buildHttpHandlerAsync(null|false|LoggerInterface $logger = null) + { + try { + return [HttpHandlerFactory::build(logger: $logger), 'async']; + } catch (Exception $ex) { + throw new ValidationException('Failed to build HttpHandler', $ex->getCode(), $ex); + } + } + + /** + * Set the path to a client certificate. + * + * @param callable $clientCertSource + */ + private function configureMtlsChannel(callable $clientCertSource) + { + $this->clientCertSource = $clientCertSource; + } + + /** + * @return never + * @throws \BadMethodCallException + */ + private function throwUnsupportedException() + { + throw new \BadMethodCallException( + "Streaming calls are not supported while using the {$this->transportName} transport." + ); + } + + private static function loadClientCertSource(callable $clientCertSource) + { + $certFile = tempnam(sys_get_temp_dir(), 'cert'); + $keyFile = tempnam(sys_get_temp_dir(), 'key'); + list($cert, $key) = call_user_func($clientCertSource); + file_put_contents($certFile, $cert); + file_put_contents($keyFile, $key); + + // the key and the cert are returned in one temporary file + return [$certFile, $keyFile]; + } +} diff --git a/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php b/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php new file mode 100644 index 0000000..c01f211 --- /dev/null +++ b/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php @@ -0,0 +1,238 @@ + $options { + * An array of optional arguments. + * + * @type bool $ignoreUnknown + * Toggles whether or not to throw an exception when an unknown field + * is encountered in a response message. The default is true. + * @type int $readChunkSizeBytes + * The upper size limit in bytes that can be read at a time from the + * response stream. The default is 1 KB. + * } + * + * @experimental + */ + public function __construct(StreamInterface $stream, string $decodeType, array $options = []) + { + $this->stream = $stream; + $this->decodeType = $decodeType; + + if (isset($options['ignoreUnknown'])) { + $this->ignoreUnknown = $options['ignoreUnknown']; + } + if (isset($options['readChunkSize'])) { + $this->readChunkSize = $options['readChunkSizeBytes']; + } + } + + /** + * Begins decoding the configured response stream. It is a generator which + * yields messages of the given decode type from the stream until the stream + * completes. Throws an Exception if the stream is closed before the closing + * byte is read or if it encounters an error while decoding a message. + * + * @throws RuntimeException + * @return \Generator + */ + public function decode() + { + try { + foreach ($this->_decode() as $response) { + yield $response; + } + } catch (RuntimeException $re) { + $msg = $re->getMessage(); + $streamClosedException = + strpos($msg, 'Stream is detached') !== false || + strpos($msg, 'Unexpected stream close') !== false; + + // Only throw the exception if close() was not called and it was not + // a closing-related exception. + if (!$this->closeCalled || !$streamClosedException) { + throw $re; + } + } + } + + /** + * @return \Generator + */ + private function _decode() + { + $decodeType = $this->decodeType; + $str = false; + $prev = $chunk = ''; + $start = $end = $cursor = $level = 0; + while ($chunk !== '' || !$this->stream->eof()) { + // Read up to $readChunkSize bytes from the stream. + $chunk .= $this->stream->read($this->readChunkSize); + + // If the response stream has been closed and the only byte + // remaining is the closing array bracket, we are done. + if ($this->stream->eof() && $chunk === ']') { + $level--; + break; + } + + // Parse the freshly read data available in $chunk. + $chunkLength = strlen($chunk); + while ($cursor < $chunkLength) { + // Access the next byte for processing. + $b = $chunk[$cursor]; + + // Track open/close double quotes of a key or value. Do not + // toggle flag with the pervious byte was an escape character. + if ($b === '"' && $prev !== self::ESCAPE_CHAR) { + $str = !$str; + } + + // Skip over new lines that break up items. + if ($b === "\n" && $level === 1) { + $start++; + } + + // Ignore commas separating messages in the stream array. + if ($b === ',' && $level === 1) { + $start++; + } + // Track the opening of a new array or object if not in a string + // value. + if (($b === '{' || $b === '[') && !$str) { + $level++; + // Opening of the array/root object. + // Do not include it in the messageBuffer. + if ($level === 1) { + $start++; + } + } + // Track the closing of an object if not in a string value. + if ($b === '}' && !$str) { + $level--; + if ($level === 1) { + $end = $cursor + 1; + } + } + // Track the closing of an array if not in a string value. + if ($b === ']' && !$str) { + $level--; + // If we are seeing a closing square bracket at the + // response message level, e.g. {"foo], there is a problem. + if ($level === 1) { + throw new \RuntimeException('Received closing byte mid-message'); + } + } + + // A message-closing byte was just buffered. Decode the + // message with the decode type, clearing the messageBuffer, + // and yield it. + // + // TODO(noahdietz): Support google.protobuf.*Value messages that + // are encoded as primitives and separated by commas. + if ($end !== 0) { + $length = $end - $start; + /** @var \Google\Protobuf\Internal\Message $return */ + $return = new $decodeType(); + $return->mergeFromJsonString( + substr($chunk, $start, $length), + $this->ignoreUnknown + ); + yield $return; + + // Dump the part of the chunk used for parsing the message + // and use the remaining for the next message. + $remaining = $chunkLength - $length; + $chunk = substr($chunk, $end, $remaining); + + // Reset all indices and exit chunk processing. + $start = 0; + $end = 0; + $cursor = 0; + break; + } + + $cursor++; + + // An escaped back slash should not escape the following character. + if ($b === self::ESCAPE_CHAR && $prev === self::ESCAPE_CHAR) { + $b = ''; + } + $prev = $b; + } + // If after attempting to process the chunk, no progress was made and the + // stream is closed, we must break as the stream has closed prematurely. + if ($cursor === $chunkLength && $this->stream->eof()) { + break; + } + } + if ($level > 0) { + throw new \RuntimeException('Unexpected stream close before receiving the closing byte'); + } + } + + /** + * Closes the underlying stream. If the stream is actively being decoded, an + * exception will not be thrown due to the interruption. + * + * @return void + */ + public function close() + { + $this->closeCalled = true; + $this->stream->close(); + } +} diff --git a/vendor/google/gax/src/Transport/Rest/RestServerStreamingCall.php b/vendor/google/gax/src/Transport/Rest/RestServerStreamingCall.php new file mode 100644 index 0000000..35d7961 --- /dev/null +++ b/vendor/google/gax/src/Transport/Rest/RestServerStreamingCall.php @@ -0,0 +1,197 @@ + */ + private array $decoderOptions; + + private RequestInterface $originalRequest; + private ?JsonStreamDecoder $decoder; + private string $decodeType; + private ?ResponseInterface $response; + private stdClass $status; + + /** + * @param callable $httpHandler + * @param string $decodeType + * @param array $decoderOptions + */ + public function __construct(callable $httpHandler, string $decodeType, array $decoderOptions) + { + $this->httpHandler = $httpHandler; + $this->decodeType = $decodeType; + $this->decoderOptions = $decoderOptions; + } + + /** + * {@inheritdoc} + */ + public function start($request, array $headers = [], array $callOptions = []) + { + $this->originalRequest = $this->appendHeaders($request, $headers); + + try { + $handler = $this->httpHandler; + $response = $handler( + $this->originalRequest, + $callOptions + )->wait(); + } catch (\Exception $ex) { + if ($ex instanceof RequestException && $ex->hasResponse()) { + $ex = ApiException::createFromRequestException($ex, /* isStream */ true); + } + throw $ex; + } + + // Create an OK Status for a successful request just so that it + // has a return value. + $this->status = new stdClass(); + $this->status->code = Code::OK; + $this->status->message = ApiStatus::OK; + $this->status->details = []; + + $this->response = $response; + } + + /** + * @param RequestInterface $request + * @param array $headers + * @return RequestInterface + */ + private function appendHeaders(RequestInterface $request, array $headers) + { + foreach ($headers as $key => $value) { + $request = $request->hasHeader($key) ? + $request->withAddedHeader($key, $value) : + $request->withHeader($key, $value); + } + + return $request; + } + + /** + * {@inheritdoc} + */ + public function responses() + { + if (is_null($this->response)) { + throw new \Exception('Stream has not been started.'); + } + + // Decode the stream and yield responses as they are read. + $this->decoder = new JsonStreamDecoder( + $this->response->getBody(), + $this->decodeType, + $this->decoderOptions + ); + + foreach ($this->decoder->decode() as $message) { + yield $message; + } + } + + /** + * Return the status of the server stream. If the call has not been started + * this will be null. + * + * @return stdClass The status, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + return $this->status; + } + + /** + * {@inheritdoc} + */ + public function getMetadata() + { + return is_null($this->response) ? null : $this->response->getHeaders(); + } + + /** + * The Rest transport does not support trailing metadata. This is a + * passthrough to getMetadata(). + */ + public function getTrailingMetadata() + { + return $this->getMetadata(); + } + + /** + * {@inheritdoc} + */ + public function getPeer() + { + return $this->originalRequest->getUri(); + } + + /** + * {@inheritdoc} + */ + public function cancel() + { + if (!is_null($this->decoder)) { + $this->decoder->close(); + } + } + + /** + * For the REST transport this is a no-op. + * {@inheritdoc} + */ + public function setCallCredentials($call_credentials) + { + // Do nothing. + } +} diff --git a/vendor/google/gax/src/Transport/RestTransport.php b/vendor/google/gax/src/Transport/RestTransport.php new file mode 100644 index 0000000..296937f --- /dev/null +++ b/vendor/google/gax/src/Transport/RestTransport.php @@ -0,0 +1,283 @@ +requestBuilder = $requestBuilder; + $this->httpHandler = $httpHandler; + $this->transportName = 'REST'; + } + + /** + * Builds a RestTransport. + * + * @param string $apiEndpoint + * The address of the API remote host, for example "example.googleapis.com". + * @param string $restConfigPath + * Path to rest config file. + * @param array $config { + * Config options used to construct the gRPC transport. + * + * @type callable $httpHandler A handler used to deliver PSR-7 requests. + * @type callable $clientCertSource A callable which returns the client cert as a string. + * @type bool $hasEmulator True if the emulator is enabled. + * } + * @return RestTransport + * @throws ValidationException + */ + public static function build(string $apiEndpoint, string $restConfigPath, array $config = []) + { + $config += [ + 'httpHandler' => null, + 'clientCertSource' => null, + 'hasEmulator' => false, + 'logger' => null, + ]; + list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint); + $requestBuilder = $config['hasEmulator'] + ? new InsecureRequestBuilder("$baseUri:$port", $restConfigPath) + : new RequestBuilder("$baseUri:$port", $restConfigPath); + $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync($config['logger']); + $transport = new RestTransport($requestBuilder, $httpHandler); + if ($config['clientCertSource']) { + $transport->configureMtlsChannel($config['clientCertSource']); + } + return $transport; + } + + /** + * {@inheritdoc} + */ + public function startUnaryCall(Call $call, array $options) + { + $headers = self::buildCommonHeaders($options); + + // Add the $call object ID for logging + $options['requestId'] = crc32((string) spl_object_id($call) . getmypid()); + + // call the HTTP handler + $httpHandler = $this->httpHandler; + return $httpHandler( + $this->requestBuilder->build( + $call->getMethod(), + $call->getMessage(), + $headers + ), + $this->getCallOptions($options) + )->then( + function (ResponseInterface $response) use ($call, $options) { + $decodeType = $call->getDecodeType(); + /** @var Message $return */ + $return = new $decodeType(); + $body = (string) $response->getBody(); + + // In some rare cases LRO response metadata may not be loaded + // in the descriptor pool, triggering an exception. The catch + // statement handles this case and attempts to add the LRO + // metadata type to the pool by directly instantiating the + // metadata class. + try { + $return->mergeFromJsonString( + $body, + true + ); + } catch (\Exception $ex) { + if (!isset($options['metadataReturnType'])) { + throw $ex; + } + + if (strpos($ex->getMessage(), 'Error occurred during parsing:') !== 0) { + throw $ex; + } + + new $options['metadataReturnType'](); + $return->mergeFromJsonString( + $body, + true + ); + } + + if (isset($options['metadataCallback'])) { + $metadataCallback = $options['metadataCallback']; + $metadataCallback($response->getHeaders()); + } + + return $return; + }, + function (\Throwable $ex) { + if ($ex instanceof RequestException && $ex->hasResponse()) { + throw ApiException::createFromRequestException($ex); + } + + throw $ex; + } + ); + } + + /** + * {@inheritdoc} + * @throws \BadMethodCallException for forwards compatibility with older GAPIC clients + */ + public function startServerStreamingCall(Call $call, array $options) + { + $message = $call->getMessage(); + if (!$message) { + throw new \InvalidArgumentException('A message is required for ServerStreaming calls.'); + } + + // Maintain forwards compatibility with older GAPIC clients not configured for REST server streaming + // @see https://github.com/googleapis/gax-php/issues/370 + if (!$this->requestBuilder->pathExists($call->getMethod())) { + $this->unsupportedServerStreamingCall($call, $options); + } + + $headers = self::buildCommonHeaders($options); + $callOptions = $this->getCallOptions($options); + $request = $this->requestBuilder->build( + $call->getMethod(), + $call->getMessage() + // Exclude headers here because they will be added in _serverStreamRequest(). + ); + + $decoderOptions = []; + if (isset($options['decoderOptions'])) { + $decoderOptions = $options['decoderOptions']; + } + + return new ServerStream( + $this->_serverStreamRequest( + $this->httpHandler, + $request, + $headers, + $call->getDecodeType(), + $callOptions, + $decoderOptions + ), + $call->getDescriptor() + ); + } + + /** + * Creates and starts a RestServerStreamingCall. + * + * @param callable $httpHandler The HTTP Handler to invoke the request with. + * @param RequestInterface $request The request to invoke. + * @param array $headers The headers to include in the request. + * @param string $decodeType The response stream message type to decode. + * @param array $callOptions The call options to use when making the call. + * @param array $decoderOptions The options to use for the JsonStreamDecoder. + * + * @return RestServerStreamingCall + */ + private function _serverStreamRequest( + $httpHandler, + $request, + $headers, + $decodeType, + $callOptions, + $decoderOptions = [] + ) { + $call = new RestServerStreamingCall( + $httpHandler, + $decodeType, + $decoderOptions + ); + $call->start($request, $headers, $callOptions); + + return $call; + } + + /** + * @param array $options + * + * @return array + */ + private function getCallOptions(array $options) + { + $callOptions = $options['transportOptions']['restOptions'] ?? []; + + if (isset($options['timeoutMillis'])) { + $callOptions['timeout'] = $options['timeoutMillis'] / 1000; + } + + if ($this->clientCertSource) { + list($cert, $key) = self::loadClientCertSource($this->clientCertSource); + $callOptions['cert'] = $cert; + $callOptions['key'] = $key; + } + + if (isset($options['retryAttempt'])) { + $callOptions['retryAttempt'] = $options['retryAttempt']; + } + + if (isset($options['requestId'])) { + $callOptions['requestId'] = $options['requestId']; + } + + return $callOptions; + } +} diff --git a/vendor/google/gax/src/Transport/TransportInterface.php b/vendor/google/gax/src/Transport/TransportInterface.php new file mode 100644 index 0000000..682a430 --- /dev/null +++ b/vendor/google/gax/src/Transport/TransportInterface.php @@ -0,0 +1,91 @@ + $options + * + * @return BidiStream + */ + public function startBidiStreamingCall(Call $call, array $options); + + /** + * Starts a client streaming call. + * + * @param Call $call + * @param array $options + * + * @return ClientStream + */ + public function startClientStreamingCall(Call $call, array $options); + + /** + * Starts a server streaming call. + * + * @param Call $call + * @param array $options + * + * @return ServerStream + */ + public function startServerStreamingCall(Call $call, array $options); + + /** + * Returns a promise used to execute network requests. + * + * @param Call $call + * @param array $options + * + * @return PromiseInterface + * @throws ValidationException + */ + public function startUnaryCall(Call $call, array $options); + + /** + * Closes the connection, if one exists. + * + * @return void + */ + public function close(); +} diff --git a/vendor/google/gax/src/UriTrait.php b/vendor/google/gax/src/UriTrait.php new file mode 100644 index 0000000..d3fc6aa --- /dev/null +++ b/vendor/google/gax/src/UriTrait.php @@ -0,0 +1,69 @@ + &$v) { + if (is_bool($v)) { + $v = $v ? 'true' : 'false'; + } + } + + return Utils::uriFor($uri) + ->withQuery( + Query::build($query) + ); + } +} diff --git a/vendor/google/gax/src/ValidationException.php b/vendor/google/gax/src/ValidationException.php new file mode 100644 index 0000000..27a66a8 --- /dev/null +++ b/vendor/google/gax/src/ValidationException.php @@ -0,0 +1,41 @@ +setRules([ + '@PSR2' => true, + 'concat_space' => ['spacing' => 'one'], + 'no_unused_imports' => true, + 'method_argument_space' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->notPath('firestore') + ->in(__DIR__) + ) +; + diff --git a/vendor/google/grpc-gcp/LICENSE b/vendor/google/grpc-gcp/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/google/grpc-gcp/LICENSE @@ -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 [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. diff --git a/vendor/google/grpc-gcp/README.md b/vendor/google/grpc-gcp/README.md new file mode 100644 index 0000000..4d49b4e --- /dev/null +++ b/vendor/google/grpc-gcp/README.md @@ -0,0 +1,14 @@ +# gRPC for GCP extensions + +Copyright 2018 +[The gRPC Authors](https://github.com/grpc/grpc/blob/master/AUTHORS) + +## About This Repository + +This repo is created to support GCP specific extensions for gRPC. To use the extension features, please refer to [src](src). + +This repo also contains supporting infrastructures such as end2end tests and benchmarks for accessing cloud APIs with gRPC client libraries. + +## License + +Apache 2.0 - See [LICENSE](LICENSE) for more information. diff --git a/vendor/google/grpc-gcp/cloudprober/bins/opt/grpc_php_plugin b/vendor/google/grpc-gcp/cloudprober/bins/opt/grpc_php_plugin new file mode 100755 index 0000000..a0e24c9 Binary files /dev/null and b/vendor/google/grpc-gcp/cloudprober/bins/opt/grpc_php_plugin differ diff --git a/vendor/google/grpc-gcp/cloudprober/cloudprober.cfg b/vendor/google/grpc-gcp/cloudprober/cloudprober.cfg new file mode 100644 index 0000000..4a5270b --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/cloudprober.cfg @@ -0,0 +1,31 @@ +probe { + type: EXTERNAL + name: "spanner" + interval_msec: 1800000 + timeout_msec: 30000 + targets { dummy_targets {} } # No targets for external probe + external_probe { + mode: ONCE + command: "php grpc_gpc_prober/prober.php --api=spanner" + } +} + +probe { + type: EXTERNAL + name: "firestore" + interval_msec: 1800000 + timeout_msec: 30000 + targets { dummy_targets {} } # No targets for external probe + external_probe { + mode: ONCE + command: "php grpc_gpc_prober/prober.php --api=firestore" + } +} + +surfacer { + type: STACKDRIVER + name: "stackdriver" + stackdriver_surfacer { + monitoring_url: "custom.googleapis.com/cloudprober/" + } +} diff --git a/vendor/google/grpc-gcp/cloudprober/codegen.sh b/vendor/google/grpc-gcp/cloudprober/codegen.sh new file mode 100755 index 0000000..89ec533 --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/codegen.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +cd "$(dirname "$0")" + +rm -rf google + +for p in $(find ../third_party/googleapis/google -type f -name *.proto); do + protoc \ + --proto_path=../third_party/googleapis \ + --php_out=./ \ + --grpc_out=./ \ + --plugin=protoc-gen-grpc="$(which grpc_php_plugin)" \ + "$p" +done diff --git a/vendor/google/grpc-gcp/cloudprober/composer.json b/vendor/google/grpc-gcp/cloudprober/composer.json new file mode 100644 index 0000000..cf25539 --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/composer.json @@ -0,0 +1,9 @@ +{ + "name": "grpc_gcp_prober", + "description": "grpc cloudprober for PHP", + "require": { + "grpc/grpc": "^v1.15.0", + "google/auth": "^v1.4.0", + "google/cloud": "^v0.86.0" + } +} diff --git a/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/firestore_probes.php b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/firestore_probes.php new file mode 100644 index 0000000..7024004 --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/firestore_probes.php @@ -0,0 +1,33 @@ +setParent($_PARENT_RESOURCE); + $time_start = microtime_float(); + + $client->ListDocuments($list_document_request); + + $lantency = (microtime_float()- $time_start) * 1000; + $metrics['list_documents_latency_ms'] = $lantency; + +} + +$probFunctions = [ + 'documents' => 'document' +]; + +return $probFunctions; \ No newline at end of file diff --git a/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/prober.php b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/prober.php new file mode 100644 index 0000000..f7085a1 --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/prober.php @@ -0,0 +1,102 @@ +AuthMetadataPlugin($credentials, $request); + $ssl_credentials = Grpc\ChannelCredentials::createSsl(); + $composit_credentials = $grpc->composite_channel_credentials($ssl_credentials, $google_auth_credentials); + return $grpc_gcp->secure_channel($target, $composit_credentials, $kwargs); +} + +function getStubChannel($target){ + $res = $auth->default([$_OAUTH_SCOPE]); + $cred = $res[0]; + return secureAuthorizedChannel($cred, Request(), $target); +}*/ + +function executeProbes($api){ + global $_OAUTH_SCOPE; + global $_SPANNER_TARGET; + global $_FIRESTORE_TARGET; + + global $spanner_probes; + global $firestore_probes; + + $util = new StackdriverUtil($api); + $auth = Google\Auth\ApplicationDefaultCredentials::getCredentials($_OAUTH_SCOPE); + $opts = [ + 'credentials' => Grpc\ChannelCredentials::createSsl(), + 'update_metadata' => $auth->getUpdateMetadataFunc(), + ]; + + if($api == 'spanner'){ + $client = new SpannerGrpcClient($_SPANNER_TARGET, $opts); + $probe_functions = $spanner_probes; + } + else if($api == 'firestore'){ + $client = new FirestoreGrpcClient($_FIRESTORE_TARGET, $opts); + $probe_functions = $firestore_probes; + } + else{ + echo 'grpc not implemented for '.$api; + exit(1); + } + + $total = sizeof($probe_functions); + $success = 0; + $metrics = []; + + # Execute all probes for given api + foreach ($probe_functions as $probe_name => $probe_function) { + try{ + $probe_function($client, $metrics); + $success++; + } + catch(Exception $e){ + $util->reportError($e); + } + + } + + if($success == $total){ + $util->setSuccess(True); + } + + $util->addMetrics($metrics); + $util->outputMetrics(); + + if($success != $total){ + # TODO: exit system + exit(1); + } + +} + +function main(){ + $args = getArgs(); + executeProbes($args['api']); +} + +main(); diff --git a/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/spanner_probes.php b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/spanner_probes.php new file mode 100644 index 0000000..5b8c915 --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/spanner_probes.php @@ -0,0 +1,307 @@ +code !== Grpc\STATUS_OK) { + echo "Call did not complete successfully. Status object:\n"; + var_dump($status); + exit(1); + } +} + +function microtime_float() +{ + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); +} + +/* +Probes to test session related grpc call from Spanner stub. + + Includes tests against CreateSession, GetSession, ListSessions, and + DeleteSession of Spanner stub. + + Args: + stub: An object of SpannerStub. + metrics: A list of metrics. + +*/ + +function sessionManagement($client, &$metrics){ + global $_DATABASE; + + $createSessionRequest = new Google\Cloud\Spanner\V1\CreateSessionRequest(); + $createSessionRequest->setDatabase($_DATABASE); + #Create Session test + #Create + $time_start = microtime_float(); + list($session, $status) = $client->CreateSession($createSessionRequest)->wait(); + + hardAssertIfStatusOk($status); + hardAssert($session !== null, 'Call completed with a null response'); + + $lantency = (microtime_float()- $time_start) * 1000; + $metrics['create_session_latency_ms'] = $lantency; + + #Get Session + $getSessionRequest = new Google\Cloud\Spanner\V1\GetSessionRequest(); + $getSessionRequest->setName($session->getName()); + $time_start = microtime_float(); + $response = $client->GetSession($getSessionRequest); + $response->wait(); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['get_session_latency_ms'] = $lantency; + + #List session + $listSessionsRequest = new Google\Cloud\Spanner\V1\ListSessionsRequest(); + $listSessionsRequest->setDatabase($_DATABASE); + $time_start = microtime_float(); + $response = $client->ListSessions($listSessionsRequest); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['list_sessions_latency_ms'] = $lantency; + + #Delete session + $deleteSessionRequest = new Google\Cloud\Spanner\V1\DeleteSessionRequest(); + $deleteSessionRequest->setName($session->getName()); + $time_start = microtime_float(); + $client->deleteSession($deleteSessionRequest); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['delete_session_latency_ms'] = $lantency; + +} + +/* +Probes to test ExecuteSql and ExecuteStreamingSql call from Spanner stub. + + Args: + stub: An object of SpannerStub. + metrics: A list of metrics. + +*/ +function executeSql($client, &$metrics){ + global $_DATABASE; + + $createSessionRequest = new Google\Cloud\Spanner\V1\CreateSessionRequest(); + $createSessionRequest->setDatabase($_DATABASE); + list($session, $status) = $client->CreateSession($createSessionRequest)->wait(); + + hardAssertIfStatusOk($status); + hardAssert($session !== null, 'Call completed with a null response'); + + # Probing ExecuteSql call + $time_start = microtime_float(); + $executeSqlRequest = new Google\Cloud\Spanner\V1\ExecuteSqlRequest(); + $executeSqlRequest->setSession($session->getName()); + $executeSqlRequest->setSql('select * FROM users'); + $result_set = $client->ExecuteSql($executeSqlRequest); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['execute_sql_latency_ms'] = $lantency; + + // TODO: Error check result_set + + # Probing ExecuteStreamingSql call + $partial_result_set = $client->ExecuteStreamingSql($executeSqlRequest); + + $time_start = microtime_float(); + $first_result = array_values($partial_result_set->getMetadata())[0]; + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['execute_streaming_sql_latency_ms'] = $lantency; + + // TODO: Error Check for sreaming sql first result + + $deleteSessionRequest = new Google\Cloud\Spanner\V1\DeleteSessionRequest(); + $deleteSessionRequest->setName($session->getName()); + $client->deleteSession($deleteSessionRequest); +} + +/* +Probe to test Read and StreamingRead grpc call from Spanner stub. + + Args: + stub: An object of SpannerStub. + metrics: A list of metrics. +*/ + +function read($client, &$metrics){ + global $_DATABASE; + + $createSessionRequest = new Google\Cloud\Spanner\V1\CreateSessionRequest(); + $createSessionRequest->setDatabase($_DATABASE); + list($session, $status) = $client->CreateSession($createSessionRequest)->wait(); + + hardAssertIfStatusOk($status); + hardAssert($session !== null, 'Call completed with a null response'); + + # Probing Read call + $time_start = microtime_float(); + $readRequest = new Google\Cloud\Spanner\V1\ReadRequest(); + $readRequest->setSession($session->getName()); + $readRequest->setTable('users'); + $readRequest->setColumns(['username', 'firstname', 'lastname']); + $keyset = new Google\Cloud\Spanner\V1\KeySet(); + $keyset->setAll(True); + $readRequest->setKeySet($keyset); + $result_set = $client->Read($readRequest); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['read_latency_ms'] = $lantency; + + // TODO: Error Check for result_set + + # Probing StreamingRead call + $partial_result_set = $client->StreamingRead($readRequest); + $time_start = microtime_float(); + $first_result = array_values($partial_result_set->getMetadata())[0]; + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['streaming_read_latency_ms'] = $lantency; + + //TODO: Error Check for streaming read first result + + $deleteSessionRequest = new Google\Cloud\Spanner\V1\DeleteSessionRequest(); + $deleteSessionRequest->setName($session->getName()); + $client->deleteSession($deleteSessionRequest); +} + +/* +Probe to test BeginTransaction, Commit and Rollback grpc from Spanner stub. + + Args: + stub: An object of SpannerStub. + metrics: A list of metrics. +*/ + +function transaction($client, &$metrics){ + global $_DATABASE; + + $createSessionRequest = new Google\Cloud\Spanner\V1\CreateSessionRequest(); + $createSessionRequest->setDatabase($_DATABASE); + list($session, $status) = $client->CreateSession($createSessionRequest)->wait(); + + hardAssertIfStatusOk($status); + hardAssert($session !== null, 'Call completed with a null response'); + + $txn_options = new Google\Cloud\Spanner\V1\TransactionOptions(); + $rw = new Google\Cloud\Spanner\V1\TransactionOptions\ReadWrite(); + $txn_options->setReadWrite($rw); + $txn_request = new Google\Cloud\Spanner\V1\BeginTransactionRequest(); + $txn_request->setSession($session->getName()); + $txn_request->setOptions($txn_options); + + # Probing BeginTransaction call + $time_start = microtime_float(); + list($txn, $status) = $client->BeginTransaction($txn_request)->wait(); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['begin_transaction_latency_ms'] = $lantency; + + hardAssertIfStatusOk($status); + hardAssert($txn !== null, 'Call completed with a null response'); + + # Probing Commit Call + $commit_request = new Google\Cloud\Spanner\V1\CommitRequest(); + $commit_request->setSession($session->getName()); + $commit_request->setTransactionId($txn->getId()); + + $time_start = microtime_float(); + $client->Commit($commit_request); + $latency = (microtime_float() - $time_start) * 1000; + $metrics['commit_latency_ms'] = $lantency; + + # Probing Rollback call + list($txn, $status) = $client->BeginTransaction($txn_request)->wait(); + $rollback_request = new Google\Cloud\Spanner\V1\RollbackRequest(); + $rollback_request->setSession($session->getName()); + $rollback_request->setTransactionId($txn->getId()); + + hardAssertIfStatusOk($status); + hardAssert($txn !== null, 'Call completed with a null response'); + + $time_start = microtime_float(); + $client->Rollback($rollback_request); + $latency = (microtime_float() - $time_start) * 1000; + $metrics['rollback_latency_ms'] = $latency; + + $deleteSessionRequest = new Google\Cloud\Spanner\V1\DeleteSessionRequest(); + $deleteSessionRequest->setName($session->getName()); + $client->deleteSession($deleteSessionRequest); +} + +/* +Probe to test PartitionQuery and PartitionRead grpc call from Spanner stub. + + Args: + stub: An object of SpannerStub. + metrics: A list of metrics. +*/ + +function partition($client, &$metrics){ + global $_DATABASE; + global $_TEST_USERNAME; + + $createSessionRequest = new Google\Cloud\Spanner\V1\CreateSessionRequest(); + $createSessionRequest->setDatabase($_DATABASE); + list($session, $status) = $client->CreateSession($createSessionRequest)->wait(); + + hardAssertIfStatusOk($status); + hardAssert($session !== null, 'Call completed with a null response'); + + $txn_options = new Google\Cloud\Spanner\V1\TransactionOptions(); + $ro = new Google\Cloud\Spanner\V1\TransactionOptions\PBReadOnly(); + $txn_options->setReadOnly($ro); + $txn_selector = new Google\Cloud\Spanner\V1\TransactionSelector(); + $txn_selector->setBegin($txn_options); + + #Probing PartitionQuery call + $ptn_query_request = new Google\Cloud\Spanner\V1\PartitionQueryRequest(); + $ptn_query_request->setSession($session->getName()); + $ptn_query_request->setSql('select * FROM users'); + $ptn_query_request->setTransaction($txn_selector); + + $time_start = microtime_float(); + $client->PartitionQuery($ptn_query_request); + $lantency = (microtime_float() - $time_start) * 1000; + $metrics['partition_query_latency_ms'] = $lantency; + + #Probing PartitionRead call + $ptn_read_request = new Google\Cloud\Spanner\V1\PartitionReadRequest(); + $ptn_read_request->setSession($session->getName()); + $ptn_read_request->setTable('users'); + $ptn_read_request->setTransaction($txn_selector); + $keyset = new Google\Cloud\Spanner\V1\KeySet(); + $keyset->setAll(True); + $ptn_read_request->setKeySet($keyset); + $ptn_read_request->setColumns(['username', 'firstname', 'lastname']); + + $time_start = microtime_float(); + $client->PartitionRead($ptn_read_request); + $latency = (microtime_float() - $time_start) * 1000; + $metrics['partition_read_latency_ms'] = $latency; + + # Delete Session + $deleteSessionRequest = new Google\Cloud\Spanner\V1\DeleteSessionRequest(); + $deleteSessionRequest->setName($session->getName()); + $client->deleteSession($deleteSessionRequest); +} + +$PROBE_FUNCTIONS = [ + 'session_management' => 'sessionManagement', + 'execute_sql' => 'executeSql', + 'read' => 'read', + 'transaction' => 'transaction', + 'partition' => 'partition' +]; + +return $PROBE_FUNCTIONS; + + + diff --git a/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/stackdriver_util.php b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/stackdriver_util.php new file mode 100644 index 0000000..a22984b --- /dev/null +++ b/vendor/google/grpc-gcp/cloudprober/grpc_gpc_prober/stackdriver_util.php @@ -0,0 +1,64 @@ +api = $api; + $this->metrics = []; + $this->success = FALSE; + $this->err_client = new ReportErrorsServiceClient(); + } + + function addMetric($key, $value){ + $this->matrics[$key] = $value; + } + + function addMetrics($metrics){ + $this->metrics = array_merge($metrics, $this->metrics); + } + + function setSuccess($result){ + $this->success = $result; + } + + function outputMetrics(){ + if ($this->success){ + echo $this->api.'_success 1'."\n"; + } + else{ + echo $this->api.'_success 0'."\n"; + } + foreach ($this->metrics as $key => $value) { + echo $key.' '.$value."\n"; + } + } + + function reportError($err){ + error_log($err); + $projectId = '434076015357'; + $project_name = $this->err_client->projectName($projectId); + + $location = (new SourceLocation()) + ->setFunctionName($this->api); + $context = (new ErrorContext()) + ->setReportLocation($location); + + $error_event = new ReportedErrorEvent(); + $error_event->setMessage('PHPProbeFailure: fails on '.$this->api.' API. Details: '.(string)$err."\n"); + $error_event->setContext($context); + + $this->err_client->reportErrorEvent($project_name, $error_event); + } + +} diff --git a/vendor/google/grpc-gcp/composer.json b/vendor/google/grpc-gcp/composer.json new file mode 100644 index 0000000..d8ed484 --- /dev/null +++ b/vendor/google/grpc-gcp/composer.json @@ -0,0 +1,24 @@ +{ + "name": "google/grpc-gcp", + "description": "gRPC GCP library for channel management", + "license": "Apache-2.0", + "require": { + "php": "^8.0", + "google/protobuf": "^v3.25.3||^4.26.1", + "grpc/grpc": "^v1.13.0", + "google/auth": "^1.3", + "psr/cache": "^1.0.1||^2.0.0||^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "google/cloud-spanner": "^1.7" + }, + "autoload": { + "psr-4": { + "Grpc\\Gcp\\": "src/" + }, + "classmap": [ + "src/generated/" + ] + } +} diff --git a/vendor/google/grpc-gcp/doc/gRPC-client-user-guide.md b/vendor/google/grpc-gcp/doc/gRPC-client-user-guide.md new file mode 100644 index 0000000..a9848c8 --- /dev/null +++ b/vendor/google/grpc-gcp/doc/gRPC-client-user-guide.md @@ -0,0 +1,217 @@ +# Instructions for create a gRPC client for google cloud services + +## Overview + +This instruction includes a step by step guide for creating a gRPC +client to test the google cloud service from an empty linux +VM, using GCE ubuntu 16.04 TLS instance. + +The main steps are followed as steps below: + +- Environment prerequisite +- Install protobuf plugin and gRPC-PHP/protobuf extension +- Generate client API from .proto files +- Create the client and send/receive RPC. + +## Environment Prerequisite + +**Linux** +```sh +$ [sudo] apt-get install build-essential autoconf libtool pkg-config zip unzip zlib1g-dev +``` +**PHP** +* `php` 5.5 or above, 7.0 or above +* `pecl` +* `composer` +```sh +$ [sudo] apt-get install php php-dev +$ curl -sS https://getcomposer.org/installer | php +$ [sudo] mv composer.phar /usr/local/bin/composer +``` + +## Install protobuf plugin and gRPC-PHP/protobuf extension +`grpc_php_plugin` is used to generate client API from `*.proto `files. Currently, +The only way to install `grpc_php_plugin` is to build from the gRPC source. + +**Install protobuf, gRPC, which will install the plugin** +```sh +$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc +$ cd grpc +$ git submodule update --init +# install protobuf +$ cd third_party/protobuf +$ ./autogen.sh && ./configure && make -j8 +$ [sudo] make install +$ [sudo] ldconfig +# install gRPC +$ cd ../.. +$ make -j8 +$ [sudo] make install +``` +It will generate `grpc_php_plugin` under `/usr/local/bin`. + + +**Install gRPC-PHP extension** +```sh +$ [sudo] pecl install protobuf +$ [sudo] pecl install grpc +``` +It will generate `protobuf.so` and `grpc.so` under PHP's extension directory. +Note gRPC-PHP extension installed by pecl doesn't work on RHEL6 system. + +## Generate client API from .proto files +The common way to generate the client API is to use `grpc_php_plugin` directly. +Since the plugin won't find the dependency by itself. It works if all your +service proto files and dependent proto files are inside one directory. The +command looks like: +```sh +$ mkdir $HOME/project +$ protoc --proto_path=./ --php_out=$HOME/project \ +--grpc_out=$HOME/project \ +--plugin=protoc-gen-grpc=./bins/opt/grpc_php_plugin \ +path/to/your/proto_dependency_directory1/*.proto \ +path/to/your/proto_dependency_directory2/*.proto \ +path/to/your/proto_directory/*.proto + +``` + +Take `Firestore` service under [googleapis github repo](https://github.com/googleapis/googleapis) +for example. The proto files required for generating client API are +``` +google/api/annotations.proto +google/api/http.proto +google/api/httpbody.proto +google/longrunning/operations.proto +google/rpc/code.proto +google/rpc/error_details.proto +google/rpc/status.proto +google/type/latlng.proto +google/firestore/v1beta1/firestore.proto +google/firestore/v1beta1/common.proto +google/firestore/v1beta1/query.proto +google/firestore/v1beta1/write.proto +google/firestore/v1beta1/document.proto +``` +Thus the command looks like: +```sh +$ protoc --proto_path=googleapis --plugin=protoc-gen-grpc=`which grpc_php_plugin` \ +--php_out=./ --grpc_out=./ google/api/annotations.proto google/api/http.proto \ +google/api/httpbody.proto google/longrunning/operations.proto google/rpc/code.proto \ +google/rpc/error_details.proto google/rpc/status.proto google/type/latlng.proto \ +google/firestore/v1beta1/firestore.proto google/firestore/v1beta1/common.proto \ +google/firestore/v1beta1/query.proto google/firestore/v1beta1/write.proto \ +google/firestore/v1beta1/document.proto +``` + +Since most of cloud services already publish proto files under +[googleapis github repo](https://github.com/googleapis/googleapis), +you can use it's Makefile to generate the client API. +The `Makefile` will help you generate the client API as +well as find the dependencies. The command will simply be: +```sh +$ cd $HOME +$ mkdir project +$ git clone https://github.com/googleapis/googleapis.git +$ cd googleapis +$ make LANGUAGE=php OUTPUT=$HOME/project +# (It's okay if you see error like Please add 'syntax = "proto3";' +# to the top of your .proto file.) +``` +The client API library is generated under `$HOME/project`. +Take [`Firestore`](https://github.com/googleapis/googleapis/blob/master/google/firestore/v1beta1/firestore.proto) +as example, the Client API is under +`project/Google/Cloud/Firestore/V1beta1/FirestoreClient.php` depends on your +package name inside .proto file. An easy way to find your client is +```sh +$ find ./ -name [service_name]Client.php +``` + +## Create the client and send/receive RPC. +Now it's time to use the client API to send and receive RPCs. +```sh +$ cd $HOME/project +``` +**Install gRPC-PHP composer library** +```sh +$ vim composer.json +######## you need to change the path and service namespace. +{ + "require": { + "google/cloud": "^0.52.1" + }, + "autoload": { + "psr-4": { + "FireStore\\": "src/", + "Google\\Cloud\\Firestore\\V1beta1\\": "Google/Cloud/Firestore/V1beta1/" + } + } +} +######## +$ composer install +``` +**Set credentials file** +``` sh +$ vim $HOME/key.json +## Paste you credential file downloaded from your cloud project +## which you can find in APIs&Services => credentials => create credentials +## => Service account key => your credentials +$ export GOOGLE_APPLICATION_CREDENTIALS=$HOME/key.json +``` + +**Implement Service Client** +Take a unary-unary RPC `listDocument` from `FirestoreClient` as example. +Create a file name `ListDocumentClient.php`. +- import library +``` +require_once __DIR__ . '/vendor/autoload.php'; +use Google\Cloud\Firestore\V1beta1\FirestoreClient; +use Google\Cloud\Firestore\V1beta1\ListDocumentsRequest; +use Google\Auth\ApplicationDefaultCredentials; +``` +- Google Auth +``` +$host = "firestore.googleapis.com"; +$credentials = \Grpc\ChannelCredentials::createSsl(); +// WARNING: the environment variable "GOOGLE_APPLICATION_CREDENTIALS" needs to be set +$auth = ApplicationDefaultCredentials::getCredentials(); +$opts = [ + 'credentials' => $credentials, + 'update_metadata' => $auth->getUpdateMetadataFunc(), +] +``` +- Create Client +``` +$firestoreClient = new FirestoreClient($host, $opts); +``` +- Make and receive RPC call +``` +$argument = new ListDocumentsRequest(); +$project_id = xxxxxxx; +$argument->setParent("projects/$project_id/databases/(default)/documents"); +list($Response, $error) = $firestoreClient->ListDocuments($argument)->wait(); +``` +- print RPC response +``` +$documents = $Response->getDocuments(); +$index = 0; +foreach($documents as $document) { + $index++; + $name = $document->getName(); + echo "=> Document $index: $name\n"; + $fields = $document->getFields(); + foreach ($fields as $name => $value) { + echo "$name => ".$value->getStringValue()."\n"; + } +} +``` + +- run the script +```sh +$ php -d extension=grpc.so -d extension=protobuf.so ListDocumentClient.php +``` + +For different kinds of RPC(unary-unary, unary-stream, stream-unary, stream-stream), +please check [grpc.io PHP part](https://grpc.io/docs/tutorials/basic/php.html#calling-service-methods) +for reference. + + diff --git a/vendor/google/grpc-gcp/src/ChannelRef.php b/vendor/google/grpc-gcp/src/ChannelRef.php new file mode 100644 index 0000000..bc25836 --- /dev/null +++ b/vendor/google/grpc-gcp/src/ChannelRef.php @@ -0,0 +1,98 @@ +target = $target; + $this->channel_id = $channel_id; + $this->affinity_ref = $affinity_ref; + $this->active_stream_ref = $active_stream_ref; + $this->opts = $opts; + $this->has_deserialized = new CreatedByDeserializeCheck(); + } + + public function getRealChannel($credentials) + { + // TODO(ddyihai): remove this check once the serialize handler for + // \Grpc\Channel is implemented(issue https://github.com/grpc/grpc/issues/15870). + if (!$this->has_deserialized->getData()) { + // $real_channel exists and is not created by the deserialization. + return $this->real_channel; + } + // If this ChannelRef is created by deserialization, $real_channel is invalid + // thus needs to be recreated becasue Grpc\Channel don't have serialize and + // deserialize handler. + // Since [target + augments + credentials] will be the same during the recreation, + // it will reuse the underline grpc channel in C extension without creating a + // new connection. + + // 'credentials' in the array $opts will be unset during creating the channel. + if (!array_key_exists('credentials', $this->opts)) { + $this->opts['credentials'] = $credentials; + } + $real_channel = new \Grpc\Channel($this->target, $this->opts); + $this->real_channel = $real_channel; + // Set deserialization to false so it won't be recreated within the same script. + $this->has_deserialized->setData(0); + return $real_channel; + } + + public function getAffinityRef() + { + return $this->affinity_ref; + } + public function getActiveStreamRef() + { + return $this->active_stream_ref; + } + public function affinityRefIncr() + { + $this->affinity_ref += 1; + } + public function affinityRefDecr() + { + $this->affinity_ref -= 1; + } + public function activeStreamRefIncr() + { + $this->active_stream_ref += 1; + } + public function activeStreamRefDecr() + { + $this->active_stream_ref -= 1; + } +} diff --git a/vendor/google/grpc-gcp/src/Config.php b/vendor/google/grpc-gcp/src/Config.php new file mode 100644 index 0000000..397047b --- /dev/null +++ b/vendor/google/grpc-gcp/src/Config.php @@ -0,0 +1,113 @@ +gcp_call_invoker = new \Grpc\DefaultCallInvoker(); + return; + } + + $gcp_channel = null; + $url_host = parse_url($target, PHP_URL_HOST); + $this->hostname = $url_host ? $url_host : $target; + $channel_pool_key = $this->hostname . '.gcp.channel.' . getmypid(); + + if (!$cacheItemPool) { + $affinity_conf = $this->parseConfObject($conf); + $gcp_call_invoker = new GCPCallInvoker($affinity_conf); + $this->gcp_call_invoker = $gcp_call_invoker; + } else { + $item = $cacheItemPool->getItem($channel_pool_key); + if ($item->isHit()) { + // Channel pool for the $hostname API has already created. + $gcp_call_invoker = unserialize($item->get()); + } else { + $affinity_conf = $this->parseConfObject($conf); + // Create GCP channel based on the information. + $gcp_call_invoker = new GCPCallInvoker($affinity_conf); + } + $this->gcp_call_invoker = $gcp_call_invoker; + register_shutdown_function(function ($gcp_call_invoker, $cacheItemPool, $item) { + // Push the current gcp_channel back into the pool when the script finishes. + $item->set(serialize($gcp_call_invoker)); + $cacheItemPool->save($item); + }, $gcp_call_invoker, $cacheItemPool, $item); + } + } + + /** + * @return \Grpc\CallInvoker The call invoker to be hooked into the gRPC + */ + public function callInvoker() + { + return $this->gcp_call_invoker; + } + + /** + * @return string The URI of the endpoint + */ + public function getTarget() + { + return $this->channel->getTarget(); + } + + private function parseConfObject($conf_object) + { + $config = json_decode($conf_object->serializeToJsonString(), true); + if (isset($config['channelPool'])) { + $affinity_conf['channelPool'] = $config['channelPool']; + } + $aff_by_method = array(); + if (isset($config['method'])) { + for ($i = 0; $i < count($config['method']); $i++) { + // In proto3, if the value is default, eg 0 for int, it won't be serialized. + // Thus serialized string may not have `command` if the value is default 0(BOUND). + if (!array_key_exists('command', $config['method'][$i]['affinity'])) { + $config['method'][$i]['affinity']['command'] = 'BOUND'; + } + $aff_by_method[$config['method'][$i]['name'][0]] = $config['method'][$i]['affinity']; + } + } + $affinity_conf['affinity_by_method'] = $aff_by_method; + return $affinity_conf; + } + +} diff --git a/vendor/google/grpc-gcp/src/CreatedByDeserializeCheck.php b/vendor/google/grpc-gcp/src/CreatedByDeserializeCheck.php new file mode 100644 index 0000000..e928b3e --- /dev/null +++ b/vendor/google/grpc-gcp/src/CreatedByDeserializeCheck.php @@ -0,0 +1,84 @@ +data = 1; + } + + /** + * @return string + */ + public function serialize() + { + return '0'; + } + + /** + * @return string + */ + public function __serialize() + { + return $this->serialize(); + } + + /** + * @param string $data + */ + public function unserialize($data) + { + $this->data = 1; + } + + /** + * @param string $data + */ + public function __unserialize($data) + { + $this->unserialize($data); + } + + /** + * @param $data + */ + public function setData($data) + { + $this->data = $data; + } + + /** + * @return int + */ + public function getData() + { + return $this->data; + } +} diff --git a/vendor/google/grpc-gcp/src/GCPBidiStreamingCall.php b/vendor/google/grpc-gcp/src/GCPBidiStreamingCall.php new file mode 100644 index 0000000..992843f --- /dev/null +++ b/vendor/google/grpc-gcp/src/GCPBidiStreamingCall.php @@ -0,0 +1,108 @@ +_rpcPreProcess($data); + $this->real_call = new \Grpc\BidiStreamingCall($channel_ref->getRealChannel( + $this->gcp_channel->credentials), $this->method, $this->deserialize, $this->options); + $this->real_call->start($this->metadata_rpc); + return $this->real_call; + } + + /** + * Pick a channel and start the call. + * + * @param array $metadata Metadata to send with the call, if applicable + * (optional) + */ + public function start(array $metadata = []) + { + $this->metadata_rpc = $metadata; + } + + /** + * Reads the next value from the server. + * + * @return mixed The next value from the server, or null if there is none + */ + public function read() + { + if (!$this->has_real_call) { + $this->createRealCall(); + $this->has_real_call = true; + } + $response = $this->real_call->read(); + if ($response) { + $this->response = $response; + } + return $response; + } + + /** + * Write a single message to the server. This cannot be called after + * writesDone is called. + * + * @param ByteBuffer $data The data to write + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function write($data, array $options = []) + { + if (!$this->has_real_call) { + $this->createRealCall($data); + $this->has_real_call = true; + } + $this->real_call->write($data, $options); + } + + /** + * Indicate that no more writes will be sent. + */ + public function writesDone() + { + if (!$this->has_real_call) { + $this->createRealCall(); + $this->has_real_call = true; + } + $this->real_call->writesDone(); + } + + /** + * Wait for the server to send the status, and return it. + * + * @return \stdClass The status object, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + $status = $this->real_call->getStatus(); + $this->_rpcPostProcess($status, $this->response); + return $status; + } +} diff --git a/vendor/google/grpc-gcp/src/GCPCallInvoker.php b/vendor/google/grpc-gcp/src/GCPCallInvoker.php new file mode 100644 index 0000000..4b08274 --- /dev/null +++ b/vendor/google/grpc-gcp/src/GCPCallInvoker.php @@ -0,0 +1,86 @@ +affinity_conf = $affinity_conf; + } + + /** + * @param string $hostname + * @param array $opts + * @return GcpExtensionChannel + */ + public function createChannelFactory($hostname, $opts) + { + if ($this->channel) { + // $call_invoker object has already created from previews PHP-FPM scripts. + // Only need to update the $opts including the credentials. + $this->channel->updateOpts($opts); + } else { + $opts['affinity_conf'] = $this->affinity_conf; + $channel = new GcpExtensionChannel($hostname, $opts); + $this->channel = $channel; + } + return $this->channel; + } + + // _getChannel is used for testing only. + public function GetChannel() + { + return $this->channel; + } + + public function UnaryCall($channel, $method, $deserialize, $options) + { + return new GCPUnaryCall($channel, $method, $deserialize, $options); + } + public function ClientStreamingCall($channel, $method, $deserialize, $options) + { + return new GCPClientStreamCall($channel, $method, $deserialize, $options); + } + public function ServerStreamingCall($channel, $method, $deserialize, $options) + { + return new GCPServerStreamCall($channel, $method, $deserialize, $options); + } + public function BidiStreamingCall($channel, $method, $deserialize, $options) + { + return new GCPBidiStreamingCall($channel, $method, $deserialize, $options); + } +} diff --git a/vendor/google/grpc-gcp/src/GCPClientStreamCall.php b/vendor/google/grpc-gcp/src/GCPClientStreamCall.php new file mode 100644 index 0000000..c24a92b --- /dev/null +++ b/vendor/google/grpc-gcp/src/GCPClientStreamCall.php @@ -0,0 +1,76 @@ +_rpcPreProcess($data); + $this->real_call = new \Grpc\ClientStreamingCall($channel_ref->getRealChannel( + $this->gcp_channel->credentials), $this->method, $this->deserialize, $this->options); + $this->real_call->start($this->metadata_rpc); + return $this->real_call; + } + /** + * Pick a channel and start the call. + * + * @param array $metadata Metadata to send with the call, if applicable + * (optional) + */ + public function start(array $metadata = []) + { + // Postpone first rpc to write function(), where we can pick a channel + // from the channel pool. + $this->metadata_rpc = $metadata; + } + + /** + * Write a single message to the server. This cannot be called after + * wait is called. + * + * @param ByteBuffer $data The data to write + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function write($data, array $options = []) + { + if (!$this->has_real_call) { + $this->createRealCall($data); + $this->has_real_call = true; + } + $this->real_call->write($data, $options); + } + + /** + * Wait for the server to respond with data and a status. + * + * @return array [response data, status] + */ + public function wait() + { + list($response, $status) = $this->real_call->wait(); + $this->_rpcPostProcess($status, $response); + return [$response, $status]; + } +} diff --git a/vendor/google/grpc-gcp/src/GCPServerStreamCall.php b/vendor/google/grpc-gcp/src/GCPServerStreamCall.php new file mode 100644 index 0000000..283cd61 --- /dev/null +++ b/vendor/google/grpc-gcp/src/GCPServerStreamCall.php @@ -0,0 +1,89 @@ +real_call = new \Grpc\ServerStreamingCall($channel, $this->method, $this->deserialize, $this->options); + $this->has_real_call = true; + return $this->real_call; + } + + /** + * Pick a channel and start the call. + * + * @param mixed $data The data to send + * @param array $metadata Metadata to send with the call, if applicable + * (optional) + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function start($argument, $metadata, $options) + { + $channel_ref = $this->_rpcPreProcess($argument); + $this->createRealCall($channel_ref->getRealChannel( + $this->gcp_channel->credentials)); + $this->real_call->start($argument, $metadata, $options); + } + + /** + * @return mixed An iterator of response values + */ + public function responses() + { + $response = $this->real_call->responses(); + // Since the last response is empty for the server streaming RPC, + // the second last one is the last RPC response with payload. + // Use this one for searching the affinity key. + // The same as BidiStreaming. + if ($response) { + $this->response = $response; + } + return $response; + } + + /** + * Wait for the server to send the status, and return it. + * + * @return \stdClass The status object, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + $status = $this->real_call->getStatus(); + $this->_rpcPostProcess($status, $this->response); + return $status; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + return $this->real_call->getMetadata(); + } +} diff --git a/vendor/google/grpc-gcp/src/GCPUnaryCall.php b/vendor/google/grpc-gcp/src/GCPUnaryCall.php new file mode 100644 index 0000000..da4a209 --- /dev/null +++ b/vendor/google/grpc-gcp/src/GCPUnaryCall.php @@ -0,0 +1,70 @@ +real_call = new \Grpc\UnaryCall($channel, $this->method, $this->deserialize, $this->options); + $this->has_real_call = true; + return $this->real_call; + } + + /** + * Pick a channel and start the call. + * + * @param mixed $data The data to send + * @param array $metadata Metadata to send with the call, if applicable + * (optional) + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function start($argument, $metadata, $options) + { + $channel_ref = $this->_rpcPreProcess($argument); + $real_channel = $channel_ref->getRealChannel($this->gcp_channel->credentials); + $this->createRealCall($real_channel); + $this->real_call->start($argument, $metadata, $options); + } + + /** + * Wait for the server to respond with data and a status. + * + * @return array [response data, status] + */ + public function wait() + { + list($response, $status) = $this->real_call->wait(); + $this->_rpcPostProcess($status, $response); + return [$response, $status]; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + return $this->real_call->getMetadata(); + } +} diff --git a/vendor/google/grpc-gcp/src/GcpBaseCall.php b/vendor/google/grpc-gcp/src/GcpBaseCall.php new file mode 100644 index 0000000..0a0fbf4 --- /dev/null +++ b/vendor/google/grpc-gcp/src/GcpBaseCall.php @@ -0,0 +1,223 @@ +gcp_channel = $channel; + $this->method = $method; + $this->deserialize = $deserialize; + $this->options = $options; + $this->_affinity = null; + + if (isset($this->gcp_channel->affinity_conf['affinity_by_method'][$method])) { + $this->_affinity = $this->gcp_channel->affinity_conf['affinity_by_method'][$method]; + } + } + + /** + * Pick a ChannelRef from the channel pool based on the request and + * the affinity config. + * + * @param mixed $argument Requests. + * + * @return ChannelRef + */ + protected function _rpcPreProcess($argument) + { + $this->affinity_key = null; + if ($this->_affinity) { + $command = $this->_affinity['command']; + if ($command == self::BOUND || $command == self::UNBIND) { + $this->affinity_key = $this->getAffinityKeyFromProto($argument); + } + } + $this->channel_ref = $this->gcp_channel->getChannelRef($this->affinity_key); + $this->channel_ref->activeStreamRefIncr(); + return $this->channel_ref; + } + + /** + * Update ChannelRef when RPC finishes. + * + * @param \stdClass $status The status object, with integer $code, string + * $details, and array $metadata members + * @param mixed $response Response. + */ + protected function _rpcPostProcess($status, $response) + { + if ($this->_affinity) { + $command = $this->_affinity['command']; + if ($command == self::BIND) { + if ($status->code != \Grpc\STATUS_OK) { + return; + } + $affinity_key = $this->getAffinityKeyFromProto($response); + $this->gcp_channel->bind($this->channel_ref, $affinity_key); + } elseif ($command == self::UNBIND) { + $this->gcp_channel->unbind($this->affinity_key); + } + } + $this->channel_ref->activeStreamRefDecr(); + } + + /** + * Get the affinity key based on the affinity config. + * + * @param mixed $proto Objects may contain the affinity key. + * + * @return string Affinity key. + */ + protected function getAffinityKeyFromProto($proto) + { + if ($this->_affinity) { + $names = $this->_affinity['affinityKey']; + $names_arr = explode(".", $names); + foreach ($names_arr as $name) { + $getAttrMethod = 'get' . ucfirst($name); + $proto = call_user_func_array(array($proto, $getAttrMethod), array()); + } + return $proto; + } + echo "Cannot find the field in the proto\n"; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + if (!$this->has_real_call) { + $this->createRealCall(); + $this->has_real_call = true; + } + return $this->real_call->getMetadata(); + } + + /** + * @return mixed The trailing metadata sent by the server + */ + public function getTrailingMetadata() + { + if (!$this->has_real_call) { + $this->createRealCall(); + $this->has_real_call = true; + } + return $this->real_call->getTrailingMetadata(); + } + + /** + * @return string The URI of the endpoint + */ + public function getPeer() + { + if (!$this->has_real_call) { + $this->createRealCall(); + $this->has_real_call = true; + } + return $this->real_call->getPeer(); + } + + /** + * Cancels the call. + */ + public function cancel() + { + if (!$this->has_real_call) { + $this->has_real_call = true; + $this->createRealCall(); + } + $this->real_call->cancel(); + } + + /** + * Serialize a message to the protobuf binary format. + * + * @param mixed $data The Protobuf message + * + * @return string The protobuf binary format + */ + protected function _serializeMessage($data) + { + return $this->real_call->_serializeMessage($data); + } + + /** + * Deserialize a response value to an object. + * + * @param string $value The binary value to deserialize + * + * @return mixed The deserialized value + */ + protected function _deserializeResponse($value) + { + return $this->real_call->_deserializeResponse($value); + } + + /** + * Set the CallCredentials for the underlying Call. + * + * @param CallCredentials $call_credentials The CallCredentials object + */ + public function setCallCredentials($call_credentials) + { + $this->call->setCredentials($call_credentials); + } +} diff --git a/vendor/google/grpc-gcp/src/GcpExtensionChannel.php b/vendor/google/grpc-gcp/src/GcpExtensionChannel.php new file mode 100644 index 0000000..405ba9a --- /dev/null +++ b/vendor/google/grpc-gcp/src/GcpExtensionChannel.php @@ -0,0 +1,281 @@ +channel_refs; + } + + /** + * @param string $hostname + * @param array $opts Options to create a \Grpc\Channel and affinity config + */ + public function __construct($hostname = null, $opts = array()) + { + if ($hostname == null || !is_array($opts)) { + throw new \InvalidArgumentException("Expected hostname is empty"); + } + $this->max_size = 10; + $this->max_concurrent_streams_low_watermark = 100; + if (isset($opts['affinity_conf'])) { + if (isset($opts['affinity_conf']['channelPool'])) { + if (isset($opts['affinity_conf']['channelPool']['maxSize'])) { + $this->max_size = $opts['affinity_conf']['channelPool']['maxSize']; + } + if (isset($opts['affinity_conf']['channelPool']['maxConcurrentStreamsLowWatermark'])) { + $this->max_concurrent_streams_low_watermark = + $opts['affinity_conf']['channelPool']['maxConcurrentStreamsLowWatermark']; + } + } + $this->affinity_by_method = $opts['affinity_conf']['affinity_by_method']; + $this->affinity_conf = $opts['affinity_conf']; + } + $this->target = $hostname; + $this->affinity_key_to_channel_ref = array(); + $this->channel_refs = array(); + $this->updateOpts($opts); + // Initiate a Grpc\Channel at the beginning in order to keep the same + // behavior as the Grpc. + $channel_ref = $this->getChannelRef(); + $channel_ref->getRealChannel($this->credentials); + } + + /** + * @param array $opts Options to create a \Grpc\Channel + */ + public function updateOpts($opts) + { + if (isset($opts['credentials'])) { + $this->credentials = $opts['credentials']; + } + unset($opts['affinity_conf']); + unset($opts['credentials']); + $this->options = $opts; + $this->is_closed = false; + } + + /** + * Bind the ChannelRef with the affinity key. This is a private method. + * + * @param ChannelRef $channel_ref + * @param string $affinity_key + * + * @return ChannelRef + */ + public function bind($channel_ref, $affinity_key) + { + if (!array_key_exists($affinity_key, $this->affinity_key_to_channel_ref)) { + $this->affinity_key_to_channel_ref[$affinity_key] = $channel_ref; + } + $channel_ref->affinityRefIncr(); + return $channel_ref; + } + + /** + * Unbind the affinity key. This is a private method. + * + * @param string $affinity_key + * + * @return ChannelRef + */ + public function unbind($affinity_key) + { + $channel_ref = null; + if (array_key_exists($affinity_key, $this->affinity_key_to_channel_ref)) { + $channel_ref = $this->affinity_key_to_channel_ref[$affinity_key]; + $channel_ref->affinityRefDecr(); + } + unset($this->affinity_key_to_channel_ref[$affinity_key]); + return $channel_ref; + } + + + public function cmp_by_active_stream_ref($a, $b) + { + return $a->getActiveStreamRef() - $b->getActiveStreamRef(); + } + + /** + * Pick or create a ChannelRef from the pool by affinity key. + * + * @param string $affinity_key + * + * @return ChannelRef + */ + public function getChannelRef($affinity_key = null) + { + if ($affinity_key) { + if (array_key_exists($affinity_key, $this->affinity_key_to_channel_ref)) { + return $this->affinity_key_to_channel_ref[$affinity_key]; + } + return $this->getChannelRef(); + } + usort($this->channel_refs, array($this, 'cmp_by_active_stream_ref')); + + if (count($this->channel_refs) > 0 && $this->channel_refs[0]->getActiveStreamRef() < + $this->max_concurrent_streams_low_watermark) { + return $this->channel_refs[0]; + } + $num_channel_refs = count($this->channel_refs); + if ($num_channel_refs < $this->max_size) { + // grpc_target_persist_bound stands for how many channels can be persisted for + // the same target in the C extension. It is possible that the user use the pure + // gRPC and this GCP extension at the same time, which share the same target. In this case + // pure gRPC channel may occupy positions in C extension, which deletes some channels created + // by this GCP extension. + // If that happens, it won't cause the script failure because we saves all arguments for creating + // a channel instead of a channel itself. If we watch to fetch a GCP channel already deleted, + // it will create a new channel. The only cons is the latency of the first RPC will high because + // it will establish the connection again. + if (!isset($this->options['grpc_target_persist_bound']) || + $this->options['grpc_target_persist_bound'] < $this->max_size) { + $this->options['grpc_target_persist_bound'] = $this->max_size; + } + $cur_opts = array_merge($this->options, + ['grpc_gcp_channel_id' => $num_channel_refs]); + $channel_ref = new ChannelRef($this->target, $num_channel_refs, $cur_opts); + array_unshift($this->channel_refs, $channel_ref); + } + return $this->channel_refs[0]; + } + + /** + * Get the connectivity state of the channel + * + * @param bool $try_to_connect try to connect on the channel + * + * @return int The grpc connectivity state + * @throws \InvalidArgumentException + */ + public function getConnectivityState($try_to_connect = false) + { + // Since getRealChannel is creating a PHP Channel object. However in gRPC, when a Channel + // object is closed, we only mark this Object to be invalid. Thus, we need a global variable + // to mark whether this GCPExtensionChannel is close or not. + if ($this->is_closed) { + throw new \RuntimeException("Channel has already been closed"); + } + $ready = 0; + $idle = 0; + $connecting = 0; + $transient_failure = 0; + $shutdown = 0; + foreach ($this->channel_refs as $channel_ref) { + $state = $channel_ref->getRealChannel($this->credentials)->getConnectivityState($try_to_connect); + switch ($state) { + case \Grpc\CHANNEL_READY: + $ready += 1; + break 2; + case \Grpc\CHANNEL_FATAL_FAILURE: + $shutdown += 1; + break; + case \Grpc\CHANNEL_CONNECTING: + $connecting += 1; + break; + case \Grpc\CHANNEL_TRANSIENT_FAILURE: + $transient_failure += 1; + break; + case \Grpc\CHANNEL_IDLE: + $idle += 1; + break; + } + } + if ($ready > 0) { + return \Grpc\CHANNEL_READY; + } elseif ($idle > 0) { + return \Grpc\CHANNEL_IDLE; + } elseif ($connecting > 0) { + return \Grpc\CHANNEL_CONNECTING; + } elseif ($transient_failure > 0) { + return \Grpc\CHANNEL_TRANSIENT_FAILURE; + } elseif ($shutdown > 0) { + return \Grpc\CHANNEL_SHUTDOWN; + } + } + + /** + * Watch the connectivity state of the channel until it changed + * + * @param int $last_state The previous connectivity state of the channel + * @param Timeval $deadline_obj The deadline this function should wait until + * + * @return bool If the connectivity state changes from last_state + * before deadline + * @throws \InvalidArgumentException + */ + public function watchConnectivityState($last_state, $deadline_obj = null) + { + if ($deadline_obj == null || !is_a($deadline_obj, '\Grpc\Timeval')) { + throw new \InvalidArgumentException(""); + } + // Since getRealChannel is creating a PHP Channel object. However in gRPC, when a Channel + // object is closed, we only mark this Object to be invalid. Thus, we need a global variable + // to mark whether this GCPExtensionChannel is close or not. + if ($this->is_closed) { + throw new \RuntimeException("Channel has already been closed"); + } + $state = 0; + foreach ($this->channel_refs as $channel_ref) { + $state = $channel_ref->getRealChannel($this->credentials)->watchConnectivityState($last_state, $deadline_obj); + } + return $state; + } + + /** + * Get the endpoint this call/stream is connected to + * + * @return string The URI of the endpoint + */ + public function getTarget() + { + return $this->target; + } + + /** + * Close the channel + */ + public function close() + { + foreach ($this->channel_refs as $channel_ref) { + $channel_ref->getRealChannel($this->credentials)->close(); + } + $this->is_closed = true; + } +} diff --git a/vendor/google/grpc-gcp/src/generated/GPBMetadata/GrpcGcp.php b/vendor/google/grpc-gcp/src/generated/GPBMetadata/GrpcGcp.php new file mode 100644 index 0000000..4164ecb --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/GPBMetadata/GrpcGcp.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile(hex2bin( + "0ac9030a0e677270635f6763702e70726f746f1208677270632e67637022" . + "670a09417069436f6e66696712310a0c6368616e6e656c5f706f6f6c1802" . + "2001280b321b2e677270632e6763702e4368616e6e656c506f6f6c436f6e" . + "66696712270a066d6574686f6418e9072003280b32162e677270632e6763" . + "702e4d6574686f64436f6e66696722690a114368616e6e656c506f6f6c43" . + "6f6e66696712100a086d61785f73697a6518012001280d12140a0c69646c" . + "655f74696d656f7574180220012804122c0a246d61785f636f6e63757272" . + "656e745f73747265616d735f6c6f775f77617465726d61726b1803200128" . + "0d22490a0c4d6574686f64436f6e666967120c0a046e616d651801200328" . + "09122b0a08616666696e69747918e9072001280b32182e677270632e6763" . + "702e416666696e697479436f6e6669672285010a0e416666696e69747943" . + "6f6e66696712310a07636f6d6d616e6418022001280e32202e677270632e" . + "6763702e416666696e697479436f6e6669672e436f6d6d616e6412140a0c" . + "616666696e6974795f6b6579180320012809222a0a07436f6d6d616e6412" . + "090a05424f554e44100012080a0442494e441001120a0a06554e42494e44" . + "1002620670726f746f33" + )); + + static::$is_initialized = true; + } +} diff --git a/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig.php b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig.php new file mode 100644 index 0000000..bad448e --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig.php @@ -0,0 +1,87 @@ +grpc.gcp.AffinityConfig + */ +class AffinityConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The affinity command applies on the selected gRPC methods. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig.Command command = 2; + */ + private $command = 0; + /** + * The field path of the affinity key in the request/response message. + * For example: "f.a", "f.b.d", etc. + * + * Generated from protobuf field string affinity_key = 3; + */ + private $affinity_key = ''; + + public function __construct() + { + \GPBMetadata\GrpcGcp::initOnce(); + parent::__construct(); + } + + /** + * The affinity command applies on the selected gRPC methods. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig.Command command = 2; + * @return int + */ + public function getCommand() + { + return $this->command; + } + + /** + * The affinity command applies on the selected gRPC methods. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig.Command command = 2; + * @param int $var + * @return $this + */ + public function setCommand($var) + { + GPBUtil::checkEnum($var, \Grpc\Gcp\AffinityConfig_Command::class); + $this->command = $var; + + return $this; + } + + /** + * The field path of the affinity key in the request/response message. + * For example: "f.a", "f.b.d", etc. + * + * Generated from protobuf field string affinity_key = 3; + * @return string + */ + public function getAffinityKey() + { + return $this->affinity_key; + } + + /** + * The field path of the affinity key in the request/response message. + * For example: "f.a", "f.b.d", etc. + * + * Generated from protobuf field string affinity_key = 3; + * @param string $var + * @return $this + */ + public function setAffinityKey($var) + { + GPBUtil::checkString($var, true); + $this->affinity_key = $var; + + return $this; + } +} diff --git a/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig_Command.php b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig_Command.php new file mode 100644 index 0000000..2efcc72 --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/AffinityConfig_Command.php @@ -0,0 +1,38 @@ +Grpc\Gcp\AffinityConfig\Command + */ +class AffinityConfig_Command +{ + /** + * The annotated method will be required to be bound to an existing session + * to execute the RPC. The corresponding will be + * used to find the affinity key from the request message. + * + * Generated from protobuf enum BOUND = 0; + */ + const BOUND = 0; + /** + * The annotated method will establish the channel affinity with the channel + * which is used to execute the RPC. The corresponding + * will be used to find the affinity key from the + * response message. + * + * Generated from protobuf enum BIND = 1; + */ + const BIND = 1; + /** + * The annotated method will remove the channel affinity with the channel + * which is used to execute the RPC. The corresponding + * will be used to find the affinity key from the + * request message. + * + * Generated from protobuf enum UNBIND = 2; + */ + const UNBIND = 2; +} diff --git a/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ApiConfig.php b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ApiConfig.php new file mode 100644 index 0000000..519e31a --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ApiConfig.php @@ -0,0 +1,84 @@ +grpc.gcp.ApiConfig + */ +class ApiConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The channel pool configurations. + * + * Generated from protobuf field .grpc.gcp.ChannelPoolConfig channel_pool = 2; + */ + private $channel_pool = null; + /** + * The method configurations. + * + * Generated from protobuf field repeated .grpc.gcp.MethodConfig method = 1001; + */ + private $method; + + public function __construct() + { + \GPBMetadata\GrpcGcp::initOnce(); + parent::__construct(); + } + + /** + * The channel pool configurations. + * + * Generated from protobuf field .grpc.gcp.ChannelPoolConfig channel_pool = 2; + * @return \Grpc\Gcp\ChannelPoolConfig + */ + public function getChannelPool() + { + return $this->channel_pool; + } + + /** + * The channel pool configurations. + * + * Generated from protobuf field .grpc.gcp.ChannelPoolConfig channel_pool = 2; + * @param \Grpc\Gcp\ChannelPoolConfig $var + * @return $this + */ + public function setChannelPool($var) + { + GPBUtil::checkMessage($var, \Grpc\Gcp\ChannelPoolConfig::class); + $this->channel_pool = $var; + + return $this; + } + + /** + * The method configurations. + * + * Generated from protobuf field repeated .grpc.gcp.MethodConfig method = 1001; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethod() + { + return $this->method; + } + + /** + * The method configurations. + * + * Generated from protobuf field repeated .grpc.gcp.MethodConfig method = 1001; + * @param \Grpc\Gcp\MethodConfig[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethod($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Gcp\MethodConfig::class); + $this->method = $arr; + + return $this; + } +} diff --git a/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ChannelPoolConfig.php b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ChannelPoolConfig.php new file mode 100644 index 0000000..7c03076 --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/ChannelPoolConfig.php @@ -0,0 +1,122 @@ +grpc.gcp.ChannelPoolConfig + */ +class ChannelPoolConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The max number of channels in the pool. + * + * Generated from protobuf field uint32 max_size = 1; + */ + private $max_size = 0; + /** + * The idle timeout (seconds) of channels without bound affinity sessions. + * + * Generated from protobuf field uint64 idle_timeout = 2; + */ + private $idle_timeout = 0; + /** + * The low watermark of max number of concurrent streams in a channel. + * New channel will be created once it get hit, until we reach the max size + * of the channel pool. + * + * Generated from protobuf field uint32 max_concurrent_streams_low_watermark = 3; + */ + private $max_concurrent_streams_low_watermark = 0; + + public function __construct() + { + \GPBMetadata\GrpcGcp::initOnce(); + parent::__construct(); + } + + /** + * The max number of channels in the pool. + * + * Generated from protobuf field uint32 max_size = 1; + * @return int + */ + public function getMaxSize() + { + return $this->max_size; + } + + /** + * The max number of channels in the pool. + * + * Generated from protobuf field uint32 max_size = 1; + * @param int $var + * @return $this + */ + public function setMaxSize($var) + { + GPBUtil::checkUint32($var); + $this->max_size = $var; + + return $this; + } + + /** + * The idle timeout (seconds) of channels without bound affinity sessions. + * + * Generated from protobuf field uint64 idle_timeout = 2; + * @return int|string + */ + public function getIdleTimeout() + { + return $this->idle_timeout; + } + + /** + * The idle timeout (seconds) of channels without bound affinity sessions. + * + * Generated from protobuf field uint64 idle_timeout = 2; + * @param int|string $var + * @return $this + */ + public function setIdleTimeout($var) + { + GPBUtil::checkUint64($var); + $this->idle_timeout = $var; + + return $this; + } + + /** + * The low watermark of max number of concurrent streams in a channel. + * New channel will be created once it get hit, until we reach the max size + * of the channel pool. + * + * Generated from protobuf field uint32 max_concurrent_streams_low_watermark = 3; + * @return int + */ + public function getMaxConcurrentStreamsLowWatermark() + { + return $this->max_concurrent_streams_low_watermark; + } + + /** + * The low watermark of max number of concurrent streams in a channel. + * New channel will be created once it get hit, until we reach the max size + * of the channel pool. + * + * Generated from protobuf field uint32 max_concurrent_streams_low_watermark = 3; + * @param int $var + * @return $this + */ + public function setMaxConcurrentStreamsLowWatermark($var) + { + GPBUtil::checkUint32($var); + $this->max_concurrent_streams_low_watermark = $var; + + return $this; + } +} diff --git a/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/MethodConfig.php b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/MethodConfig.php new file mode 100644 index 0000000..b60daf5 --- /dev/null +++ b/vendor/google/grpc-gcp/src/generated/Grpc/Gcp/MethodConfig.php @@ -0,0 +1,90 @@ +grpc.gcp.MethodConfig + */ +class MethodConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A fully qualified name of a gRPC method, or a wildcard pattern ending + * with .*, such as foo.bar.A, foo.bar.*. Method configs are evaluated + * sequentially, and the first one takes precedence. + * + * Generated from protobuf field repeated string name = 1; + */ + private $name; + /** + * The channel affinity configurations. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig affinity = 1001; + */ + private $affinity = null; + + public function __construct() + { + \GPBMetadata\GrpcGcp::initOnce(); + parent::__construct(); + } + + /** + * A fully qualified name of a gRPC method, or a wildcard pattern ending + * with .*, such as foo.bar.A, foo.bar.*. Method configs are evaluated + * sequentially, and the first one takes precedence. + * + * Generated from protobuf field repeated string name = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getName() + { + return $this->name; + } + + /** + * A fully qualified name of a gRPC method, or a wildcard pattern ending + * with .*, such as foo.bar.A, foo.bar.*. Method configs are evaluated + * sequentially, and the first one takes precedence. + * + * Generated from protobuf field repeated string name = 1; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->name = $arr; + + return $this; + } + + /** + * The channel affinity configurations. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig affinity = 1001; + * @return \Grpc\Gcp\AffinityConfig + */ + public function getAffinity() + { + return $this->affinity; + } + + /** + * The channel affinity configurations. + * + * Generated from protobuf field .grpc.gcp.AffinityConfig affinity = 1001; + * @param \Grpc\Gcp\AffinityConfig $var + * @return $this + */ + public function setAffinity($var) + { + GPBUtil::checkMessage($var, \Grpc\Gcp\AffinityConfig::class); + $this->affinity = $var; + + return $this; + } +} diff --git a/vendor/google/grpc-gcp/src/grpc_gcp.proto b/vendor/google/grpc-gcp/src/grpc_gcp.proto new file mode 100644 index 0000000..ff52db2 --- /dev/null +++ b/vendor/google/grpc-gcp/src/grpc_gcp.proto @@ -0,0 +1,70 @@ +// Copyright 2018 gRPC authors. +// +// 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. + +syntax = "proto3"; + +package grpc.gcp; + +message ApiConfig { + // The channel pool configurations. + ChannelPoolConfig channel_pool = 2; + + // The method configurations. + repeated MethodConfig method = 1001; +} + +message ChannelPoolConfig { + // The max number of channels in the pool. + uint32 max_size = 1; + // The idle timeout (seconds) of channels without bound affinity sessions. + uint64 idle_timeout = 2; + // The low watermark of max number of concurrent streams in a channel. + // New channel will be created once it get hit, until we reach the max size + // of the channel pool. + uint32 max_concurrent_streams_low_watermark = 3; +} + +message MethodConfig { + // A fully qualified name of a gRPC method, or a wildcard pattern ending + // with .*, such as foo.bar.A, foo.bar.*. Method configs are evaluated + // sequentially, and the first one takes precedence. + repeated string name = 1; + + // The channel affinity configurations. + AffinityConfig affinity = 1001; +} + +message AffinityConfig { + enum Command { + // The annotated method will be required to be bound to an existing session + // to execute the RPC. The corresponding will be + // used to find the affinity key from the request message. + BOUND = 0; + // The annotated method will establish the channel affinity with the channel + // which is used to execute the RPC. The corresponding + // will be used to find the affinity key from the + // response message. + BIND = 1; + // The annotated method will remove the channel affinity with the channel + // which is used to execute the RPC. The corresponding + // will be used to find the affinity key from the + // request message. + UNBIND = 2; + } + // The affinity command applies on the selected gRPC methods. + Command command = 2; + // The field path of the affinity key in the request/response message. + // For example: "f.a", "f.b.d", etc. + string affinity_key = 3; +} diff --git a/vendor/google/longrunning/.gitattributes b/vendor/google/longrunning/.gitattributes new file mode 100644 index 0000000..f51251a --- /dev/null +++ b/vendor/google/longrunning/.gitattributes @@ -0,0 +1,6 @@ +/*.xml.dist export-ignore +/tests export-ignore +/.github export-ignore +/.OwlBot.yaml export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore diff --git a/vendor/google/longrunning/CODE_OF_CONDUCT.md b/vendor/google/longrunning/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c372780 --- /dev/null +++ b/vendor/google/longrunning/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) \ No newline at end of file diff --git a/vendor/google/longrunning/CONTRIBUTING.md b/vendor/google/longrunning/CONTRIBUTING.md new file mode 100644 index 0000000..76ea811 --- /dev/null +++ b/vendor/google/longrunning/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/vendor/google/longrunning/LICENSE b/vendor/google/longrunning/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/google/longrunning/LICENSE @@ -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 [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. diff --git a/vendor/google/longrunning/README.md b/vendor/google/longrunning/README.md new file mode 100644 index 0000000..2b34d4f --- /dev/null +++ b/vendor/google/longrunning/README.md @@ -0,0 +1,44 @@ +# Google LongRunning API for PHP + +> Idiomatic PHP client for [Google LongRunning API](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning). + +[![Latest Stable Version](https://poser.pugx.org/google/longrunning/v/stable)](https://packagist.org/packages/google/longrunning) [![Packagist](https://img.shields.io/packagist/dm/google/longrunning.svg)](https://packagist.org/packages/google/longrunning) + +* [API documentation](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now to install just this component: + +```sh +$ composer require google/longrunning +``` + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) +please see our [gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Debugging + +Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) +for more information about the debugging tools. + +### Version + +This component is considered beta. As such, it should be expected to be mostly +stable and we're working towards a release candidate. We will address issues +and requests with a higher priority. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning/docs). diff --git a/vendor/google/longrunning/SECURITY.md b/vendor/google/longrunning/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/vendor/google/longrunning/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/longrunning/VERSION b/vendor/google/longrunning/VERSION new file mode 100644 index 0000000..8f0916f --- /dev/null +++ b/vendor/google/longrunning/VERSION @@ -0,0 +1 @@ +0.5.0 diff --git a/vendor/google/longrunning/composer.json b/vendor/google/longrunning/composer.json new file mode 100644 index 0000000..3df31cd --- /dev/null +++ b/vendor/google/longrunning/composer.json @@ -0,0 +1,26 @@ +{ + "name": "google/longrunning", + "description": "Google LongRunning Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "version": "0.5.0", + "autoload": { + "psr-4": { + "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", + "Google\\LongRunning\\": "src/LongRunning", + "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" + } + }, + "extra": { + "component": { + "id": "longrunning", + "path": "LongRunning", + "entry": null, + "target": "googleapis/php-longrunning" + } + }, + "require-dev": { + "google/gax": "^1.38.0", + "phpunit/phpunit": "^9.0" + } +} diff --git a/vendor/google/longrunning/metadata/Longrunning/Operations.php b/vendor/google/longrunning/metadata/Longrunning/Operations.php new file mode 100644 index 0000000..0dcf976 Binary files /dev/null and b/vendor/google/longrunning/metadata/Longrunning/Operations.php differ diff --git a/vendor/google/longrunning/metadata/README.md b/vendor/google/longrunning/metadata/README.md new file mode 100644 index 0000000..1bd4155 --- /dev/null +++ b/vendor/google/longrunning/metadata/README.md @@ -0,0 +1,6 @@ +# Google Protobuf Metadata Classes + +## WARNING! + +These classes are not intended for direct use - they exist only to support +the generated protobuf classes in src/ diff --git a/vendor/google/longrunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php b/vendor/google/longrunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php new file mode 100644 index 0000000..617c154 --- /dev/null +++ b/vendor/google/longrunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php @@ -0,0 +1,16 @@ +google.longrunning.CancelOperationRequest + */ +class CancelOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the operation resource to be cancelled. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + + /** + * @param string $name The name of the operation resource to be cancelled. + * + * @return \Google\LongRunning\CancelOperationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the operation resource to be cancelled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The name of the operation resource to be cancelled. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the operation resource to be cancelled. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php b/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php new file mode 100644 index 0000000..ea86623 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php @@ -0,0 +1,344 @@ + cancelOperationAsync(CancelOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteOperationAsync(DeleteOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getOperationAsync(GetOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listOperationsAsync(ListOperationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface waitOperationAsync(WaitOperationRequest $request, array $optionalArgs = []) + */ +class OperationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.longrunning.Operations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'longrunning.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'longrunning.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = []; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/operations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/operations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/operations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'longrunning.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\LongRunning\OperationsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new OperationsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. + * + * The async variant is {@see OperationsClient::cancelOperationAsync()} . + * + * @example samples/OperationsClient/cancel_operation.php + * + * @param CancelOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelOperation(CancelOperationRequest $request, array $callOptions = []): void + { + $this->startApiCall('CancelOperation', $request, $callOptions)->wait(); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * The async variant is {@see OperationsClient::deleteOperationAsync()} . + * + * @example samples/OperationsClient/delete_operation.php + * + * @param DeleteOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteOperation(DeleteOperationRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteOperation', $request, $callOptions)->wait(); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * The async variant is {@see OperationsClient::getOperationAsync()} . + * + * @example samples/OperationsClient/get_operation.php + * + * @param GetOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getOperation(GetOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('GetOperation', $request, $callOptions)->wait(); + } + + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * The async variant is {@see OperationsClient::listOperationsAsync()} . + * + * @example samples/OperationsClient/list_operations.php + * + * @param ListOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listOperations(ListOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOperations', $request, $callOptions); + } + + /** + * Waits until the specified long-running operation is done or reaches at most + * a specified timeout, returning the latest state. If the operation is + * already done, the latest state is immediately returned. If the timeout + * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + * timeout is used. If the server does not support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * Note that this method is on a best-effort basis. It may return the latest + * state before the specified timeout (including immediately), meaning even an + * immediate response is no guarantee that the operation is done. + * + * The async variant is {@see OperationsClient::waitOperationAsync()} . + * + * @example samples/OperationsClient/wait_operation.php + * + * @param WaitOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function waitOperation(WaitOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('WaitOperation', $request, $callOptions)->wait(); + } +} diff --git a/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php b/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php new file mode 100644 index 0000000..c79382a --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php @@ -0,0 +1,81 @@ +google.longrunning.DeleteOperationRequest + */ +class DeleteOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the operation resource to be deleted. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + + /** + * @param string $name The name of the operation resource to be deleted. + * + * @return \Google\LongRunning\DeleteOperationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the operation resource to be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The name of the operation resource to be deleted. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the operation resource to be deleted. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php b/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php new file mode 100644 index 0000000..3c31a4f --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php @@ -0,0 +1,476 @@ +cancelOperation($name); + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\LongRunning\Client\OperationsClient}. + */ +class OperationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.longrunning.Operations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'longrunning.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'longrunning.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = []; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => + self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => + __DIR__ . '/../resources/operations_client_config.json', + 'descriptorsConfigPath' => + __DIR__ . '/../resources/operations_descriptor_config.php', + 'gcpApiConfigPath' => + __DIR__ . '/../resources/operations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . + '/../resources/operations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'longrunning.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. + * + * Sample code: + * ``` + * $operationsClient = new OperationsClient(); + * try { + * $name = 'name'; + * $operationsClient->cancelOperation($name); + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @param string $name The name of the operation resource to be cancelled. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function cancelOperation($name, array $optionalArgs = []) + { + $request = new CancelOperationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'CancelOperation', + GPBEmpty::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * Sample code: + * ``` + * $operationsClient = new OperationsClient(); + * try { + * $name = 'name'; + * $operationsClient->deleteOperation($name); + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @param string $name The name of the operation resource to be deleted. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteOperation($name, array $optionalArgs = []) + { + $request = new DeleteOperationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'DeleteOperation', + GPBEmpty::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * Sample code: + * ``` + * $operationsClient = new OperationsClient(); + * try { + * $name = 'name'; + * $response = $operationsClient->getOperation($name); + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @param string $name The name of the operation resource. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\LongRunning\Operation + * + * @throws ApiException if the remote call fails + */ + public function getOperation($name, array $optionalArgs = []) + { + $request = new GetOperationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetOperation', + Operation::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * Sample code: + * ``` + * $operationsClient = new OperationsClient(); + * try { + * $name = 'name'; + * $filter = 'filter'; + * // Iterate over pages of elements + * $pagedResponse = $operationsClient->listOperations($name, $filter); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $operationsClient->listOperations($name, $filter); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @param string $name The name of the operation's parent resource. + * @param string $filter The standard list filter. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listOperations($name, $filter, array $optionalArgs = []) + { + $request = new ListOperationsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setFilter($filter); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListOperations', + $optionalArgs, + ListOperationsResponse::class, + $request + ); + } + + /** + * Waits until the specified long-running operation is done or reaches at most + * a specified timeout, returning the latest state. If the operation is + * already done, the latest state is immediately returned. If the timeout + * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + * timeout is used. If the server does not support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * Note that this method is on a best-effort basis. It may return the latest + * state before the specified timeout (including immediately), meaning even an + * immediate response is no guarantee that the operation is done. + * + * Sample code: + * ``` + * $operationsClient = new OperationsClient(); + * try { + * $response = $operationsClient->waitOperation(); + * } finally { + * $operationsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The name of the operation resource to wait on. + * @type Duration $timeout + * The maximum duration to wait before timing out. If left blank, the wait + * will be at most the time permitted by the underlying HTTP/RPC protocol. + * If RPC context deadline is also specified, the shorter one will be used. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\LongRunning\Operation + * + * @throws ApiException if the remote call fails + */ + public function waitOperation(array $optionalArgs = []) + { + $request = new WaitOperationRequest(); + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + if (isset($optionalArgs['timeout'])) { + $request->setTimeout($optionalArgs['timeout']); + } + + return $this->startCall( + 'WaitOperation', + Operation::class, + $optionalArgs, + $request + )->wait(); + } +} diff --git a/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php b/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php new file mode 100644 index 0000000..1fa48a5 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php @@ -0,0 +1,81 @@ +google.longrunning.GetOperationRequest + */ +class GetOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the operation resource. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + + /** + * @param string $name The name of the operation resource. + * + * @return \Google\LongRunning\GetOperationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the operation resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The name of the operation resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the operation resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php b/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php new file mode 100644 index 0000000..08049d2 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php @@ -0,0 +1,185 @@ +google.longrunning.ListOperationsRequest + */ +class ListOperationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the operation's parent resource. + * + * Generated from protobuf field string name = 4; + */ + private $name = ''; + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 1; + */ + private $filter = ''; + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 2; + */ + private $page_size = 0; + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 3; + */ + private $page_token = ''; + + /** + * @param string $name The name of the operation's parent resource. + * @param string $filter The standard list filter. + * + * @return \Google\LongRunning\ListOperationsRequest + * + * @experimental + */ + public static function build(string $name, string $filter): self + { + return (new self()) + ->setName($name) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the operation's parent resource. + * @type string $filter + * The standard list filter. + * @type int $page_size + * The standard list page size. + * @type string $page_token + * The standard list page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The name of the operation's parent resource. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the operation's parent resource. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 1; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The standard list filter. + * + * Generated from protobuf field string filter = 1; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The standard list page size. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The standard list page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php b/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php new file mode 100644 index 0000000..4fd2718 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php @@ -0,0 +1,102 @@ +google.longrunning.ListOperationsResponse + */ +class ListOperationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of operations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; + */ + private $operations; + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\LongRunning\Operation>|\Google\Protobuf\Internal\RepeatedField $operations + * A list of operations that matches the specified filter in the request. + * @type string $next_page_token + * The standard List next-page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * A list of operations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOperations() + { + return $this->operations; + } + + /** + * A list of operations that matches the specified filter in the request. + * + * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; + * @param array<\Google\LongRunning\Operation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOperations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\LongRunning\Operation::class); + $this->operations = $arr; + + return $this; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/Operation.php b/vendor/google/longrunning/src/LongRunning/Operation.php new file mode 100644 index 0000000..e8fec9e --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/Operation.php @@ -0,0 +1,270 @@ +google.longrunning.Operation + */ +class Operation extends \Google\Protobuf\Internal\Message +{ + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should be a resource name ending with `operations/{unique_id}`. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * Generated from protobuf field .google.protobuf.Any metadata = 2; + */ + private $metadata = null; + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * Generated from protobuf field bool done = 3; + */ + private $done = false; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should be a resource name ending with `operations/{unique_id}`. + * @type \Google\Protobuf\Any $metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * @type bool $done + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * @type \Google\Rpc\Status $error + * The error result of the operation in case of failure or cancellation. + * @type \Google\Protobuf\Any $response + * The normal, successful response of the operation. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should be a resource name ending with `operations/{unique_id}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should be a resource name ending with `operations/{unique_id}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * Generated from protobuf field .google.protobuf.Any metadata = 2; + * @return \Google\Protobuf\Any|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * Generated from protobuf field .google.protobuf.Any metadata = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->metadata = $var; + + return $this; + } + + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * Generated from protobuf field bool done = 3; + * @return bool + */ + public function getDone() + { + return $this->done; + } + + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * Generated from protobuf field bool done = 3; + * @param bool $var + * @return $this + */ + public function setDone($var) + { + GPBUtil::checkBool($var); + $this->done = $var; + + return $this; + } + + /** + * The error result of the operation in case of failure or cancellation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(4); + } + + public function hasError() + { + return $this->hasOneof(4); + } + + /** + * The error result of the operation in case of failure or cancellation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The normal, successful response of the operation. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * Generated from protobuf field .google.protobuf.Any response = 5; + * @return \Google\Protobuf\Any|null + */ + public function getResponse() + { + return $this->readOneof(5); + } + + public function hasResponse() + { + return $this->hasOneof(5); + } + + /** + * The normal, successful response of the operation. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * Generated from protobuf field .google.protobuf.Any response = 5; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/OperationInfo.php b/vendor/google/longrunning/src/LongRunning/OperationInfo.php new file mode 100644 index 0000000..c653319 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/OperationInfo.php @@ -0,0 +1,144 @@ +google.longrunning.OperationInfo + */ +class OperationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The message name of the primary return type for this + * long-running operation. + * This type will be used to deserialize the LRO's response. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string response_type = 1; + */ + private $response_type = ''; + /** + * Required. The message name of the metadata type for this long-running + * operation. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string metadata_type = 2; + */ + private $metadata_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_type + * Required. The message name of the primary return type for this + * long-running operation. + * This type will be used to deserialize the LRO's response. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * @type string $metadata_type + * Required. The message name of the metadata type for this long-running + * operation. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Required. The message name of the primary return type for this + * long-running operation. + * This type will be used to deserialize the LRO's response. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string response_type = 1; + * @return string + */ + public function getResponseType() + { + return $this->response_type; + } + + /** + * Required. The message name of the primary return type for this + * long-running operation. + * This type will be used to deserialize the LRO's response. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string response_type = 1; + * @param string $var + * @return $this + */ + public function setResponseType($var) + { + GPBUtil::checkString($var, True); + $this->response_type = $var; + + return $this; + } + + /** + * Required. The message name of the metadata type for this long-running + * operation. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string metadata_type = 2; + * @return string + */ + public function getMetadataType() + { + return $this->metadata_type; + } + + /** + * Required. The message name of the metadata type for this long-running + * operation. + * If the response is in a different package from the rpc, a fully-qualified + * message name must be used (e.g. `google.protobuf.Struct`). + * Note: Altering this value constitutes a breaking change. + * + * Generated from protobuf field string metadata_type = 2; + * @param string $var + * @return $this + */ + public function setMetadataType($var) + { + GPBUtil::checkString($var, True); + $this->metadata_type = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/OperationsClient.php b/vendor/google/longrunning/src/LongRunning/OperationsClient.php new file mode 100644 index 0000000..04e2717 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/OperationsClient.php @@ -0,0 +1,36 @@ +_simpleRequest('/google.longrunning.Operations/ListOperations', + $argument, + ['\Google\LongRunning\ListOperationsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * @param \Google\LongRunning\GetOperationRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetOperation(\Google\LongRunning\GetOperationRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.longrunning.Operations/GetOperation', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * @param \Google\LongRunning\DeleteOperationRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteOperation(\Google\LongRunning\DeleteOperationRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.longrunning.Operations/DeleteOperation', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * @param \Google\LongRunning\CancelOperationRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CancelOperation(\Google\LongRunning\CancelOperationRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.longrunning.Operations/CancelOperation', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Waits until the specified long-running operation is done or reaches at most + * a specified timeout, returning the latest state. If the operation is + * already done, the latest state is immediately returned. If the timeout + * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + * timeout is used. If the server does not support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * Note that this method is on a best-effort basis. It may return the latest + * state before the specified timeout (including immediately), meaning even an + * immediate response is no guarantee that the operation is done. + * @param \Google\LongRunning\WaitOperationRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function WaitOperation(\Google\LongRunning\WaitOperationRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.longrunning.Operations/WaitOperation', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + +} diff --git a/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php b/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php new file mode 100644 index 0000000..0791409 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php @@ -0,0 +1,120 @@ +google.longrunning.WaitOperationRequest + */ +class WaitOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the operation resource to wait on. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * The maximum duration to wait before timing out. If left blank, the wait + * will be at most the time permitted by the underlying HTTP/RPC protocol. + * If RPC context deadline is also specified, the shorter one will be used. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + */ + private $timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the operation resource to wait on. + * @type \Google\Protobuf\Duration $timeout + * The maximum duration to wait before timing out. If left blank, the wait + * will be at most the time permitted by the underlying HTTP/RPC protocol. + * If RPC context deadline is also specified, the shorter one will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Longrunning\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The name of the operation resource to wait on. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the operation resource to wait on. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The maximum duration to wait before timing out. If left blank, the wait + * will be at most the time permitted by the underlying HTTP/RPC protocol. + * If RPC context deadline is also specified, the shorter one will be used. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * The maximum duration to wait before timing out. If left blank, the wait + * will be at most the time permitted by the underlying HTTP/RPC protocol. + * If RPC context deadline is also specified, the shorter one will be used. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + +} + diff --git a/vendor/google/longrunning/src/LongRunning/resources/operations_client_config.json b/vendor/google/longrunning/src/LongRunning/resources/operations_client_config.json new file mode 100644 index 0000000..cbc0a41 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/resources/operations_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.longrunning.Operations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 500, + "retry_delay_multiplier": 2.0, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + } + }, + "methods": { + "CancelOperation": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteOperation": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetOperation": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOperations": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "WaitOperation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/vendor/google/longrunning/src/LongRunning/resources/operations_descriptor_config.php b/vendor/google/longrunning/src/LongRunning/resources/operations_descriptor_config.php new file mode 100644 index 0000000..a577192 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/resources/operations_descriptor_config.php @@ -0,0 +1,88 @@ + [ + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\LongRunning\Operation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOperations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\LongRunning\ListOperationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\LongRunning\Operation', + ], + ], + ], +]; diff --git a/vendor/google/longrunning/src/LongRunning/resources/operations_rest_client_config.php b/vendor/google/longrunning/src/LongRunning/resources/operations_rest_client_config.php new file mode 100644 index 0000000..dfdf3c1 --- /dev/null +++ b/vendor/google/longrunning/src/LongRunning/resources/operations_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=operations/**}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=operations}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'filter', + ], + ], + ], + ], +]; diff --git a/vendor/google/protobuf/LICENSE b/vendor/google/protobuf/LICENSE new file mode 100644 index 0000000..ba32af4 --- /dev/null +++ b/vendor/google/protobuf/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Protocol Buffers +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/google/protobuf/README.md b/vendor/google/protobuf/README.md new file mode 100644 index 0000000..3663050 --- /dev/null +++ b/vendor/google/protobuf/README.md @@ -0,0 +1,2 @@ +# protobuf-php +This repository contains only PHP files to support Composer installation. This repository is a mirror of [protobuf](https://github.com/protocolbuffers/protobuf). Any support requests, bug reports, or development contributions should be directed to that project. To install protobuf for PHP, please see https://github.com/protocolbuffers/protobuf/tree/master/php diff --git a/vendor/google/protobuf/composer.json b/vendor/google/protobuf/composer.json new file mode 100644 index 0000000..5346472 --- /dev/null +++ b/vendor/google/protobuf/composer.json @@ -0,0 +1,24 @@ +{ + "name": "google/protobuf", + "type": "library", + "description": "proto library for PHP", + "keywords": ["proto"], + "homepage": "https://developers.google.com/protocol-buffers/", + "license": "BSD-3-Clause", + "require": { + "php": ">=8.1.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0 <8.5.27" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php new file mode 100644 index 0000000..c9a2952 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xD4\x01\x0A\x19google/protobuf/any.proto\x12\x0Fgoogle.protobuf\"&\x0A\x03Any\x12\x10\x0A\x08type_url\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x0CBv\x0A\x13com.google.protobufB\x08AnyProtoP\x01Z,google.golang.org/protobuf/types/known/anypb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php new file mode 100644 index 0000000..83e2748 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\xF3\x05\x0A\x19google/protobuf/api.proto\x12\x0Fgoogle.protobuf\x1A\x1Agoogle/protobuf/type.proto\"\x92\x02\x0A\x03Api\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12(\x0A\x07methods\x18\x02 \x03(\x0B2\x17.google.protobuf.Method\x12(\x0A\x07options\x18\x03 \x03(\x0B2\x17.google.protobuf.Option\x12\x0F\x0A\x07version\x18\x04 \x01(\x09\x126\x0A\x0Esource_context\x18\x05 \x01(\x0B2\x1E.google.protobuf.SourceContext\x12&\x0A\x06mixins\x18\x06 \x03(\x0B2\x16.google.protobuf.Mixin\x12'\x0A\x06syntax\x18\x07 \x01(\x0E2\x17.google.protobuf.Syntax\x12\x0F\x0A\x07edition\x18\x08 \x01(\x09\"\xEE\x01\x0A\x06Method\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x18\x0A\x10request_type_url\x18\x02 \x01(\x09\x12\x19\x0A\x11request_streaming\x18\x03 \x01(\x08\x12\x19\x0A\x11response_type_url\x18\x04 \x01(\x09\x12\x1A\x0A\x12response_streaming\x18\x05 \x01(\x08\x12(\x0A\x07options\x18\x06 \x03(\x0B2\x17.google.protobuf.Option\x12+\x0A\x06syntax\x18\x07 \x01(\x0E2\x17.google.protobuf.SyntaxB\x02\x18\x01\x12\x13\x0A\x07edition\x18\x08 \x01(\x09B\x02\x18\x01\"#\x0A\x05Mixin\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x0C\x0A\x04root\x18\x02 \x01(\x09Bv\x0A\x13com.google.protobufB\x08ApiProtoP\x01Z,google.golang.org/protobuf/types/known/apipb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php new file mode 100644 index 0000000..29e02a8 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xEB\x01\x0A\x1Egoogle/protobuf/duration.proto\x12\x0Fgoogle.protobuf\"*\x0A\x08Duration\x12\x0F\x0A\x07seconds\x18\x01 \x01(\x03\x12\x0D\x0A\x05nanos\x18\x02 \x01(\x05B\x83\x01\x0A\x13com.google.protobufB\x0DDurationProtoP\x01Z1google.golang.org/protobuf/types/known/durationpb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php new file mode 100644 index 0000000..394e410 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xDF\x01\x0A google/protobuf/field_mask.proto\x12\x0Fgoogle.protobuf\"\x1A\x0A\x09FieldMask\x12\x0D\x0A\x05paths\x18\x01 \x03(\x09B\x85\x01\x0A\x13com.google.protobufB\x0EFieldMaskProtoP\x01Z2google.golang.org/protobuf/types/known/fieldmaskpb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php new file mode 100644 index 0000000..2842d0e --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xBE\x01\x0A\x1Bgoogle/protobuf/empty.proto\x12\x0Fgoogle.protobuf\"\x07\x0A\x05EmptyB}\x0A\x13com.google.protobufB\x0AEmptyProtoP\x01Z.google.golang.org/protobuf/types/known/emptypb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php new file mode 100644 index 0000000..84486a9 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php @@ -0,0 +1,452 @@ +addMessage('google.protobuf.internal.FileDescriptorSet', \Google\Protobuf\Internal\FileDescriptorSet::class) + ->repeated('file', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FileDescriptorProto') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FileDescriptorProto', \Google\Protobuf\Internal\FileDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('package', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->repeated('dependency', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->repeated('public_dependency', \Google\Protobuf\Internal\GPBType::INT32, 10) + ->repeated('weak_dependency', \Google\Protobuf\Internal\GPBType::INT32, 11) + ->repeated('option_dependency', \Google\Protobuf\Internal\GPBType::STRING, 15) + ->repeated('message_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.DescriptorProto') + ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.EnumDescriptorProto') + ->repeated('service', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.ServiceDescriptorProto') + ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.FieldDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FileOptions') + ->optional('source_code_info', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.SourceCodeInfo') + ->optional('syntax', \Google\Protobuf\Internal\GPBType::STRING, 12) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 14, 'google.protobuf.internal.Edition') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto', \Google\Protobuf\Internal\DescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('field', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.FieldDescriptorProto') + ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.FieldDescriptorProto') + ->repeated('nested_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.DescriptorProto') + ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto') + ->repeated('extension_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.DescriptorProto.ExtensionRange') + ->repeated('oneof_decl', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.OneofDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.MessageOptions') + ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.DescriptorProto.ReservedRange') + ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 10) + ->optional('visibility', \Google\Protobuf\Internal\GPBType::ENUM, 11, 'google.protobuf.internal.SymbolVisibility') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto.ExtensionRange', \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ExtensionRangeOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto.ReservedRange', \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions', \Google\Protobuf\Internal\ExtensionRangeOptions::class) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->repeated('declaration', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.ExtensionRangeOptions.Declaration') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 50, 'google.protobuf.internal.FeatureSet') + ->optional('verification', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.ExtensionRangeOptions.VerificationState') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions.Declaration', \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration::class) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('full_name', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('type', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('reserved', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('repeated', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.ExtensionRangeOptions.VerificationState', \Google\Protobuf\Internal\VerificationState::class) + ->value("DECLARATION", 0) + ->value("UNVERIFIED", 1) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldDescriptorProto', \Google\Protobuf\Internal\FieldDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 3) + ->optional('label', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.FieldDescriptorProto.Label') + ->optional('type', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.FieldDescriptorProto.Type') + ->optional('type_name', \Google\Protobuf\Internal\GPBType::STRING, 6) + ->optional('extendee', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('default_value', \Google\Protobuf\Internal\GPBType::STRING, 7) + ->optional('oneof_index', \Google\Protobuf\Internal\GPBType::INT32, 9) + ->optional('json_name', \Google\Protobuf\Internal\GPBType::STRING, 10) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FieldOptions') + ->optional('proto3_optional', \Google\Protobuf\Internal\GPBType::BOOL, 17) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Type', \Google\Protobuf\Internal\Type::class) + ->value("TYPE_DOUBLE", 1) + ->value("TYPE_FLOAT", 2) + ->value("TYPE_INT64", 3) + ->value("TYPE_UINT64", 4) + ->value("TYPE_INT32", 5) + ->value("TYPE_FIXED64", 6) + ->value("TYPE_FIXED32", 7) + ->value("TYPE_BOOL", 8) + ->value("TYPE_STRING", 9) + ->value("TYPE_GROUP", 10) + ->value("TYPE_MESSAGE", 11) + ->value("TYPE_BYTES", 12) + ->value("TYPE_UINT32", 13) + ->value("TYPE_ENUM", 14) + ->value("TYPE_SFIXED32", 15) + ->value("TYPE_SFIXED64", 16) + ->value("TYPE_SINT32", 17) + ->value("TYPE_SINT64", 18) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Label', \Google\Protobuf\Internal\Label::class) + ->value("LABEL_OPTIONAL", 1) + ->value("LABEL_REPEATED", 3) + ->value("LABEL_REQUIRED", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.OneofDescriptorProto', \Google\Protobuf\Internal\OneofDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.OneofOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumDescriptorProto', \Google\Protobuf\Internal\EnumDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('value', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.EnumValueDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumOptions') + ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto.EnumReservedRange') + ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 5) + ->optional('visibility', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.SymbolVisibility') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumDescriptorProto.EnumReservedRange', \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumValueDescriptorProto', \Google\Protobuf\Internal\EnumValueDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumValueOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ServiceDescriptorProto', \Google\Protobuf\Internal\ServiceDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('method', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.MethodDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ServiceOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MethodDescriptorProto', \Google\Protobuf\Internal\MethodDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('input_type', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('output_type', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.MethodOptions') + ->optional('client_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('server_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FileOptions', \Google\Protobuf\Internal\FileOptions::class) + ->optional('java_package', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('java_outer_classname', \Google\Protobuf\Internal\GPBType::STRING, 8) + ->optional('java_multiple_files', \Google\Protobuf\Internal\GPBType::BOOL, 10) + ->optional('java_generate_equals_and_hash', \Google\Protobuf\Internal\GPBType::BOOL, 20) + ->optional('java_string_check_utf8', \Google\Protobuf\Internal\GPBType::BOOL, 27) + ->optional('optimize_for', \Google\Protobuf\Internal\GPBType::ENUM, 9, 'google.protobuf.internal.FileOptions.OptimizeMode') + ->optional('go_package', \Google\Protobuf\Internal\GPBType::STRING, 11) + ->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16) + ->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17) + ->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23) + ->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31) + ->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36) + ->optional('csharp_namespace', \Google\Protobuf\Internal\GPBType::STRING, 37) + ->optional('swift_prefix', \Google\Protobuf\Internal\GPBType::STRING, 39) + ->optional('php_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 40) + ->optional('php_namespace', \Google\Protobuf\Internal\GPBType::STRING, 41) + ->optional('php_metadata_namespace', \Google\Protobuf\Internal\GPBType::STRING, 44) + ->optional('ruby_package', \Google\Protobuf\Internal\GPBType::STRING, 45) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 50, 'google.protobuf.internal.FeatureSet') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FileOptions.OptimizeMode', \Google\Protobuf\Internal\OptimizeMode::class) + ->value("SPEED", 1) + ->value("CODE_SIZE", 2) + ->value("LITE_RUNTIME", 3) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MessageOptions', \Google\Protobuf\Internal\MessageOptions::class) + ->optional('message_set_wire_format', \Google\Protobuf\Internal\GPBType::BOOL, 1) + ->optional('no_standard_descriptor_accessor', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('map_entry', \Google\Protobuf\Internal\GPBType::BOOL, 7) + ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 11) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 12, 'google.protobuf.internal.FeatureSet') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldOptions', \Google\Protobuf\Internal\FieldOptions::class) + ->optional('ctype', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.FieldOptions.CType') + ->optional('packed', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('jstype', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.FieldOptions.JSType') + ->optional('lazy', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('unverified_lazy', \Google\Protobuf\Internal\GPBType::BOOL, 15) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('weak', \Google\Protobuf\Internal\GPBType::BOOL, 10) + ->optional('debug_redact', \Google\Protobuf\Internal\GPBType::BOOL, 16) + ->optional('retention', \Google\Protobuf\Internal\GPBType::ENUM, 17, 'google.protobuf.internal.FieldOptions.OptionRetention') + ->repeated('targets', \Google\Protobuf\Internal\GPBType::ENUM, 19, 'google.protobuf.internal.FieldOptions.OptionTargetType') + ->repeated('edition_defaults', \Google\Protobuf\Internal\GPBType::MESSAGE, 20, 'google.protobuf.internal.FieldOptions.EditionDefault') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 21, 'google.protobuf.internal.FeatureSet') + ->optional('feature_support', \Google\Protobuf\Internal\GPBType::MESSAGE, 22, 'google.protobuf.internal.FieldOptions.FeatureSupport') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldOptions.EditionDefault', \Google\Protobuf\Internal\FieldOptions\EditionDefault::class) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.Edition') + ->optional('value', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldOptions.FeatureSupport', \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class) + ->optional('edition_introduced', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.Edition') + ->optional('edition_deprecated', \Google\Protobuf\Internal\GPBType::ENUM, 2, 'google.protobuf.internal.Edition') + ->optional('deprecation_warning', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('edition_removed', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.Edition') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.CType', \Google\Protobuf\Internal\CType::class) + ->value("STRING", 0) + ->value("CORD", 1) + ->value("STRING_PIECE", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.JSType', \Google\Protobuf\Internal\JSType::class) + ->value("JS_NORMAL", 0) + ->value("JS_STRING", 1) + ->value("JS_NUMBER", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.OptionRetention', \Google\Protobuf\Internal\OptionRetention::class) + ->value("RETENTION_UNKNOWN", 0) + ->value("RETENTION_RUNTIME", 1) + ->value("RETENTION_SOURCE", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.OptionTargetType', \Google\Protobuf\Internal\OptionTargetType::class) + ->value("TARGET_TYPE_UNKNOWN", 0) + ->value("TARGET_TYPE_FILE", 1) + ->value("TARGET_TYPE_EXTENSION_RANGE", 2) + ->value("TARGET_TYPE_MESSAGE", 3) + ->value("TARGET_TYPE_FIELD", 4) + ->value("TARGET_TYPE_ONEOF", 5) + ->value("TARGET_TYPE_ENUM", 6) + ->value("TARGET_TYPE_ENUM_ENTRY", 7) + ->value("TARGET_TYPE_SERVICE", 8) + ->value("TARGET_TYPE_METHOD", 9) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.OneofOptions', \Google\Protobuf\Internal\OneofOptions::class) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FeatureSet') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumOptions', \Google\Protobuf\Internal\EnumOptions::class) + ->optional('allow_alias', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.FeatureSet') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumValueOptions', \Google\Protobuf\Internal\EnumValueOptions::class) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 1) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.FeatureSet') + ->optional('debug_redact', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('feature_support', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.FieldOptions.FeatureSupport') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ServiceOptions', \Google\Protobuf\Internal\ServiceOptions::class) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 34, 'google.protobuf.internal.FeatureSet') + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MethodOptions', \Google\Protobuf\Internal\MethodOptions::class) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) + ->optional('idempotency_level', \Google\Protobuf\Internal\GPBType::ENUM, 34, 'google.protobuf.internal.MethodOptions.IdempotencyLevel') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 35, 'google.protobuf.internal.FeatureSet') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.MethodOptions.IdempotencyLevel', \Google\Protobuf\Internal\IdempotencyLevel::class) + ->value("IDEMPOTENCY_UNKNOWN", 0) + ->value("NO_SIDE_EFFECTS", 1) + ->value("IDEMPOTENT", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.UninterpretedOption', \Google\Protobuf\Internal\UninterpretedOption::class) + ->repeated('name', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.UninterpretedOption.NamePart') + ->optional('identifier_value', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('positive_int_value', \Google\Protobuf\Internal\GPBType::UINT64, 4) + ->optional('negative_int_value', \Google\Protobuf\Internal\GPBType::INT64, 5) + ->optional('double_value', \Google\Protobuf\Internal\GPBType::DOUBLE, 6) + ->optional('string_value', \Google\Protobuf\Internal\GPBType::BYTES, 7) + ->optional('aggregate_value', \Google\Protobuf\Internal\GPBType::STRING, 8) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.UninterpretedOption.NamePart', \Google\Protobuf\Internal\UninterpretedOption\NamePart::class) + ->required('name_part', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->required('is_extension', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSet', \Google\Protobuf\Internal\FeatureSet::class) + ->optional('field_presence', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.FeatureSet.FieldPresence') + ->optional('enum_type', \Google\Protobuf\Internal\GPBType::ENUM, 2, 'google.protobuf.internal.FeatureSet.EnumType') + ->optional('repeated_field_encoding', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.FeatureSet.RepeatedFieldEncoding') + ->optional('utf8_validation', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.FeatureSet.Utf8Validation') + ->optional('message_encoding', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.FeatureSet.MessageEncoding') + ->optional('json_format', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.FeatureSet.JsonFormat') + ->optional('enforce_naming_style', \Google\Protobuf\Internal\GPBType::ENUM, 7, 'google.protobuf.internal.FeatureSet.EnforceNamingStyle') + ->optional('default_symbol_visibility', \Google\Protobuf\Internal\GPBType::ENUM, 8, 'google.protobuf.internal.FeatureSet.VisibilityFeature.DefaultSymbolVisibility') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSet.VisibilityFeature', \Google\Protobuf\Internal\FeatureSet\VisibilityFeature::class) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.VisibilityFeature.DefaultSymbolVisibility', \Google\Protobuf\Internal\DefaultSymbolVisibility::class) + ->value("DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", 0) + ->value("EXPORT_ALL", 1) + ->value("EXPORT_TOP_LEVEL", 2) + ->value("LOCAL_ALL", 3) + ->value("STRICT", 4) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.FieldPresence', \Google\Protobuf\Internal\FieldPresence::class) + ->value("FIELD_PRESENCE_UNKNOWN", 0) + ->value("EXPLICIT", 1) + ->value("IMPLICIT", 2) + ->value("LEGACY_REQUIRED", 3) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.EnumType', \Google\Protobuf\Internal\EnumType::class) + ->value("ENUM_TYPE_UNKNOWN", 0) + ->value("OPEN", 1) + ->value("CLOSED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.RepeatedFieldEncoding', \Google\Protobuf\Internal\RepeatedFieldEncoding::class) + ->value("REPEATED_FIELD_ENCODING_UNKNOWN", 0) + ->value("PACKED", 1) + ->value("EXPANDED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.Utf8Validation', \Google\Protobuf\Internal\Utf8Validation::class) + ->value("UTF8_VALIDATION_UNKNOWN", 0) + ->value("VERIFY", 2) + ->value("NONE", 3) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.MessageEncoding', \Google\Protobuf\Internal\MessageEncoding::class) + ->value("MESSAGE_ENCODING_UNKNOWN", 0) + ->value("LENGTH_PREFIXED", 1) + ->value("DELIMITED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.JsonFormat', \Google\Protobuf\Internal\JsonFormat::class) + ->value("JSON_FORMAT_UNKNOWN", 0) + ->value("ALLOW", 1) + ->value("LEGACY_BEST_EFFORT", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.EnforceNamingStyle', \Google\Protobuf\Internal\EnforceNamingStyle::class) + ->value("ENFORCE_NAMING_STYLE_UNKNOWN", 0) + ->value("STYLE2024", 1) + ->value("STYLE_LEGACY", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSetDefaults', \Google\Protobuf\Internal\FeatureSetDefaults::class) + ->repeated('defaults', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FeatureSetDefaults.FeatureSetEditionDefault') + ->optional('minimum_edition', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.Edition') + ->optional('maximum_edition', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.Edition') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSetDefaults.FeatureSetEditionDefault', \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.Edition') + ->optional('overridable_features', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.FeatureSet') + ->optional('fixed_features', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.FeatureSet') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.SourceCodeInfo', \Google\Protobuf\Internal\SourceCodeInfo::class) + ->repeated('location', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.SourceCodeInfo.Location') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.SourceCodeInfo.Location', \Google\Protobuf\Internal\SourceCodeInfo\Location::class) + ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->repeated('span', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('leading_comments', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('trailing_comments', \Google\Protobuf\Internal\GPBType::STRING, 4) + ->repeated('leading_detached_comments', \Google\Protobuf\Internal\GPBType::STRING, 6) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo', \Google\Protobuf\Internal\GeneratedCodeInfo::class) + ->repeated('annotation', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.GeneratedCodeInfo.Annotation') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo.Annotation', \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class) + ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('source_file', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('begin', \Google\Protobuf\Internal\GPBType::INT32, 3) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 4) + ->optional('semantic', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.GeneratedCodeInfo.Annotation.Semantic') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.GeneratedCodeInfo.Annotation.Semantic', \Google\Protobuf\Internal\Semantic::class) + ->value("NONE", 0) + ->value("SET", 1) + ->value("ALIAS", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.Edition', \Google\Protobuf\Internal\Edition::class) + ->value("EDITION_UNKNOWN", 0) + ->value("EDITION_LEGACY", 900) + ->value("EDITION_PROTO2", 998) + ->value("EDITION_PROTO3", 999) + ->value("EDITION_2023", 1000) + ->value("EDITION_2024", 1001) + ->value("EDITION_1_TEST_ONLY", 1) + ->value("EDITION_2_TEST_ONLY", 2) + ->value("EDITION_99997_TEST_ONLY", 99997) + ->value("EDITION_99998_TEST_ONLY", 99998) + ->value("EDITION_99999_TEST_ONLY", 99999) + ->value("EDITION_MAX", 2147483647) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.SymbolVisibility', \Google\Protobuf\Internal\SymbolVisibility::class) + ->value("VISIBILITY_UNSET", 0) + ->value("VISIBILITY_LOCAL", 1) + ->value("VISIBILITY_EXPORT", 2) + ->finalizeToPool(); + + $pool->finish(); + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php new file mode 100644 index 0000000..8d1566c --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xF0\x01\x0A\$google/protobuf/source_context.proto\x12\x0Fgoogle.protobuf\"\"\x0A\x0DSourceContext\x12\x11\x0A\x09file_name\x18\x01 \x01(\x09B\x8A\x01\x0A\x13com.google.protobufB\x12SourceContextProtoP\x01Z6google.golang.org/protobuf/types/known/sourcecontextpb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php new file mode 100644 index 0000000..6fad5d9 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xFE\x04\x0A\x1Cgoogle/protobuf/struct.proto\x12\x0Fgoogle.protobuf\"\x84\x01\x0A\x06Struct\x123\x0A\x06fields\x18\x01 \x03(\x0B2#.google.protobuf.Struct.FieldsEntry\x1AE\x0A\x0BFieldsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12%\x0A\x05value\x18\x02 \x01(\x0B2\x16.google.protobuf.Value:\x028\x01\"\xEA\x01\x0A\x05Value\x120\x0A\x0Anull_value\x18\x01 \x01(\x0E2\x1A.google.protobuf.NullValueH\x00\x12\x16\x0A\x0Cnumber_value\x18\x02 \x01(\x01H\x00\x12\x16\x0A\x0Cstring_value\x18\x03 \x01(\x09H\x00\x12\x14\x0A\x0Abool_value\x18\x04 \x01(\x08H\x00\x12/\x0A\x0Cstruct_value\x18\x05 \x01(\x0B2\x17.google.protobuf.StructH\x00\x120\x0A\x0Alist_value\x18\x06 \x01(\x0B2\x1A.google.protobuf.ListValueH\x00B\x06\x0A\x04kind\"3\x0A\x09ListValue\x12&\x0A\x06values\x18\x01 \x03(\x0B2\x16.google.protobuf.Value*\x1B\x0A\x09NullValue\x12\x0E\x0A\x0ANULL_VALUE\x10\x00B\x7F\x0A\x13com.google.protobufB\x0BStructProtoP\x01Z/google.golang.org/protobuf/types/known/structpb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php new file mode 100644 index 0000000..fd4eaac --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xEF\x01\x0A\x1Fgoogle/protobuf/timestamp.proto\x12\x0Fgoogle.protobuf\"+\x0A\x09Timestamp\x12\x0F\x0A\x07seconds\x18\x01 \x01(\x03\x12\x0D\x0A\x05nanos\x18\x02 \x01(\x05B\x85\x01\x0A\x13com.google.protobufB\x0ETimestampProtoP\x01Z2google.golang.org/protobuf/types/known/timestamppb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php new file mode 100644 index 0000000..6bec20d --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\xD4\x0C\x0A\x1Agoogle/protobuf/type.proto\x12\x0Fgoogle.protobuf\x1A\$google/protobuf/source_context.proto\"\xE8\x01\x0A\x04Type\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12&\x0A\x06fields\x18\x02 \x03(\x0B2\x16.google.protobuf.Field\x12\x0E\x0A\x06oneofs\x18\x03 \x03(\x09\x12(\x0A\x07options\x18\x04 \x03(\x0B2\x17.google.protobuf.Option\x126\x0A\x0Esource_context\x18\x05 \x01(\x0B2\x1E.google.protobuf.SourceContext\x12'\x0A\x06syntax\x18\x06 \x01(\x0E2\x17.google.protobuf.Syntax\x12\x0F\x0A\x07edition\x18\x07 \x01(\x09\"\xD5\x05\x0A\x05Field\x12)\x0A\x04kind\x18\x01 \x01(\x0E2\x1B.google.protobuf.Field.Kind\x127\x0A\x0Bcardinality\x18\x02 \x01(\x0E2\".google.protobuf.Field.Cardinality\x12\x0E\x0A\x06number\x18\x03 \x01(\x05\x12\x0C\x0A\x04name\x18\x04 \x01(\x09\x12\x10\x0A\x08type_url\x18\x06 \x01(\x09\x12\x13\x0A\x0Boneof_index\x18\x07 \x01(\x05\x12\x0E\x0A\x06packed\x18\x08 \x01(\x08\x12(\x0A\x07options\x18\x09 \x03(\x0B2\x17.google.protobuf.Option\x12\x11\x0A\x09json_name\x18\x0A \x01(\x09\x12\x15\x0A\x0Ddefault_value\x18\x0B \x01(\x09\"\xC8\x02\x0A\x04Kind\x12\x10\x0A\x0CTYPE_UNKNOWN\x10\x00\x12\x0F\x0A\x0BTYPE_DOUBLE\x10\x01\x12\x0E\x0A\x0ATYPE_FLOAT\x10\x02\x12\x0E\x0A\x0ATYPE_INT64\x10\x03\x12\x0F\x0A\x0BTYPE_UINT64\x10\x04\x12\x0E\x0A\x0ATYPE_INT32\x10\x05\x12\x10\x0A\x0CTYPE_FIXED64\x10\x06\x12\x10\x0A\x0CTYPE_FIXED32\x10\x07\x12\x0D\x0A\x09TYPE_BOOL\x10\x08\x12\x0F\x0A\x0BTYPE_STRING\x10\x09\x12\x0E\x0A\x0ATYPE_GROUP\x10\x0A\x12\x10\x0A\x0CTYPE_MESSAGE\x10\x0B\x12\x0E\x0A\x0ATYPE_BYTES\x10\x0C\x12\x0F\x0A\x0BTYPE_UINT32\x10\x0D\x12\x0D\x0A\x09TYPE_ENUM\x10\x0E\x12\x11\x0A\x0DTYPE_SFIXED32\x10\x0F\x12\x11\x0A\x0DTYPE_SFIXED64\x10\x10\x12\x0F\x0A\x0BTYPE_SINT32\x10\x11\x12\x0F\x0A\x0BTYPE_SINT64\x10\x12\"t\x0A\x0BCardinality\x12\x17\x0A\x13CARDINALITY_UNKNOWN\x10\x00\x12\x18\x0A\x14CARDINALITY_OPTIONAL\x10\x01\x12\x18\x0A\x14CARDINALITY_REQUIRED\x10\x02\x12\x18\x0A\x14CARDINALITY_REPEATED\x10\x03\"\xDF\x01\x0A\x04Enum\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12-\x0A\x09enumvalue\x18\x02 \x03(\x0B2\x1A.google.protobuf.EnumValue\x12(\x0A\x07options\x18\x03 \x03(\x0B2\x17.google.protobuf.Option\x126\x0A\x0Esource_context\x18\x04 \x01(\x0B2\x1E.google.protobuf.SourceContext\x12'\x0A\x06syntax\x18\x05 \x01(\x0E2\x17.google.protobuf.Syntax\x12\x0F\x0A\x07edition\x18\x06 \x01(\x09\"S\x0A\x09EnumValue\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x0E\x0A\x06number\x18\x02 \x01(\x05\x12(\x0A\x07options\x18\x03 \x03(\x0B2\x17.google.protobuf.Option\";\x0A\x06Option\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12#\x0A\x05value\x18\x02 \x01(\x0B2\x14.google.protobuf.Any*C\x0A\x06Syntax\x12\x11\x0A\x0DSYNTAX_PROTO2\x10\x00\x12\x11\x0A\x0DSYNTAX_PROTO3\x10\x01\x12\x13\x0A\x0FSYNTAX_EDITIONS\x10\x02B{\x0A\x13com.google.protobufB\x09TypeProtoP\x01Z-google.golang.org/protobuf/types/known/typepb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php new file mode 100644 index 0000000..49f8425 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xC7\x03\x0A\x1Egoogle/protobuf/wrappers.proto\x12\x0Fgoogle.protobuf\"\x1C\x0A\x0BDoubleValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x01\"\x1B\x0A\x0AFloatValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x02\"\x1B\x0A\x0AInt64Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x03\"\x1C\x0A\x0BUInt64Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x04\"\x1B\x0A\x0AInt32Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x05\"\x1C\x0A\x0BUInt32Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x0D\"\x1A\x0A\x09BoolValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x08\"\x1C\x0A\x0BStringValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x09\"\x1B\x0A\x0ABytesValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x0CB\x83\x01\x0A\x13com.google.protobufB\x0DWrappersProtoP\x01Z1google.golang.org/protobuf/types/known/wrapperspb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Any.php b/vendor/google/protobuf/src/Google/Protobuf/Any.php new file mode 100644 index 0000000..3f81808 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Any.php @@ -0,0 +1,263 @@ +, + * "lastName": + * } + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `\@type` + * field. Example (for message [google.protobuf.Duration][]): + * { + * "\@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * Generated from protobuf message google.protobuf.Any + */ +class Any extends \Google\Protobuf\Internal\AnyBase +{ + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + */ + protected $type_url = ''; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type_url + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * @type string $value + * Must be a valid serialized protocol buffer of the above specified type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Any::initOnce(); + parent::__construct($data); + } + + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + * @return string + */ + public function getTypeUrl() + { + return $this->type_url; + } + + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + * @param string $var + * @return $this + */ + public function setTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->type_url = $var; + + return $this; + } + + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Api.php b/vendor/google/protobuf/src/Google/Protobuf/Api.php new file mode 100644 index 0000000..a44c858 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Api.php @@ -0,0 +1,399 @@ +google.protobuf.Api + */ +class Api extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + */ + private $methods; + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + */ + protected $version = ''; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + protected $source_context = null; + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + */ + private $mixins; + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + */ + protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 8; + */ + protected $edition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * @type \Google\Protobuf\Method[] $methods + * The methods of this interface, in unspecified order. + * @type \Google\Protobuf\Option[] $options + * Any metadata attached to the interface. + * @type string $version + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * @type \Google\Protobuf\SourceContext $source_context + * Source context for the protocol buffer service represented by this + * message. + * @type \Google\Protobuf\Mixin[] $mixins + * Included interfaces. See [Mixin][]. + * @type int $syntax + * The source syntax of the service. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @return RepeatedField<\Google\Protobuf\Method> + */ + public function getMethods() + { + return $this->methods; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @param \Google\Protobuf\Method[] $var + * @return $this + */ + public function setMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Method::class); + $this->methods = $arr; + + return $this; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @return RepeatedField<\Google\Protobuf\Mixin> + */ + public function getMixins() + { + return $this->mixins; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @param \Google\Protobuf\Mixin[] $var + * @return $this + */ + public function setMixins($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Mixin::class); + $this->mixins = $arr; + + return $this; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 8; + * @return string + */ + public function getEdition() + { + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 8; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php new file mode 100644 index 0000000..c575d7a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php @@ -0,0 +1,71 @@ +google.protobuf.BoolValue + */ +class BoolValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + */ + protected $value = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $value + * The bool value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @return bool + */ + public function getValue() + { + return $this->value; + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @param bool $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkBool($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php new file mode 100644 index 0000000..c840b46 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php @@ -0,0 +1,71 @@ +google.protobuf.BytesValue + */ +class BytesValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The bytes value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php new file mode 100644 index 0000000..760d917 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php @@ -0,0 +1,85 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Full protobuf message name + */ + public function getFullName() + { + return trim($this->internal_desc->getFullName(), "."); + } + + /** + * @return string PHP class name + */ + public function getClass() + { + return $this->internal_desc->getClass(); + } + + /** + * @param int $index Must be >= 0 and < getFieldCount() + * @return FieldDescriptor + */ + public function getField($index) + { + return $this->getPublicDescriptor($this->internal_desc->getFieldByIndex($index)); + } + + /** + * @return int Number of fields in message + */ + public function getFieldCount() + { + return count($this->internal_desc->getField()); + } + + /** + * @param int $index Must be >= 0 and < getOneofDeclCount() + * @return OneofDescriptor + */ + public function getOneofDecl($index) + { + return $this->getPublicDescriptor($this->internal_desc->getOneofDecl()[$index]); + } + + /** + * @return int Number of oneofs in message + */ + public function getOneofDeclCount() + { + return count($this->internal_desc->getOneofDecl()); + } + + /** + * @return int Number of real oneofs in message + */ + public function getRealOneofDeclCount() + { + return $this->internal_desc->getRealOneofDeclCount(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php new file mode 100644 index 0000000..6fa447b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php @@ -0,0 +1,53 @@ +internal_pool = $internal_pool; + } + + /** + * @param string $className A fully qualified protobuf class name + * @return Descriptor + */ + public function getDescriptorByClassName($className) + { + $desc = $this->internal_pool->getDescriptorByClassName($className); + return is_null($desc) ? null : $desc->getPublicDescriptor(); + } + + /** + * @param string $className A fully qualified protobuf class name + * @return EnumDescriptor + */ + public function getEnumDescriptorByClassName($className) + { + $desc = $this->internal_pool->getEnumDescriptorByClassName($className); + return is_null($desc) ? null : $desc->getPublicDescriptor(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php new file mode 100644 index 0000000..7619938 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php @@ -0,0 +1,71 @@ +google.protobuf.DoubleValue + */ +class DoubleValue extends \Google\Protobuf\Internal\Message +{ + /** + * The double value. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The double value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/Google/Protobuf/Duration.php new file mode 100644 index 0000000..62d7d87 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Duration.php @@ -0,0 +1,174 @@ + 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * Example 3: Compute Duration from datetime.timedelta in Python. + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * # JSON Mapping + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * Generated from protobuf message google.protobuf.Duration + */ +class Duration extends \Google\Protobuf\Internal\Message +{ + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + */ + protected $seconds = 0; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * @type int $nanos + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Duration::initOnce(); + parent::__construct($data); + } + + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + * @return int|string + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Enum.php b/vendor/google/protobuf/src/Google/Protobuf/Enum.php new file mode 100644 index 0000000..ea3be40 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Enum.php @@ -0,0 +1,252 @@ +google.protobuf.Enum + */ +class Enum extends \Google\Protobuf\Internal\Message +{ + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + */ + private $enumvalue; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + */ + protected $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + */ + protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + */ + protected $edition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Enum type name. + * @type \Google\Protobuf\EnumValue[] $enumvalue + * Enum value definitions. + * @type \Google\Protobuf\Option[] $options + * Protocol buffer options. + * @type \Google\Protobuf\SourceContext $source_context + * The source context. + * @type int $syntax + * The source syntax. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @return RepeatedField<\Google\Protobuf\EnumValue> + */ + public function getEnumvalue() + { + return $this->enumvalue; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @param \Google\Protobuf\EnumValue[] $var + * @return $this + */ + public function setEnumvalue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class); + $this->enumvalue = $arr; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + * @return string + */ + public function getEdition() + { + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php new file mode 100644 index 0000000..39c145d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php @@ -0,0 +1,56 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Full protobuf message name + */ + public function getFullName() + { + return $this->internal_desc->getFullName(); + } + + /** + * @return string PHP class name + */ + public function getClass() + { + return $this->internal_desc->getClass(); + } + + /** + * @param int $index Must be >= 0 and < getValueCount() + * @return EnumValueDescriptor + */ + public function getValue($index) + { + return $this->internal_desc->getValueDescriptorByIndex($index); + } + + /** + * @return int Number of values in enum + */ + public function getValueCount() + { + return $this->internal_desc->getValueCount(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php new file mode 100644 index 0000000..f9dfece --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php @@ -0,0 +1,140 @@ +google.protobuf.EnumValue + */ +class EnumValue extends \Google\Protobuf\Internal\Message +{ + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + */ + protected $number = 0; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Enum value name. + * @type int $number + * Enum value number. + * @type \Google\Protobuf\Option[] $options + * Protocol buffer options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php new file mode 100644 index 0000000..a1ee10a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php @@ -0,0 +1,41 @@ +name = $name; + $this->number = $number; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return int + */ + public function getNumber() + { + return $this->number; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field.php b/vendor/google/protobuf/src/Google/Protobuf/Field.php new file mode 100644 index 0000000..7274530 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field.php @@ -0,0 +1,386 @@ +google.protobuf.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + */ + protected $kind = 0; + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + */ + protected $cardinality = 0; + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + */ + protected $number = 0; + /** + * The field name. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + */ + protected $type_url = ''; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + */ + protected $oneof_index = 0; + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + */ + protected $packed = false; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + */ + private $options; + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + */ + protected $json_name = ''; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + */ + protected $default_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $kind + * The field type. + * @type int $cardinality + * The field cardinality. + * @type int $number + * The field number. + * @type string $name + * The field name. + * @type string $type_url + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * @type int $oneof_index + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * @type bool $packed + * Whether to use alternative packed wire representation. + * @type \Google\Protobuf\Option[] $options + * The protocol buffer options. + * @type string $json_name + * The field JSON name. + * @type string $default_value + * The string value of the default value of this field. Proto2 syntax only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @return int + */ + public function getCardinality() + { + return $this->cardinality; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @param int $var + * @return $this + */ + public function setCardinality($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Cardinality::class); + $this->cardinality = $var; + + return $this; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @return string + */ + public function getTypeUrl() + { + return $this->type_url; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @param string $var + * @return $this + */ + public function setTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->type_url = $var; + + return $this; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @return int + */ + public function getOneofIndex() + { + return $this->oneof_index; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @param int $var + * @return $this + */ + public function setOneofIndex($var) + { + GPBUtil::checkInt32($var); + $this->oneof_index = $var; + + return $this; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @return bool + */ + public function getPacked() + { + return $this->packed; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @param bool $var + * @return $this + */ + public function setPacked($var) + { + GPBUtil::checkBool($var); + $this->packed = $var; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @return string + */ + public function getJsonName() + { + return $this->json_name; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @param string $var + * @return $this + */ + public function setJsonName($var) + { + GPBUtil::checkString($var, True); + $this->json_name = $var; + + return $this; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php new file mode 100644 index 0000000..72a11e3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php @@ -0,0 +1,69 @@ +google.protobuf.Field.Cardinality + */ +class Cardinality +{ + /** + * For fields with unknown cardinality. + * + * Generated from protobuf enum CARDINALITY_UNKNOWN = 0; + */ + const CARDINALITY_UNKNOWN = 0; + /** + * For optional fields. + * + * Generated from protobuf enum CARDINALITY_OPTIONAL = 1; + */ + const CARDINALITY_OPTIONAL = 1; + /** + * For required fields. Proto2 syntax only. + * + * Generated from protobuf enum CARDINALITY_REQUIRED = 2; + */ + const CARDINALITY_REQUIRED = 2; + /** + * For repeated fields. + * + * Generated from protobuf enum CARDINALITY_REPEATED = 3; + */ + const CARDINALITY_REPEATED = 3; + + private static $valueToName = [ + self::CARDINALITY_UNKNOWN => 'CARDINALITY_UNKNOWN', + self::CARDINALITY_OPTIONAL => 'CARDINALITY_OPTIONAL', + self::CARDINALITY_REQUIRED => 'CARDINALITY_REQUIRED', + self::CARDINALITY_REPEATED => 'CARDINALITY_REPEATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php new file mode 100644 index 0000000..bcbfcdd --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php @@ -0,0 +1,174 @@ +google.protobuf.Field.Kind + */ +class Kind +{ + /** + * Field type unknown. + * + * Generated from protobuf enum TYPE_UNKNOWN = 0; + */ + const TYPE_UNKNOWN = 0; + /** + * Field type double. + * + * Generated from protobuf enum TYPE_DOUBLE = 1; + */ + const TYPE_DOUBLE = 1; + /** + * Field type float. + * + * Generated from protobuf enum TYPE_FLOAT = 2; + */ + const TYPE_FLOAT = 2; + /** + * Field type int64. + * + * Generated from protobuf enum TYPE_INT64 = 3; + */ + const TYPE_INT64 = 3; + /** + * Field type uint64. + * + * Generated from protobuf enum TYPE_UINT64 = 4; + */ + const TYPE_UINT64 = 4; + /** + * Field type int32. + * + * Generated from protobuf enum TYPE_INT32 = 5; + */ + const TYPE_INT32 = 5; + /** + * Field type fixed64. + * + * Generated from protobuf enum TYPE_FIXED64 = 6; + */ + const TYPE_FIXED64 = 6; + /** + * Field type fixed32. + * + * Generated from protobuf enum TYPE_FIXED32 = 7; + */ + const TYPE_FIXED32 = 7; + /** + * Field type bool. + * + * Generated from protobuf enum TYPE_BOOL = 8; + */ + const TYPE_BOOL = 8; + /** + * Field type string. + * + * Generated from protobuf enum TYPE_STRING = 9; + */ + const TYPE_STRING = 9; + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * Generated from protobuf enum TYPE_GROUP = 10; + */ + const TYPE_GROUP = 10; + /** + * Field type message. + * + * Generated from protobuf enum TYPE_MESSAGE = 11; + */ + const TYPE_MESSAGE = 11; + /** + * Field type bytes. + * + * Generated from protobuf enum TYPE_BYTES = 12; + */ + const TYPE_BYTES = 12; + /** + * Field type uint32. + * + * Generated from protobuf enum TYPE_UINT32 = 13; + */ + const TYPE_UINT32 = 13; + /** + * Field type enum. + * + * Generated from protobuf enum TYPE_ENUM = 14; + */ + const TYPE_ENUM = 14; + /** + * Field type sfixed32. + * + * Generated from protobuf enum TYPE_SFIXED32 = 15; + */ + const TYPE_SFIXED32 = 15; + /** + * Field type sfixed64. + * + * Generated from protobuf enum TYPE_SFIXED64 = 16; + */ + const TYPE_SFIXED64 = 16; + /** + * Field type sint32. + * + * Generated from protobuf enum TYPE_SINT32 = 17; + */ + const TYPE_SINT32 = 17; + /** + * Field type sint64. + * + * Generated from protobuf enum TYPE_SINT64 = 18; + */ + const TYPE_SINT64 = 18; + + private static $valueToName = [ + self::TYPE_UNKNOWN => 'TYPE_UNKNOWN', + self::TYPE_DOUBLE => 'TYPE_DOUBLE', + self::TYPE_FLOAT => 'TYPE_FLOAT', + self::TYPE_INT64 => 'TYPE_INT64', + self::TYPE_UINT64 => 'TYPE_UINT64', + self::TYPE_INT32 => 'TYPE_INT32', + self::TYPE_FIXED64 => 'TYPE_FIXED64', + self::TYPE_FIXED32 => 'TYPE_FIXED32', + self::TYPE_BOOL => 'TYPE_BOOL', + self::TYPE_STRING => 'TYPE_STRING', + self::TYPE_GROUP => 'TYPE_GROUP', + self::TYPE_MESSAGE => 'TYPE_MESSAGE', + self::TYPE_BYTES => 'TYPE_BYTES', + self::TYPE_UINT32 => 'TYPE_UINT32', + self::TYPE_ENUM => 'TYPE_ENUM', + self::TYPE_SFIXED32 => 'TYPE_SFIXED32', + self::TYPE_SFIXED64 => 'TYPE_SFIXED64', + self::TYPE_SINT32 => 'TYPE_SINT32', + self::TYPE_SINT64 => 'TYPE_SINT64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php new file mode 100644 index 0000000..9318ec1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php @@ -0,0 +1,139 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Field name + */ + public function getName() + { + return $this->internal_desc->getName(); + } + + /** + * @return int Protobuf field number + */ + public function getNumber() + { + return $this->internal_desc->getNumber(); + } + + /** + * @deprecated Use isRepeated() or isRequired() instead. + * + * @return int + */ + public function getLabel() + { + return $this->internal_desc->getLabel(); + } + + /** + * @return boolean + */ + public function isRequired() + { + return $this->internal_desc->isRequired(); + } + + /** + * @return boolean + */ + public function isRepeated() + { + return $this->internal_desc->isRepeated(); + } + + /** + * @return int + */ + public function getType() + { + return $this->internal_desc->getType(); + } + + /** + * @return OneofDescriptor + */ + public function getContainingOneof() + { + return $this->getPublicDescriptor($this->internal_desc->getContainingOneof()); + } + + /** + * Gets the field's containing oneof, only if non-synthetic. + * + * @return null|OneofDescriptor + */ + public function getRealContainingOneof() + { + return $this->getPublicDescriptor($this->internal_desc->getRealContainingOneof()); + } + + /** + * @return boolean + */ + public function hasOptionalKeyword() + { + return $this->internal_desc->hasOptionalKeyword(); + } + + /** + * @return Descriptor Returns a descriptor for the field type if the field type is a message, otherwise throws \Exception + * @throws \Exception + */ + public function getMessageType() + { + if ($this->getType() == GPBType::MESSAGE) { + return $this->getPublicDescriptor($this->internal_desc->getMessageType()); + } else { + throw new \Exception("Cannot get message type for non-message field '" . $this->getName() . "'"); + } + } + + /** + * @return EnumDescriptor Returns an enum descriptor if the field type is an enum, otherwise throws \Exception + * @throws \Exception + */ + public function getEnumType() + { + if ($this->getType() == GPBType::ENUM) { + return $this->getPublicDescriptor($this->internal_desc->getEnumType()); + } else { + throw new \Exception("Cannot get enum type for non-enum field '" . $this->getName() . "'"); + } + } + + /** + * @return boolean + */ + public function isMap() + { + return $this->internal_desc->isMap(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php new file mode 100644 index 0000000..f0b734e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php @@ -0,0 +1,218 @@ +google.protobuf.FieldMask + */ +class FieldMask extends \Google\Protobuf\Internal\Message +{ + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + */ + private $paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $paths + * The set of field mask paths. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); + parent::__construct($data); + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @return RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @param string[] $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php new file mode 100644 index 0000000..dff8f89 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php @@ -0,0 +1,16 @@ +google.protobuf.FloatValue + */ +class FloatValue extends \Google\Protobuf\Internal\Message +{ + /** + * The float value. + * + * Generated from protobuf field float value = 1; + */ + protected $value = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The float value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkFloat($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php new file mode 100644 index 0000000..e3a3e01 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php @@ -0,0 +1,39 @@ +google.protobuf.Empty + */ +class GPBEmpty extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); + parent::__construct($data); + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php new file mode 100644 index 0000000..5c20611 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php @@ -0,0 +1,71 @@ +google.protobuf.Int32Value + */ +class Int32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $value + * The int32 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php new file mode 100644 index 0000000..ec24644 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php @@ -0,0 +1,71 @@ +google.protobuf.Int64Value + */ +class Int64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The int64 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php new file mode 100644 index 0000000..7ae4ce6 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php @@ -0,0 +1,86 @@ +type_url, 0, $url_prifix_len) != + GPBUtil::TYPE_URL_PREFIX) { + throw new \Exception( + "Type url needs to be type.googleapis.com/fully-qulified"); + } + $fully_qualified_name = + substr($this->type_url, $url_prifix_len); + + // Create message according to fully qualified name. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByProtoName($fully_qualified_name); + if (is_null($desc)) { + throw new \Exception("Class ".$fully_qualified_name + ." hasn't been added to descriptor pool"); + } + $klass = $desc->getClass(); + $msg = new $klass(); + + // Merge data into message. + $msg->mergeFromString($this->value); + return $msg; + } + + /** + * The type_url will be created according to the given message’s type and + * the value is encoded data from the given message.. + * @param Message $msg A proto message. + */ + public function pack($msg) + { + if (!$msg instanceof Message) { + trigger_error("Given parameter is not a message instance.", + E_USER_ERROR); + return; + } + + // Set value using serialized message. + $this->value = $msg->serializeToString(); + + // Set type url. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName(get_class($msg)); + $fully_qualified_name = $desc->getFullName(); + $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualified_name; + } + + /** + * This method returns whether the type_url in any_message is corresponded + * to the given class. + * @param string $klass The fully qualified PHP class name of a proto message type. + */ + public function is($klass) + { + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + $fully_qualified_name = $desc->getFullName(); + $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualified_name; + return $this->type_url === $type_url; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php new file mode 100644 index 0000000..cfb3c4d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php @@ -0,0 +1,358 @@ +buffer = $buffer; + $this->buffer_size_after_limit = 0; + $this->buffer_end = $end; + $this->current = $start; + $this->current_limit = $end; + $this->legitimate_message_end = false; + $this->recursion_budget = self::DEFAULT_RECURSION_LIMIT; + $this->recursion_limit = self::DEFAULT_RECURSION_LIMIT; + $this->total_bytes_limit = self::DEFAULT_TOTAL_BYTES_LIMIT; + $this->total_bytes_read = $end - $start; + } + + private function advance($amount) + { + $this->current += $amount; + } + + public function bufferSize() + { + return $this->buffer_end - $this->current; + } + + public function current() + { + return $this->total_bytes_read - + ($this->buffer_end - $this->current + + $this->buffer_size_after_limit); + } + + public function substr($start, $end) + { + return substr($this->buffer, $start, $end - $start); + } + + private function recomputeBufferLimits() + { + $this->buffer_end += $this->buffer_size_after_limit; + $closest_limit = min($this->current_limit, $this->total_bytes_limit); + if ($closest_limit < $this->total_bytes_read) { + // The limit position is in the current buffer. We must adjust the + // buffer size accordingly. + $this->buffer_size_after_limit = $this->total_bytes_read - + $closest_limit; + $this->buffer_end -= $this->buffer_size_after_limit; + } else { + $this->buffer_size_after_limit = 0; + } + } + + private function consumedEntireMessage() + { + return $this->legitimate_message_end; + } + + /** + * Read uint32 into $var. Advance buffer with consumed bytes. If the + * contained varint is larger than 32 bits, discard the high order bits. + * @param $var + */ + public function readVarint32(&$var) + { + if (!$this->readVarint64($var)) { + return false; + } + + if (PHP_INT_SIZE == 4) { + $var = bcmod($var, 4294967296); + } else { + $var &= 0xFFFFFFFF; + } + + // Convert large uint32 to int32. + if ($var > 0x7FFFFFFF) { + if (PHP_INT_SIZE === 8) { + $var = $var | (0xFFFFFFFF << 32); + } else { + $var = bcsub($var, 4294967296); + } + } + + $var = intval($var); + return true; + } + + /** + * Read Uint64 into $var. Advance buffer with consumed bytes. + * @param $var + */ + public function readVarint64(&$var) + { + $count = 0; + + if (PHP_INT_SIZE == 4) { + $high = 0; + $low = 0; + $b = 0; + + do { + if ($this->current === $this->buffer_end) { + return false; + } + if ($count === self::MAX_VARINT_BYTES) { + return false; + } + $b = ord($this->buffer[$this->current]); + $bits = 7 * $count; + if ($bits >= 32) { + $high |= (($b & 0x7F) << ($bits - 32)); + } else if ($bits > 25){ + // $bits is 28 in this case. + $low |= (($b & 0x7F) << 28); + $high = ($b & 0x7F) >> 4; + } else { + $low |= (($b & 0x7F) << $bits); + } + + $this->advance(1); + $count += 1; + } while ($b & 0x80); + + $var = GPBUtil::combineInt32ToInt64($high, $low); + if (bccomp($var, 0) < 0) { + $var = bcadd($var, "18446744073709551616"); + } + } else { + $result = 0; + $shift = 0; + + do { + if ($this->current === $this->buffer_end) { + return false; + } + if ($count === self::MAX_VARINT_BYTES) { + return false; + } + + $byte = ord($this->buffer[$this->current]); + $result |= ($byte & 0x7f) << $shift; + $shift += 7; + $this->advance(1); + $count += 1; + } while ($byte > 0x7f); + + $var = $result; + } + + return true; + } + + /** + * Read int into $var. If the result is larger than the largest integer, $var + * will be -1. Advance buffer with consumed bytes. + * @param $var + */ + public function readVarintSizeAsInt(&$var) + { + if (!$this->readVarint64($var)) { + return false; + } + $var = (int)$var; + return true; + } + + /** + * Read 32-bit unsigned integer to $var. If the buffer has less than 4 bytes, + * return false. Advance buffer with consumed bytes. + * @param $var + */ + public function readLittleEndian32(&$var) + { + $data = null; + if (!$this->readRaw(4, $data)) { + return false; + } + $var = unpack('V', $data); + $var = $var[1]; + return true; + } + + /** + * Read 64-bit unsigned integer to $var. If the buffer has less than 8 bytes, + * return false. Advance buffer with consumed bytes. + * @param $var + */ + public function readLittleEndian64(&$var) + { + $data = null; + if (!$this->readRaw(4, $data)) { + return false; + } + $low = unpack('V', $data)[1]; + if (!$this->readRaw(4, $data)) { + return false; + } + $high = unpack('V', $data)[1]; + if (PHP_INT_SIZE == 4) { + $var = GPBUtil::combineInt32ToInt64($high, $low); + } else { + $var = ($high << 32) | $low; + } + return true; + } + + /** + * Read tag into $var. Advance buffer with consumed bytes. + */ + public function readTag() + { + if ($this->current === $this->buffer_end) { + // Make sure that it failed due to EOF, not because we hit + // total_bytes_limit, which, unlike normal limits, is not a valid + // place to end a message. + $current_position = $this->total_bytes_read - + $this->buffer_size_after_limit; + if ($current_position >= $this->total_bytes_limit) { + // Hit total_bytes_limit_. But if we also hit the normal limit, + // we're still OK. + $this->legitimate_message_end = + ($this->current_limit === $this->total_bytes_limit); + } else { + $this->legitimate_message_end = true; + } + return 0; + } + + $result = 0; + // The largest tag is 2^29 - 1, which can be represented by int32. + $success = $this->readVarint32($result); + if ($success) { + return $result; + } else { + return 0; + } + } + + public function readRaw($size, &$buffer) + { + $current_buffer_size = 0; + if ($this->bufferSize() < $size) { + return false; + } + + if ($size === 0) { + $buffer = ""; + } else { + $buffer = substr($this->buffer, $this->current, $size); + $this->advance($size); + } + + return true; + } + + /* Places a limit on the number of bytes that the stream may read, starting + * from the current position. Once the stream hits this limit, it will act + * like the end of the input has been reached until popLimit() is called. + * + * As the names imply, the stream conceptually has a stack of limits. The + * shortest limit on the stack is always enforced, even if it is not the top + * limit. + * + * The value returned by pushLimit() is opaque to the caller, and must be + * passed unchanged to the corresponding call to popLimit(). + * + * @param integer $byte_limit + * @throws \Exception Fail to push limit. + */ + public function pushLimit($byte_limit) + { + // Current position relative to the beginning of the stream. + $current_position = $this->current(); + $old_limit = $this->current_limit; + + // security: byte_limit is possibly evil, so check for negative values + // and overflow. + if ($byte_limit >= 0 && + $byte_limit <= PHP_INT_MAX - $current_position && + $byte_limit <= $this->current_limit - $current_position) { + $this->current_limit = $current_position + $byte_limit; + $this->recomputeBufferLimits(); + } else { + throw new GPBDecodeException("Fail to push limit."); + } + + return $old_limit; + } + + /* The limit passed in is actually the *old* limit, which we returned from + * PushLimit(). + * + * @param integer $byte_limit + */ + public function popLimit($byte_limit) + { + $this->current_limit = $byte_limit; + $this->recomputeBufferLimits(); + // We may no longer be at a legitimate message end. ReadTag() needs to + // be called again to find out. + $this->legitimate_message_end = false; + } + + public function incrementRecursionDepthAndPushLimit( + $byte_limit, &$old_limit, &$recursion_budget) + { + $old_limit = $this->pushLimit($byte_limit); + $recursion_limit = --$this->recursion_limit; + } + + public function decrementRecursionDepthAndPopLimit($byte_limit) + { + $result = $this->consumedEntireMessage(); + $this->popLimit($byte_limit); + ++$this->recursion_budget; + return $result; + } + + public function bytesUntilLimit() + { + if ($this->current_limit === PHP_INT_MAX) { + return -1; + } + return $this->current_limit - $this->current; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php new file mode 100644 index 0000000..46064fb --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php @@ -0,0 +1,143 @@ +current = 0; + $this->buffer_size = $size; + $this->buffer = str_repeat(chr(0), $this->buffer_size); + $this->options = $options; + } + + public function getData() + { + return $this->buffer; + } + + public function getOptions() + { + return $this->options; + } + + public function writeVarint32($value, $trim) + { + $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES); + $size = self::writeVarintToArray($value, $bytes, $trim); + return $this->writeRaw($bytes, $size); + } + + public function writeVarint64($value) + { + $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES); + $size = self::writeVarintToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeLittleEndian32($value) + { + $bytes = str_repeat(chr(0), 4); + $size = self::writeLittleEndian32ToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeLittleEndian64($value) + { + $bytes = str_repeat(chr(0), 8); + $size = self::writeLittleEndian64ToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeTag($tag) + { + return $this->writeVarint32($tag, true); + } + + public function writeRaw($data, $size) + { + if ($this->buffer_size < $size) { + trigger_error("Output stream doesn't have enough buffer."); + return false; + } + + for ($i = 0; $i < $size; $i++) { + $this->buffer[$this->current] = $data[$i]; + $this->current++; + $this->buffer_size--; + } + return true; + } + + public static function writeVarintToArray($value, &$buffer, $trim = false) + { + $current = 0; + + $high = 0; + $low = 0; + if (PHP_INT_SIZE == 4) { + GPBUtil::divideInt64ToInt32($value, $high, $low, $trim); + } else { + $low = $value; + } + + while (($low >= 0x80 || $low < 0) || $high != 0) { + $buffer[$current] = chr($low | 0x80); + $value = ($value >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)); + $carry = ($high & 0x7F) << ((PHP_INT_SIZE << 3) - 7); + $high = ($high >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)); + $low = (($low >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)) | $carry); + $current++; + } + $buffer[$current] = chr($low); + return $current + 1; + } + + private static function writeLittleEndian32ToArray($value, &$buffer) + { + $buffer[0] = chr($value & 0x000000FF); + $buffer[1] = chr(($value >> 8) & 0x000000FF); + $buffer[2] = chr(($value >> 16) & 0x000000FF); + $buffer[3] = chr(($value >> 24) & 0x000000FF); + return 4; + } + + private static function writeLittleEndian64ToArray($value, &$buffer) + { + $high = 0; + $low = 0; + if (PHP_INT_SIZE == 4) { + GPBUtil::divideInt64ToInt32($value, $high, $low); + } else { + $low = $value & 0xFFFFFFFF; + $high = ($value >> 32) & 0xFFFFFFFF; + } + + $buffer[0] = chr($low & 0x000000FF); + $buffer[1] = chr(($low >> 8) & 0x000000FF); + $buffer[2] = chr(($low >> 16) & 0x000000FF); + $buffer[3] = chr(($low >> 24) & 0x000000FF); + $buffer[4] = chr($high & 0x000000FF); + $buffer[5] = chr(($high >> 8) & 0x000000FF); + $buffer[6] = chr(($high >> 16) & 0x000000FF); + $buffer[7] = chr(($high >> 24) & 0x000000FF); + return 8; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php new file mode 100644 index 0000000..7eef196 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php @@ -0,0 +1,213 @@ +public_desc = new \Google\Protobuf\Descriptor($this); + } + + public function addOneofDecl($oneof) + { + $this->oneof_decl[] = $oneof; + } + + public function getOneofDecl() + { + return $this->oneof_decl; + } + + public function setFullName($full_name) + { + $this->full_name = $full_name; + } + + public function getFullName() + { + return $this->full_name; + } + + public function addField($field) + { + $this->field[$field->getNumber()] = $field; + $this->json_to_field[$field->getJsonName()] = $field; + $this->name_to_field[$field->getName()] = $field; + $this->index_to_field[] = $field; + } + + public function getField() + { + return $this->field; + } + + public function addNestedType($desc) + { + $this->nested_type[] = $desc; + } + + public function getNestedType() + { + return $this->nested_type; + } + + public function addEnumType($desc) + { + $this->enum_type[] = $desc; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function getFieldByNumber($number) + { + if (!isset($this->field[$number])) { + return NULL; + } else { + return $this->field[$number]; + } + } + + public function getFieldByJsonName($json_name) + { + if (!isset($this->json_to_field[$json_name])) { + return NULL; + } else { + return $this->json_to_field[$json_name]; + } + } + + public function getFieldByName($name) + { + if (!isset($this->name_to_field[$name])) { + return NULL; + } else { + return $this->name_to_field[$name]; + } + } + + public function getFieldByIndex($index) + { + if (count($this->index_to_field) <= $index) { + return NULL; + } else { + return $this->index_to_field[$index]; + } + } + + public function setClass($klass) + { + $this->klass = $klass; + } + + public function getClass() + { + return $this->klass; + } + + public function setLegacyClass($klass) + { + $this->legacy_klass = $klass; + } + + public function getLegacyClass() + { + return $this->legacy_klass; + } + + public function setPreviouslyUnreservedClass($klass) + { + $this->previous_klass = $klass; + } + + public function getPreviouslyUnreservedClass() + { + return $this->previous_klass; + } + + public function setOptions($options) + { + $this->options = $options; + } + + public function getOptions() + { + return $this->options; + } + + public static function buildFromProto($proto, $file_proto, $containing) + { + $desc = new Descriptor(); + + $message_name_without_package = ""; + $classname = ""; + $legacy_classname = ""; + $previous_classname = ""; + $fullname = ""; + GPBUtil::getFullClassName( + $proto, + $containing, + $file_proto, + $message_name_without_package, + $classname, + $legacy_classname, + $fullname, + $previous_classname); + $desc->setFullName($fullname); + $desc->setClass($classname); + $desc->setLegacyClass($legacy_classname); + $desc->setPreviouslyUnreservedClass($previous_classname); + $desc->setOptions($proto->getOptions()); + + foreach ($proto->getField() as $field_proto) { + $desc->addField(FieldDescriptor::buildFromProto($field_proto)); + } + + // Handle nested types. + foreach ($proto->getNestedType() as $nested_proto) { + $desc->addNestedType(Descriptor::buildFromProto( + $nested_proto, $file_proto, $message_name_without_package)); + } + + // Handle nested enum. + foreach ($proto->getEnumType() as $enum_proto) { + $desc->addEnumType(EnumDescriptor::buildFromProto( + $enum_proto, $file_proto, $message_name_without_package)); + } + + // Handle oneof fields. + $index = 0; + foreach ($proto->getOneofDecl() as $oneof_proto) { + $desc->addOneofDecl( + OneofDescriptor::buildFromProto($oneof_proto, $desc, $index)); + $index++; + } + + return $desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php new file mode 100644 index 0000000..4f01180 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php @@ -0,0 +1,174 @@ +mergeFromString($data); + + foreach($files->getFile() as $file_proto) { + $file = FileDescriptor::buildFromProto($file_proto); + + foreach ($file->getMessageType() as $desc) { + $this->addDescriptor($desc); + } + unset($desc); + + foreach ($file->getEnumType() as $desc) { + $this->addEnumDescriptor($desc); + } + unset($desc); + + foreach ($file->getMessageType() as $desc) { + $this->crossLink($desc); + } + unset($desc); + } + } + + public function addMessage($name, $klass) + { + return new MessageBuilderContext($name, $klass, $this); + } + + public function addEnum($name, $klass) + { + return new EnumBuilderContext($name, $klass, $this); + } + + public function addDescriptor($descriptor) + { + $this->proto_to_class[$descriptor->getFullName()] = + $descriptor->getClass(); + $this->unique_descs[$descriptor->getFullName()] = + $descriptor; + $this->class_to_desc[$descriptor->getClass()] = $descriptor; + $this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor; + $this->class_to_desc[$descriptor->getPreviouslyUnreservedClass()] = $descriptor; + foreach ($descriptor->getNestedType() as $nested_type) { + $this->addDescriptor($nested_type); + } + foreach ($descriptor->getEnumType() as $enum_type) { + $this->addEnumDescriptor($enum_type); + } + } + + public function addEnumDescriptor($descriptor) + { + $this->proto_to_class[$descriptor->getFullName()] = + $descriptor->getClass(); + $this->class_to_enum_desc[$descriptor->getClass()] = $descriptor; + $this->class_to_enum_desc[$descriptor->getLegacyClass()] = $descriptor; + } + + public function getDescriptorByClassName($klass) + { + if (isset($this->class_to_desc[$klass])) { + return $this->class_to_desc[$klass]; + } else { + return null; + } + } + + public function getEnumDescriptorByClassName($klass) + { + if (isset($this->class_to_enum_desc[$klass])) { + return $this->class_to_enum_desc[$klass]; + } else { + return null; + } + } + + public function getDescriptorByProtoName($proto) + { + if (isset($this->proto_to_class[$proto])) { + $klass = $this->proto_to_class[$proto]; + return $this->class_to_desc[$klass]; + } else { + return null; + } + } + + public function getEnumDescriptorByProtoName($proto) + { + $klass = $this->proto_to_class[$proto]; + return $this->class_to_enum_desc[$klass]; + } + + private function crossLink(Descriptor $desc) + { + foreach ($desc->getField() as $field) { + switch ($field->getType()) { + case GPBType::MESSAGE: + $proto = $field->getMessageType(); + if ($proto[0] == '.') { + $proto = substr($proto, 1); + } + $subdesc = $this->getDescriptorByProtoName($proto); + if (is_null($subdesc)) { + trigger_error( + 'proto not added: ' . $proto + . " for " . $desc->getFullName(), E_USER_ERROR); + } + $field->setMessageType($subdesc); + break; + case GPBType::ENUM: + $proto = $field->getEnumType(); + if ($proto[0] == '.') { + $proto = substr($proto, 1); + } + $field->setEnumType( + $this->getEnumDescriptorByProtoName($proto)); + break; + default: + break; + } + } + unset($field); + + foreach ($desc->getNestedType() as $nested_type) { + $this->crossLink($nested_type); + } + unset($nested_type); + } + + public function finish() + { + foreach ($this->unique_descs as $klass => $desc) { + $this->crossLink($desc); + } + unset($desc); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php new file mode 100644 index 0000000..884100f --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php @@ -0,0 +1,381 @@ +google.protobuf.DescriptorProto + */ +class DescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + */ + private $field; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + */ + private $extension; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + */ + private $nested_type; + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + */ + private $enum_type; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + private $extension_range; + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + private $oneof_decl; + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + */ + protected $options = null; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + private $reserved_range; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + */ + private $reserved_name; + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + */ + protected $visibility = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $field + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $extension + * @type \Google\Protobuf\Internal\DescriptorProto[] $nested_type + * @type \Google\Protobuf\Internal\EnumDescriptorProto[] $enum_type + * @type \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[] $extension_range + * @type \Google\Protobuf\Internal\OneofDescriptorProto[] $oneof_decl + * @type \Google\Protobuf\Internal\MessageOptions $options + * @type \Google\Protobuf\Internal\DescriptorProto\ReservedRange[] $reserved_range + * @type string[] $reserved_name + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * @type int $visibility + * Support for `export` and `local` keywords on enums. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> + */ + public function getField() + { + return $this->field; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var + * @return $this + */ + public function setField($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->field = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> + */ + public function getExtension() + { + return $this->extension; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var + * @return $this + */ + public function setExtension($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->extension = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto> + */ + public function getNestedType() + { + return $this->nested_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + * @param \Google\Protobuf\Internal\DescriptorProto[] $var + * @return $this + */ + public function setNestedType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class); + $this->nested_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto> + */ + public function getEnumType() + { + return $this->enum_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + * @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var + * @return $this + */ + public function setEnumType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class); + $this->enum_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange> + */ + public function getExtensionRange() + { + return $this->extension_range; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + * @param \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[] $var + * @return $this + */ + public function setExtensionRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class); + $this->extension_range = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + * @return RepeatedField<\Google\Protobuf\Internal\OneofDescriptorProto> + */ + public function getOneofDecl() + { + return $this->oneof_decl; + } + + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + * @param \Google\Protobuf\Internal\OneofDescriptorProto[] $var + * @return $this + */ + public function setOneofDecl($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class); + $this->oneof_decl = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + * @return \Google\Protobuf\Internal\MessageOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + * @param \Google\Protobuf\Internal\MessageOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto\ReservedRange> + */ + public function getReservedRange() + { + return $this->reserved_range; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + * @param \Google\Protobuf\Internal\DescriptorProto\ReservedRange[] $var + * @return $this + */ + public function setReservedRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class); + $this->reserved_range = $arr; + + return $this; + } + + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + * @return RepeatedField + */ + public function getReservedName() + { + return $this->reserved_name; + } + + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + * @param string[] $var + * @return $this + */ + public function setReservedName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->reserved_name = $arr; + + return $this; + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + * @return int + */ + public function getVisibility() + { + return isset($this->visibility) ? $this->visibility : 0; + } + + public function hasVisibility() + { + return isset($this->visibility); + } + + public function clearVisibility() + { + unset($this->visibility); + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class); + $this->visibility = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php new file mode 100644 index 0000000..a2e142d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php @@ -0,0 +1,159 @@ +google.protobuf.DescriptorProto.ExtensionRange + */ +class ExtensionRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Exclusive. + * @type \Google\Protobuf\Internal\ExtensionRangeOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + * @return \Google\Protobuf\Internal\ExtensionRangeOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + * @param \Google\Protobuf\Internal\ExtensionRangeOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ExtensionRangeOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php new file mode 100644 index 0000000..61a1e7b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php @@ -0,0 +1,126 @@ +google.protobuf.DescriptorProto.ReservedRange + */ +class ReservedRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Exclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Edition.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Edition.php new file mode 100644 index 0000000..7493ee1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Edition.php @@ -0,0 +1,122 @@ +google.protobuf.Edition + */ +class Edition +{ + /** + * A placeholder for an unknown edition value. + * + * Generated from protobuf enum EDITION_UNKNOWN = 0; + */ + const EDITION_UNKNOWN = 0; + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * Generated from protobuf enum EDITION_LEGACY = 900; + */ + const EDITION_LEGACY = 900; + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * Generated from protobuf enum EDITION_PROTO2 = 998; + */ + const EDITION_PROTO2 = 998; + /** + * Generated from protobuf enum EDITION_PROTO3 = 999; + */ + const EDITION_PROTO3 = 999; + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * Generated from protobuf enum EDITION_2023 = 1000; + */ + const EDITION_2023 = 1000; + /** + * Generated from protobuf enum EDITION_2024 = 1001; + */ + const EDITION_2024 = 1001; + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * Generated from protobuf enum EDITION_1_TEST_ONLY = 1; + */ + const EDITION_1_TEST_ONLY = 1; + /** + * Generated from protobuf enum EDITION_2_TEST_ONLY = 2; + */ + const EDITION_2_TEST_ONLY = 2; + /** + * Generated from protobuf enum EDITION_99997_TEST_ONLY = 99997; + */ + const EDITION_99997_TEST_ONLY = 99997; + /** + * Generated from protobuf enum EDITION_99998_TEST_ONLY = 99998; + */ + const EDITION_99998_TEST_ONLY = 99998; + /** + * Generated from protobuf enum EDITION_99999_TEST_ONLY = 99999; + */ + const EDITION_99999_TEST_ONLY = 99999; + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * Generated from protobuf enum EDITION_MAX = 2147483647; + */ + const EDITION_MAX = 2147483647; + + private static $valueToName = [ + self::EDITION_UNKNOWN => 'EDITION_UNKNOWN', + self::EDITION_LEGACY => 'EDITION_LEGACY', + self::EDITION_PROTO2 => 'EDITION_PROTO2', + self::EDITION_PROTO3 => 'EDITION_PROTO3', + self::EDITION_2023 => 'EDITION_2023', + self::EDITION_2024 => 'EDITION_2024', + self::EDITION_1_TEST_ONLY => 'EDITION_1_TEST_ONLY', + self::EDITION_2_TEST_ONLY => 'EDITION_2_TEST_ONLY', + self::EDITION_99997_TEST_ONLY => 'EDITION_99997_TEST_ONLY', + self::EDITION_99998_TEST_ONLY => 'EDITION_99998_TEST_ONLY', + self::EDITION_99999_TEST_ONLY => 'EDITION_99999_TEST_ONLY', + self::EDITION_MAX => 'EDITION_MAX', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php new file mode 100644 index 0000000..5df99a5 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php @@ -0,0 +1,40 @@ +descriptor = new EnumDescriptor(); + $this->descriptor->setFullName($full_name); + $this->descriptor->setClass($klass); + $this->pool = $pool; + } + + public function value($name, $number) + { + $value = new EnumValueDescriptor($name, $number); + $this->descriptor->addValue($number, $value); + return $this; + } + + public function finalizeToPool() + { + $this->pool->addEnumDescriptor($this->descriptor); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php new file mode 100644 index 0000000..383f53b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php @@ -0,0 +1,116 @@ +public_desc = new \Google\Protobuf\EnumDescriptor($this); + } + + public function setFullName($full_name) + { + $this->full_name = $full_name; + } + + public function getFullName() + { + return $this->full_name; + } + + public function addValue($number, $value) + { + $this->value[$number] = $value; + $this->name_to_value[$value->getName()] = $value; + $this->value_descriptor[] = new EnumValueDescriptor($value->getName(), $number); + } + + public function getValueByNumber($number) + { + if (isset($this->value[$number])) { + return $this->value[$number]; + } + return null; + } + + public function getValueByName($name) + { + if (isset($this->name_to_value[$name])) { + return $this->name_to_value[$name]; + } + return null; + } + + public function getValueDescriptorByIndex($index) + { + if (isset($this->value_descriptor[$index])) { + return $this->value_descriptor[$index]; + } + return null; + } + + public function getValueCount() + { + return count($this->value); + } + + public function setClass($klass) + { + $this->klass = $klass; + } + + public function getClass() + { + return $this->klass; + } + + public function setLegacyClass($klass) + { + $this->legacy_klass = $klass; + } + + public function getLegacyClass() + { + return $this->legacy_klass; + } + + public static function buildFromProto($proto, $file_proto, $containing) + { + $desc = new EnumDescriptor(); + + $enum_name_without_package = ""; + $classname = ""; + $legacy_classname = ""; + $fullname = ""; + GPBUtil::getFullClassName( + $proto, + $containing, + $file_proto, + $enum_name_without_package, + $classname, + $legacy_classname, + $fullname, + $unused_previous_classname); + $desc->setFullName($fullname); + $desc->setClass($classname); + $desc->setLegacyClass($legacy_classname); + $values = $proto->getValue(); + foreach ($values as $value) { + $desc->addValue($value->getNumber(), $value); + } + + return $desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php new file mode 100644 index 0000000..43e6e45 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php @@ -0,0 +1,261 @@ +google.protobuf.EnumDescriptorProto + */ +class EnumDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + */ + private $value; + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + */ + protected $options = null; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + private $reserved_range; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + */ + private $reserved_name; + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + */ + protected $visibility = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type \Google\Protobuf\Internal\EnumValueDescriptorProto[] $value + * @type \Google\Protobuf\Internal\EnumOptions $options + * @type \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[] $reserved_range + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * @type string[] $reserved_name + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * @type int $visibility + * Support for `export` and `local` keywords on enums. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + * @return RepeatedField<\Google\Protobuf\Internal\EnumValueDescriptorProto> + */ + public function getValue() + { + return $this->value; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[] $var + * @return $this + */ + public function setValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class); + $this->value = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + * @return \Google\Protobuf\Internal\EnumOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + * @param \Google\Protobuf\Internal\EnumOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange> + */ + public function getReservedRange() + { + return $this->reserved_range; + } + + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + * @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[] $var + * @return $this + */ + public function setReservedRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class); + $this->reserved_range = $arr; + + return $this; + } + + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + * @return RepeatedField + */ + public function getReservedName() + { + return $this->reserved_name; + } + + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + * @param string[] $var + * @return $this + */ + public function setReservedName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->reserved_name = $arr; + + return $this; + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + * @return int + */ + public function getVisibility() + { + return isset($this->visibility) ? $this->visibility : 0; + } + + public function hasVisibility() + { + return isset($this->visibility); + } + + public function clearVisibility() + { + unset($this->visibility); + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class); + $this->visibility = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php new file mode 100644 index 0000000..b8234cf --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php @@ -0,0 +1,128 @@ +google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +class EnumReservedRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php new file mode 100644 index 0000000..f971465 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php @@ -0,0 +1,303 @@ +google.protobuf.EnumOptions + */ +class EnumOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + */ + protected $allow_alias = null; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + protected $deprecated_legacy_json_field_conflicts = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + */ + protected $features = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_alias + * Set this option to true to allow mapping different tag names to the same + * value. + * @type bool $deprecated + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * @type bool $deprecated_legacy_json_field_conflicts + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + * @return bool + */ + public function getAllowAlias() + { + return isset($this->allow_alias) ? $this->allow_alias : false; + } + + public function hasAllowAlias() + { + return isset($this->allow_alias); + } + + public function clearAllowAlias() + { + unset($this->allow_alias); + } + + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + * @param bool $var + * @return $this + */ + public function setAllowAlias($var) + { + GPBUtil::checkBool($var); + $this->allow_alias = $var; + + return $this; + } + + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getDeprecatedLegacyJsonFieldConflicts() + { + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } + return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; + } + + public function hasDeprecatedLegacyJsonFieldConflicts() + { + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } + return isset($this->deprecated_legacy_json_field_conflicts); + } + + public function clearDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + unset($this->deprecated_legacy_json_field_conflicts); + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setDeprecatedLegacyJsonFieldConflicts($var) + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->deprecated_legacy_json_field_conflicts = $var; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php new file mode 100644 index 0000000..fce650f --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php @@ -0,0 +1,147 @@ +google.protobuf.EnumValueDescriptorProto + */ +class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional int32 number = 2; + */ + protected $number = null; + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int $number + * @type \Google\Protobuf\Internal\EnumValueOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 number = 2; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * Generated from protobuf field optional int32 number = 2; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + * @return \Google\Protobuf\Internal\EnumValueOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + * @param \Google\Protobuf\Internal\EnumValueOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumValueOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php new file mode 100644 index 0000000..30cf2fa --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php @@ -0,0 +1,276 @@ +google.protobuf.EnumValueOptions + */ +class EnumValueOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + */ + protected $deprecated = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + */ + protected $features = null; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + */ + protected $debug_redact = null; + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + protected $feature_support = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deprecated + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type bool $debug_redact + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * @type \Google\Protobuf\Internal\FieldOptions\FeatureSupport $feature_support + * Information about the support window of a feature value. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + * @return bool + */ + public function getDebugRedact() + { + return isset($this->debug_redact) ? $this->debug_redact : false; + } + + public function hasDebugRedact() + { + return isset($this->debug_redact); + } + + public function clearDebugRedact() + { + unset($this->debug_redact); + } + + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDebugRedact($var) + { + GPBUtil::checkBool($var); + $this->debug_redact = $var; + + return $this; + } + + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + * @return \Google\Protobuf\Internal\FieldOptions\FeatureSupport|null + */ + public function getFeatureSupport() + { + return $this->feature_support; + } + + public function hasFeatureSupport() + { + return isset($this->feature_support); + } + + public function clearFeatureSupport() + { + unset($this->feature_support); + } + + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + * @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var + * @return $this + */ + public function setFeatureSupport($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class); + $this->feature_support = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php new file mode 100644 index 0000000..4d85c31 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php @@ -0,0 +1,206 @@ +google.protobuf.ExtensionRangeOptions + */ +class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + */ + private $declaration; + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + */ + protected $features = null; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + */ + protected $verification = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * @type \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration[] $declaration + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * @type int $verification + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + * @return RepeatedField<\Google\Protobuf\Internal\ExtensionRangeOptions\Declaration> + */ + public function getDeclaration() + { + return $this->declaration; + } + + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + * @param \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration[] $var + * @return $this + */ + public function setDeclaration($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration::class); + $this->declaration = $arr; + + return $this; + } + + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + * @return int + */ + public function getVerification() + { + return isset($this->verification) ? $this->verification : 0; + } + + public function hasVerification() + { + return isset($this->verification); + } + + public function clearVerification() + { + unset($this->verification); + } + + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + * @param int $var + * @return $this + */ + public function setVerification($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\ExtensionRangeOptions\VerificationState::class); + $this->verification = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php new file mode 100644 index 0000000..6326921 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php @@ -0,0 +1,278 @@ +google.protobuf.ExtensionRangeOptions.Declaration + */ +class Declaration extends \Google\Protobuf\Internal\Message +{ + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + */ + protected $number = null; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + */ + protected $full_name = null; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + */ + protected $type = null; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + */ + protected $reserved = null; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + */ + protected $repeated = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $number + * The extension number declared within the extension range. + * @type string $full_name + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * @type string $type + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * @type bool $reserved + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * @type bool $repeated + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + * @return string + */ + public function getFullName() + { + return isset($this->full_name) ? $this->full_name : ''; + } + + public function hasFullName() + { + return isset($this->full_name); + } + + public function clearFullName() + { + unset($this->full_name); + } + + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + * @param string $var + * @return $this + */ + public function setFullName($var) + { + GPBUtil::checkString($var, True); + $this->full_name = $var; + + return $this; + } + + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + * @return bool + */ + public function getReserved() + { + return isset($this->reserved) ? $this->reserved : false; + } + + public function hasReserved() + { + return isset($this->reserved); + } + + public function clearReserved() + { + unset($this->reserved); + } + + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + * @param bool $var + * @return $this + */ + public function setReserved($var) + { + GPBUtil::checkBool($var); + $this->reserved = $var; + + return $this; + } + + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + * @return bool + */ + public function getRepeated() + { + return isset($this->repeated) ? $this->repeated : false; + } + + public function hasRepeated() + { + return isset($this->repeated); + } + + public function clearRepeated() + { + unset($this->repeated); + } + + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + * @param bool $var + * @return $this + */ + public function setRepeated($var) + { + GPBUtil::checkBool($var); + $this->repeated = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php new file mode 100644 index 0000000..a995d4b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php @@ -0,0 +1,53 @@ +google.protobuf.ExtensionRangeOptions.VerificationState + */ +class VerificationState +{ + /** + * All the extensions of the range must be declared. + * + * Generated from protobuf enum DECLARATION = 0; + */ + const DECLARATION = 0; + /** + * Generated from protobuf enum UNVERIFIED = 1; + */ + const UNVERIFIED = 1; + + private static $valueToName = [ + self::DECLARATION => 'DECLARATION', + self::UNVERIFIED => 'UNVERIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php new file mode 100644 index 0000000..2bac64f --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php @@ -0,0 +1,337 @@ +google.protobuf.FeatureSet + */ +class FeatureSet extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $field_presence = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $enum_type = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $repeated_field_encoding = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $utf8_validation = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $message_encoding = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $json_format = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + */ + protected $enforce_naming_style = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $default_symbol_visibility = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $field_presence + * @type int $enum_type + * @type int $repeated_field_encoding + * @type int $utf8_validation + * @type int $message_encoding + * @type int $json_format + * @type int $enforce_naming_style + * @type int $default_symbol_visibility + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getFieldPresence() + { + return isset($this->field_presence) ? $this->field_presence : 0; + } + + public function hasFieldPresence() + { + return isset($this->field_presence); + } + + public function clearFieldPresence() + { + unset($this->field_presence); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setFieldPresence($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\FieldPresence::class); + $this->field_presence = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getEnumType() + { + return isset($this->enum_type) ? $this->enum_type : 0; + } + + public function hasEnumType() + { + return isset($this->enum_type); + } + + public function clearEnumType() + { + unset($this->enum_type); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setEnumType($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnumType::class); + $this->enum_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getRepeatedFieldEncoding() + { + return isset($this->repeated_field_encoding) ? $this->repeated_field_encoding : 0; + } + + public function hasRepeatedFieldEncoding() + { + return isset($this->repeated_field_encoding); + } + + public function clearRepeatedFieldEncoding() + { + unset($this->repeated_field_encoding); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setRepeatedFieldEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding::class); + $this->repeated_field_encoding = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getUtf8Validation() + { + return isset($this->utf8_validation) ? $this->utf8_validation : 0; + } + + public function hasUtf8Validation() + { + return isset($this->utf8_validation); + } + + public function clearUtf8Validation() + { + unset($this->utf8_validation); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setUtf8Validation($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\Utf8Validation::class); + $this->utf8_validation = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getMessageEncoding() + { + return isset($this->message_encoding) ? $this->message_encoding : 0; + } + + public function hasMessageEncoding() + { + return isset($this->message_encoding); + } + + public function clearMessageEncoding() + { + unset($this->message_encoding); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setMessageEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\MessageEncoding::class); + $this->message_encoding = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getJsonFormat() + { + return isset($this->json_format) ? $this->json_format : 0; + } + + public function hasJsonFormat() + { + return isset($this->json_format); + } + + public function clearJsonFormat() + { + unset($this->json_format); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setJsonFormat($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\JsonFormat::class); + $this->json_format = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + * @return int + */ + public function getEnforceNamingStyle() + { + return isset($this->enforce_naming_style) ? $this->enforce_naming_style : 0; + } + + public function hasEnforceNamingStyle() + { + return isset($this->enforce_naming_style); + } + + public function clearEnforceNamingStyle() + { + unset($this->enforce_naming_style); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + * @param int $var + * @return $this + */ + public function setEnforceNamingStyle($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnforceNamingStyle::class); + $this->enforce_naming_style = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getDefaultSymbolVisibility() + { + return isset($this->default_symbol_visibility) ? $this->default_symbol_visibility : 0; + } + + public function hasDefaultSymbolVisibility() + { + return isset($this->default_symbol_visibility); + } + + public function clearDefaultSymbolVisibility() + { + unset($this->default_symbol_visibility); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setDefaultSymbolVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\VisibilityFeature\DefaultSymbolVisibility::class); + $this->default_symbol_visibility = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php new file mode 100644 index 0000000..8fbb98b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.EnforceNamingStyle + */ +class EnforceNamingStyle +{ + /** + * Generated from protobuf enum ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + const ENFORCE_NAMING_STYLE_UNKNOWN = 0; + /** + * Generated from protobuf enum STYLE2024 = 1; + */ + const STYLE2024 = 1; + /** + * Generated from protobuf enum STYLE_LEGACY = 2; + */ + const STYLE_LEGACY = 2; + + private static $valueToName = [ + self::ENFORCE_NAMING_STYLE_UNKNOWN => 'ENFORCE_NAMING_STYLE_UNKNOWN', + self::STYLE2024 => 'STYLE2024', + self::STYLE_LEGACY => 'STYLE_LEGACY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php new file mode 100644 index 0000000..81e7a08 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.EnumType + */ +class EnumType +{ + /** + * Generated from protobuf enum ENUM_TYPE_UNKNOWN = 0; + */ + const ENUM_TYPE_UNKNOWN = 0; + /** + * Generated from protobuf enum OPEN = 1; + */ + const OPEN = 1; + /** + * Generated from protobuf enum CLOSED = 2; + */ + const CLOSED = 2; + + private static $valueToName = [ + self::ENUM_TYPE_UNKNOWN => 'ENUM_TYPE_UNKNOWN', + self::OPEN => 'OPEN', + self::CLOSED => 'CLOSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php new file mode 100644 index 0000000..d992f05 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php @@ -0,0 +1,59 @@ +google.protobuf.FeatureSet.FieldPresence + */ +class FieldPresence +{ + /** + * Generated from protobuf enum FIELD_PRESENCE_UNKNOWN = 0; + */ + const FIELD_PRESENCE_UNKNOWN = 0; + /** + * Generated from protobuf enum EXPLICIT = 1; + */ + const EXPLICIT = 1; + /** + * Generated from protobuf enum IMPLICIT = 2; + */ + const IMPLICIT = 2; + /** + * Generated from protobuf enum LEGACY_REQUIRED = 3; + */ + const LEGACY_REQUIRED = 3; + + private static $valueToName = [ + self::FIELD_PRESENCE_UNKNOWN => 'FIELD_PRESENCE_UNKNOWN', + self::EXPLICIT => 'EXPLICIT', + self::IMPLICIT => 'IMPLICIT', + self::LEGACY_REQUIRED => 'LEGACY_REQUIRED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php new file mode 100644 index 0000000..c88e840 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.JsonFormat + */ +class JsonFormat +{ + /** + * Generated from protobuf enum JSON_FORMAT_UNKNOWN = 0; + */ + const JSON_FORMAT_UNKNOWN = 0; + /** + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + /** + * Generated from protobuf enum LEGACY_BEST_EFFORT = 2; + */ + const LEGACY_BEST_EFFORT = 2; + + private static $valueToName = [ + self::JSON_FORMAT_UNKNOWN => 'JSON_FORMAT_UNKNOWN', + self::ALLOW => 'ALLOW', + self::LEGACY_BEST_EFFORT => 'LEGACY_BEST_EFFORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php new file mode 100644 index 0000000..6827fe3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.MessageEncoding + */ +class MessageEncoding +{ + /** + * Generated from protobuf enum MESSAGE_ENCODING_UNKNOWN = 0; + */ + const MESSAGE_ENCODING_UNKNOWN = 0; + /** + * Generated from protobuf enum LENGTH_PREFIXED = 1; + */ + const LENGTH_PREFIXED = 1; + /** + * Generated from protobuf enum DELIMITED = 2; + */ + const DELIMITED = 2; + + private static $valueToName = [ + self::MESSAGE_ENCODING_UNKNOWN => 'MESSAGE_ENCODING_UNKNOWN', + self::LENGTH_PREFIXED => 'LENGTH_PREFIXED', + self::DELIMITED => 'DELIMITED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php new file mode 100644 index 0000000..f3ea0c8 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +class RepeatedFieldEncoding +{ + /** + * Generated from protobuf enum REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + const REPEATED_FIELD_ENCODING_UNKNOWN = 0; + /** + * Generated from protobuf enum PACKED = 1; + */ + const PACKED = 1; + /** + * Generated from protobuf enum EXPANDED = 2; + */ + const EXPANDED = 2; + + private static $valueToName = [ + self::REPEATED_FIELD_ENCODING_UNKNOWN => 'REPEATED_FIELD_ENCODING_UNKNOWN', + self::PACKED => 'PACKED', + self::EXPANDED => 'EXPANDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php new file mode 100644 index 0000000..8286c45 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.Utf8Validation + */ +class Utf8Validation +{ + /** + * Generated from protobuf enum UTF8_VALIDATION_UNKNOWN = 0; + */ + const UTF8_VALIDATION_UNKNOWN = 0; + /** + * Generated from protobuf enum VERIFY = 2; + */ + const VERIFY = 2; + /** + * Generated from protobuf enum NONE = 3; + */ + const NONE = 3; + + private static $valueToName = [ + self::UTF8_VALIDATION_UNKNOWN => 'UTF8_VALIDATION_UNKNOWN', + self::VERIFY => 'VERIFY', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php new file mode 100644 index 0000000..20cf256 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php @@ -0,0 +1,34 @@ +google.protobuf.FeatureSet.VisibilityFeature + */ +class VisibilityFeature extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php new file mode 100644 index 0000000..fde693b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php @@ -0,0 +1,74 @@ +google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +class DefaultSymbolVisibility +{ + /** + * Generated from protobuf enum DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + const DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * Generated from protobuf enum EXPORT_ALL = 1; + */ + const EXPORT_ALL = 1; + /** + * All top-level symbols default to export, nested default to local. + * + * Generated from protobuf enum EXPORT_TOP_LEVEL = 2; + */ + const EXPORT_TOP_LEVEL = 2; + /** + * All symbols default to local. + * + * Generated from protobuf enum LOCAL_ALL = 3; + */ + const LOCAL_ALL = 3; + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * Generated from protobuf enum STRICT = 4; + */ + const STRICT = 4; + + private static $valueToName = [ + self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN', + self::EXPORT_ALL => 'EXPORT_ALL', + self::EXPORT_TOP_LEVEL => 'EXPORT_TOP_LEVEL', + self::LOCAL_ALL => 'LOCAL_ALL', + self::STRICT => 'STRICT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php new file mode 100644 index 0000000..5e0e6e0 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php @@ -0,0 +1,162 @@ +google.protobuf.FeatureSetDefaults + */ +class FeatureSetDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + private $defaults; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + */ + protected $minimum_edition = null; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + */ + protected $maximum_edition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault[] $defaults + * @type int $minimum_edition + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * @type int $maximum_edition + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + * @return RepeatedField<\Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault> + */ + public function getDefaults() + { + return $this->defaults; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + * @param \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault[] $var + * @return $this + */ + public function setDefaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class); + $this->defaults = $arr; + + return $this; + } + + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + * @return int + */ + public function getMinimumEdition() + { + return isset($this->minimum_edition) ? $this->minimum_edition : 0; + } + + public function hasMinimumEdition() + { + return isset($this->minimum_edition); + } + + public function clearMinimumEdition() + { + unset($this->minimum_edition); + } + + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + * @param int $var + * @return $this + */ + public function setMinimumEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->minimum_edition = $var; + + return $this; + } + + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + * @return int + */ + public function getMaximumEdition() + { + return isset($this->maximum_edition) ? $this->maximum_edition : 0; + } + + public function hasMaximumEdition() + { + return isset($this->maximum_edition); + } + + public function clearMaximumEdition() + { + unset($this->maximum_edition); + } + + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + * @param int $var + * @return $this + */ + public function setMaximumEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->maximum_edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php new file mode 100644 index 0000000..d8b766c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php @@ -0,0 +1,164 @@ +google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +class FeatureSetEditionDefault extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + */ + protected $edition = null; + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + */ + protected $overridable_features = null; + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + */ + protected $fixed_features = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition + * @type \Google\Protobuf\Internal\FeatureSet $overridable_features + * Defaults of features that can be overridden in this edition. + * @type \Google\Protobuf\Internal\FeatureSet $fixed_features + * Defaults of features that can't be overridden in this edition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @return int + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : 0; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getOverridableFeatures() + { + return $this->overridable_features; + } + + public function hasOverridableFeatures() + { + return isset($this->overridable_features); + } + + public function clearOverridableFeatures() + { + unset($this->overridable_features); + } + + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setOverridableFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->overridable_features = $var; + + return $this; + } + + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFixedFeatures() + { + return $this->fixed_features; + } + + public function hasFixedFeatures() + { + return isset($this->fixed_features); + } + + public function clearFixedFeatures() + { + unset($this->fixed_features); + } + + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFixedFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->fixed_features = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php new file mode 100644 index 0000000..6b8943a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php @@ -0,0 +1,308 @@ +public_desc = new \Google\Protobuf\FieldDescriptor($this); + } + + public function setOneofIndex($index) + { + $this->oneof_index = $index; + } + + public function getOneofIndex() + { + return $this->oneof_index; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function setJsonName($json_name) + { + $this->json_name = $json_name; + } + + public function getJsonName() + { + return $this->json_name; + } + + public function setSetter($setter) + { + $this->setter = $setter; + } + + public function getSetter() + { + return $this->setter; + } + + public function setGetter($getter) + { + $this->getter = $getter; + } + + public function getGetter() + { + return $this->getter; + } + + public function setNumber($number) + { + $this->number = $number; + } + + public function getNumber() + { + return $this->number; + } + + public function setLabel($label) + { + $this->label = $label; + } + + public function getLabel() + { + return $this->label; + } + + public function isRequired() + { + return $this->label === GPBLabel::REQUIRED; + } + + public function isRepeated() + { + return $this->label === GPBLabel::REPEATED; + } + + public function setType($type) + { + $this->type = $type; + } + + public function getType() + { + return $this->type; + } + + public function setMessageType($message_type) + { + $this->message_type = $message_type; + } + + public function getMessageType() + { + return $this->message_type; + } + + public function setEnumType($enum_type) + { + $this->enum_type = $enum_type; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function setPacked($packed) + { + $this->packed = $packed; + } + + public function getPacked() + { + return $this->packed; + } + + public function getProto3Optional() + { + return $this->proto3_optional; + } + + public function setProto3Optional($proto3_optional) + { + $this->proto3_optional = $proto3_optional; + } + + public function getContainingOneof() + { + return $this->containing_oneof; + } + + public function setContainingOneof($containing_oneof) + { + $this->containing_oneof = $containing_oneof; + } + + public function getRealContainingOneof() + { + return !is_null($this->containing_oneof) && !$this->containing_oneof->isSynthetic() + ? $this->containing_oneof : null; + } + + public function isPackable() + { + return $this->isRepeated() && self::isTypePackable($this->type); + } + + public function isMap() + { + return $this->getType() == GPBType::MESSAGE && + !is_null($this->getMessageType()->getOptions()) && + $this->getMessageType()->getOptions()->getMapEntry(); + } + + public function isTimestamp() + { + return $this->getType() == GPBType::MESSAGE && + $this->getMessageType()->getClass() === "Google\Protobuf\Timestamp"; + } + + public function isWrapperType() + { + if ($this->getType() == GPBType::MESSAGE) { + $class = $this->getMessageType()->getClass(); + return in_array($class, [ + "Google\Protobuf\DoubleValue", + "Google\Protobuf\FloatValue", + "Google\Protobuf\Int64Value", + "Google\Protobuf\UInt64Value", + "Google\Protobuf\Int32Value", + "Google\Protobuf\UInt32Value", + "Google\Protobuf\BoolValue", + "Google\Protobuf\StringValue", + "Google\Protobuf\BytesValue", + ]); + } + return false; + } + + private static function isTypePackable($field_type) + { + return ($field_type !== GPBType::STRING && + $field_type !== GPBType::GROUP && + $field_type !== GPBType::MESSAGE && + $field_type !== GPBType::BYTES); + } + + /** + * @param FieldDescriptorProto $proto + * @return FieldDescriptor + */ + public static function getFieldDescriptor($proto) + { + $type_name = null; + $type = $proto->getType(); + switch ($type) { + case GPBType::MESSAGE: + case GPBType::GROUP: + case GPBType::ENUM: + $type_name = $proto->getTypeName(); + break; + default: + break; + } + + $oneof_index = $proto->hasOneofIndex() ? $proto->getOneofIndex() : -1; + // TODO: once proto2 is supported, this default should be false + // for proto2. + if ($proto->getLabel() === GPBLabel::REPEATED && + $proto->getType() !== GPBType::MESSAGE && + $proto->getType() !== GPBType::GROUP && + $proto->getType() !== GPBType::STRING && + $proto->getType() !== GPBType::BYTES) { + $packed = true; + } else { + $packed = false; + } + $options = $proto->getOptions(); + if ($options !== null) { + $packed = $options->getPacked(); + } + + $field = new FieldDescriptor(); + $field->setName($proto->getName()); + + if ($proto->hasJsonName()) { + $json_name = $proto->getJsonName(); + } else { + $proto_name = $proto->getName(); + $json_name = implode('', array_map('ucwords', explode('_', $proto_name))); + if ($proto_name[0] !== "_" && !ctype_upper($proto_name[0])) { + $json_name = lcfirst($json_name); + } + } + $field->setJsonName($json_name); + + $camel_name = implode('', array_map('ucwords', explode('_', $proto->getName()))); + $field->setGetter('get' . $camel_name); + $field->setSetter('set' . $camel_name); + $field->setType($proto->getType()); + $field->setNumber($proto->getNumber()); + $field->setLabel($proto->getLabel()); + $field->setPacked($packed); + $field->setOneofIndex($oneof_index); + $field->setProto3Optional($proto->getProto3Optional()); + + // At this time, the message/enum type may have not been added to pool. + // So we use the type name as place holder and will replace it with the + // actual descriptor in cross building. + switch ($type) { + case GPBType::MESSAGE: + $field->setMessageType($type_name); + break; + case GPBType::ENUM: + $field->setEnumType($type_name); + break; + default: + break; + } + + return $field; + } + + public static function buildFromProto($proto) + { + return FieldDescriptor::getFieldDescriptor($proto); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php new file mode 100644 index 0000000..f10018e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php @@ -0,0 +1,612 @@ +google.protobuf.FieldDescriptorProto + */ +class FieldDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional int32 number = 3; + */ + protected $number = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + */ + protected $label = null; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + */ + protected $type = null; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + */ + protected $type_name = null; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + */ + protected $extendee = null; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + */ + protected $default_value = null; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + */ + protected $oneof_index = null; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + */ + protected $json_name = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + */ + protected $options = null; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + */ + protected $proto3_optional = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int $number + * @type int $label + * @type int $type + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * @type string $type_name + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * @type string $extendee + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * @type string $default_value + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * @type int $oneof_index + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * @type string $json_name + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * @type \Google\Protobuf\Internal\FieldOptions $options + * @type bool $proto3_optional + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 number = 3; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * Generated from protobuf field optional int32 number = 3; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + * @return int + */ + public function getLabel() + { + return isset($this->label) ? $this->label : 0; + } + + public function hasLabel() + { + return isset($this->label); + } + + public function clearLabel() + { + unset($this->label); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + * @param int $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Label::class); + $this->label = $var; + + return $this; + } + + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Type::class); + $this->type = $var; + + return $this; + } + + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + * @return string + */ + public function getTypeName() + { + return isset($this->type_name) ? $this->type_name : ''; + } + + public function hasTypeName() + { + return isset($this->type_name); + } + + public function clearTypeName() + { + unset($this->type_name); + } + + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + * @param string $var + * @return $this + */ + public function setTypeName($var) + { + GPBUtil::checkString($var, True); + $this->type_name = $var; + + return $this; + } + + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + * @return string + */ + public function getExtendee() + { + return isset($this->extendee) ? $this->extendee : ''; + } + + public function hasExtendee() + { + return isset($this->extendee); + } + + public function clearExtendee() + { + unset($this->extendee); + } + + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + * @param string $var + * @return $this + */ + public function setExtendee($var) + { + GPBUtil::checkString($var, True); + $this->extendee = $var; + + return $this; + } + + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + * @return string + */ + public function getDefaultValue() + { + return isset($this->default_value) ? $this->default_value : ''; + } + + public function hasDefaultValue() + { + return isset($this->default_value); + } + + public function clearDefaultValue() + { + unset($this->default_value); + } + + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + * @return int + */ + public function getOneofIndex() + { + return isset($this->oneof_index) ? $this->oneof_index : 0; + } + + public function hasOneofIndex() + { + return isset($this->oneof_index); + } + + public function clearOneofIndex() + { + unset($this->oneof_index); + } + + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + * @param int $var + * @return $this + */ + public function setOneofIndex($var) + { + GPBUtil::checkInt32($var); + $this->oneof_index = $var; + + return $this; + } + + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + * @return string + */ + public function getJsonName() + { + return isset($this->json_name) ? $this->json_name : ''; + } + + public function hasJsonName() + { + return isset($this->json_name); + } + + public function clearJsonName() + { + unset($this->json_name); + } + + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + * @param string $var + * @return $this + */ + public function setJsonName($var) + { + GPBUtil::checkString($var, True); + $this->json_name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + * @return \Google\Protobuf\Internal\FieldOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + * @param \Google\Protobuf\Internal\FieldOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::class); + $this->options = $var; + + return $this; + } + + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + * @return bool + */ + public function getProto3Optional() + { + return isset($this->proto3_optional) ? $this->proto3_optional : false; + } + + public function hasProto3Optional() + { + return isset($this->proto3_optional); + } + + public function clearProto3Optional() + { + unset($this->proto3_optional); + } + + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + * @param bool $var + * @return $this + */ + public function setProto3Optional($var) + { + GPBUtil::checkBool($var); + $this->proto3_optional = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php new file mode 100644 index 0000000..eb091e3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php @@ -0,0 +1,60 @@ +google.protobuf.FieldDescriptorProto.Label + */ +class Label +{ + /** + * 0 is reserved for errors + * + * Generated from protobuf enum LABEL_OPTIONAL = 1; + */ + const LABEL_OPTIONAL = 1; + /** + * Generated from protobuf enum LABEL_REPEATED = 3; + */ + const LABEL_REPEATED = 3; + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * Generated from protobuf enum LABEL_REQUIRED = 2; + */ + const LABEL_REQUIRED = 2; + + private static $valueToName = [ + self::LABEL_OPTIONAL => 'LABEL_OPTIONAL', + self::LABEL_REPEATED => 'LABEL_REPEATED', + self::LABEL_REQUIRED => 'LABEL_REQUIRED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php new file mode 100644 index 0000000..80c8395 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php @@ -0,0 +1,152 @@ +google.protobuf.FieldDescriptorProto.Type + */ +class Type +{ + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * Generated from protobuf enum TYPE_DOUBLE = 1; + */ + const TYPE_DOUBLE = 1; + /** + * Generated from protobuf enum TYPE_FLOAT = 2; + */ + const TYPE_FLOAT = 2; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * Generated from protobuf enum TYPE_INT64 = 3; + */ + const TYPE_INT64 = 3; + /** + * Generated from protobuf enum TYPE_UINT64 = 4; + */ + const TYPE_UINT64 = 4; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * Generated from protobuf enum TYPE_INT32 = 5; + */ + const TYPE_INT32 = 5; + /** + * Generated from protobuf enum TYPE_FIXED64 = 6; + */ + const TYPE_FIXED64 = 6; + /** + * Generated from protobuf enum TYPE_FIXED32 = 7; + */ + const TYPE_FIXED32 = 7; + /** + * Generated from protobuf enum TYPE_BOOL = 8; + */ + const TYPE_BOOL = 8; + /** + * Generated from protobuf enum TYPE_STRING = 9; + */ + const TYPE_STRING = 9; + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + * + * Generated from protobuf enum TYPE_GROUP = 10; + */ + const TYPE_GROUP = 10; + /** + * Length-delimited aggregate. + * + * Generated from protobuf enum TYPE_MESSAGE = 11; + */ + const TYPE_MESSAGE = 11; + /** + * New in version 2. + * + * Generated from protobuf enum TYPE_BYTES = 12; + */ + const TYPE_BYTES = 12; + /** + * Generated from protobuf enum TYPE_UINT32 = 13; + */ + const TYPE_UINT32 = 13; + /** + * Generated from protobuf enum TYPE_ENUM = 14; + */ + const TYPE_ENUM = 14; + /** + * Generated from protobuf enum TYPE_SFIXED32 = 15; + */ + const TYPE_SFIXED32 = 15; + /** + * Generated from protobuf enum TYPE_SFIXED64 = 16; + */ + const TYPE_SFIXED64 = 16; + /** + * Uses ZigZag encoding. + * + * Generated from protobuf enum TYPE_SINT32 = 17; + */ + const TYPE_SINT32 = 17; + /** + * Uses ZigZag encoding. + * + * Generated from protobuf enum TYPE_SINT64 = 18; + */ + const TYPE_SINT64 = 18; + + private static $valueToName = [ + self::TYPE_DOUBLE => 'TYPE_DOUBLE', + self::TYPE_FLOAT => 'TYPE_FLOAT', + self::TYPE_INT64 => 'TYPE_INT64', + self::TYPE_UINT64 => 'TYPE_UINT64', + self::TYPE_INT32 => 'TYPE_INT32', + self::TYPE_FIXED64 => 'TYPE_FIXED64', + self::TYPE_FIXED32 => 'TYPE_FIXED32', + self::TYPE_BOOL => 'TYPE_BOOL', + self::TYPE_STRING => 'TYPE_STRING', + self::TYPE_GROUP => 'TYPE_GROUP', + self::TYPE_MESSAGE => 'TYPE_MESSAGE', + self::TYPE_BYTES => 'TYPE_BYTES', + self::TYPE_UINT32 => 'TYPE_UINT32', + self::TYPE_ENUM => 'TYPE_ENUM', + self::TYPE_SFIXED32 => 'TYPE_SFIXED32', + self::TYPE_SFIXED64 => 'TYPE_SFIXED64', + self::TYPE_SINT32 => 'TYPE_SINT32', + self::TYPE_SINT64 => 'TYPE_SINT64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php new file mode 100644 index 0000000..5442e51 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php @@ -0,0 +1,799 @@ +google.protobuf.FieldOptions + */ +class FieldOptions extends \Google\Protobuf\Internal\Message +{ + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + protected $ctype = null; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * Generated from protobuf field optional bool packed = 2; + */ + protected $packed = null; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + protected $jstype = null; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + */ + protected $lazy = null; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + */ + protected $unverified_lazy = null; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false, deprecated = true]; + * @deprecated + */ + protected $weak = null; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + */ + protected $debug_redact = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + protected $retention = null; + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + private $targets; + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + private $edition_defaults; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + */ + protected $features = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + protected $feature_support = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ctype + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * @type bool $packed + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * @type int $jstype + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * @type bool $lazy + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * @type bool $unverified_lazy + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * @type bool $deprecated + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * @type bool $weak + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * @type bool $debug_redact + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * @type int $retention + * @type int[] $targets + * @type \Google\Protobuf\Internal\FieldOptions\EditionDefault[] $edition_defaults + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\FieldOptions\FeatureSupport $feature_support + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + * @return int + */ + public function getCtype() + { + return isset($this->ctype) ? $this->ctype : 0; + } + + public function hasCtype() + { + return isset($this->ctype); + } + + public function clearCtype() + { + unset($this->ctype); + } + + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + * @param int $var + * @return $this + */ + public function setCtype($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\CType::class); + $this->ctype = $var; + + return $this; + } + + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * Generated from protobuf field optional bool packed = 2; + * @return bool + */ + public function getPacked() + { + return isset($this->packed) ? $this->packed : false; + } + + public function hasPacked() + { + return isset($this->packed); + } + + public function clearPacked() + { + unset($this->packed); + } + + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * Generated from protobuf field optional bool packed = 2; + * @param bool $var + * @return $this + */ + public function setPacked($var) + { + GPBUtil::checkBool($var); + $this->packed = $var; + + return $this; + } + + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + * @return int + */ + public function getJstype() + { + return isset($this->jstype) ? $this->jstype : 0; + } + + public function hasJstype() + { + return isset($this->jstype); + } + + public function clearJstype() + { + unset($this->jstype); + } + + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + * @param int $var + * @return $this + */ + public function setJstype($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\JSType::class); + $this->jstype = $var; + + return $this; + } + + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + * @return bool + */ + public function getLazy() + { + return isset($this->lazy) ? $this->lazy : false; + } + + public function hasLazy() + { + return isset($this->lazy); + } + + public function clearLazy() + { + unset($this->lazy); + } + + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + * @param bool $var + * @return $this + */ + public function setLazy($var) + { + GPBUtil::checkBool($var); + $this->lazy = $var; + + return $this; + } + + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + * @return bool + */ + public function getUnverifiedLazy() + { + return isset($this->unverified_lazy) ? $this->unverified_lazy : false; + } + + public function hasUnverifiedLazy() + { + return isset($this->unverified_lazy); + } + + public function clearUnverifiedLazy() + { + unset($this->unverified_lazy); + } + + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + * @param bool $var + * @return $this + */ + public function setUnverifiedLazy($var) + { + GPBUtil::checkBool($var); + $this->unverified_lazy = $var; + + return $this; + } + + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false, deprecated = true]; + * @return bool + * @deprecated + */ + public function getWeak() + { + if (isset($this->weak)) { + @trigger_error('weak is deprecated.', E_USER_DEPRECATED); + } + return isset($this->weak) ? $this->weak : false; + } + + public function hasWeak() + { + if (isset($this->weak)) { + @trigger_error('weak is deprecated.', E_USER_DEPRECATED); + } + return isset($this->weak); + } + + public function clearWeak() + { + @trigger_error('weak is deprecated.', E_USER_DEPRECATED); + unset($this->weak); + } + + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false, deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setWeak($var) + { + @trigger_error('weak is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->weak = $var; + + return $this; + } + + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + * @return bool + */ + public function getDebugRedact() + { + return isset($this->debug_redact) ? $this->debug_redact : false; + } + + public function hasDebugRedact() + { + return isset($this->debug_redact); + } + + public function clearDebugRedact() + { + unset($this->debug_redact); + } + + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + * @param bool $var + * @return $this + */ + public function setDebugRedact($var) + { + GPBUtil::checkBool($var); + $this->debug_redact = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + * @return int + */ + public function getRetention() + { + return isset($this->retention) ? $this->retention : 0; + } + + public function hasRetention() + { + return isset($this->retention); + } + + public function clearRetention() + { + unset($this->retention); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + * @param int $var + * @return $this + */ + public function setRetention($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\OptionRetention::class); + $this->retention = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + * @return RepeatedField + */ + public function getTargets() + { + return $this->targets; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + * @param int[] $var + * @return $this + */ + public function setTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Protobuf\Internal\FieldOptions\OptionTargetType::class); + $this->targets = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + * @return RepeatedField<\Google\Protobuf\Internal\FieldOptions\EditionDefault> + */ + public function getEditionDefaults() + { + return $this->edition_defaults; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + * @param \Google\Protobuf\Internal\FieldOptions\EditionDefault[] $var + * @return $this + */ + public function setEditionDefaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldOptions\EditionDefault::class); + $this->edition_defaults = $arr; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + * @return \Google\Protobuf\Internal\FieldOptions\FeatureSupport|null + */ + public function getFeatureSupport() + { + return $this->feature_support; + } + + public function hasFeatureSupport() + { + return isset($this->feature_support); + } + + public function clearFeatureSupport() + { + unset($this->feature_support); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + * @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var + * @return $this + */ + public function setFeatureSupport($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class); + $this->feature_support = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php new file mode 100644 index 0000000..a248777 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php @@ -0,0 +1,63 @@ +google.protobuf.FieldOptions.CType + */ +class CType +{ + /** + * Default mode. + * + * Generated from protobuf enum STRING = 0; + */ + const STRING = 0; + /** + * The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + * + * Generated from protobuf enum CORD = 1; + */ + const CORD = 1; + /** + * Generated from protobuf enum STRING_PIECE = 2; + */ + const STRING_PIECE = 2; + + private static $valueToName = [ + self::STRING => 'STRING', + self::CORD => 'CORD', + self::STRING_PIECE => 'STRING_PIECE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php new file mode 100644 index 0000000..a5804ba --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php @@ -0,0 +1,115 @@ +google.protobuf.FieldOptions.EditionDefault + */ +class EditionDefault extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + */ + protected $edition = null; + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition + * @type string $value + * Textproto value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @return int + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : 0; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php new file mode 100644 index 0000000..940c723 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php @@ -0,0 +1,236 @@ +google.protobuf.FieldOptions.FeatureSupport + */ +class FeatureSupport extends \Google\Protobuf\Internal\Message +{ + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + */ + protected $edition_introduced = null; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + */ + protected $edition_deprecated = null; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + */ + protected $deprecation_warning = null; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + */ + protected $edition_removed = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition_introduced + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * @type int $edition_deprecated + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * @type string $deprecation_warning + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * @type int $edition_removed + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + * @return int + */ + public function getEditionIntroduced() + { + return isset($this->edition_introduced) ? $this->edition_introduced : 0; + } + + public function hasEditionIntroduced() + { + return isset($this->edition_introduced); + } + + public function clearEditionIntroduced() + { + unset($this->edition_introduced); + } + + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + * @param int $var + * @return $this + */ + public function setEditionIntroduced($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_introduced = $var; + + return $this; + } + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + * @return int + */ + public function getEditionDeprecated() + { + return isset($this->edition_deprecated) ? $this->edition_deprecated : 0; + } + + public function hasEditionDeprecated() + { + return isset($this->edition_deprecated); + } + + public function clearEditionDeprecated() + { + unset($this->edition_deprecated); + } + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + * @param int $var + * @return $this + */ + public function setEditionDeprecated($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_deprecated = $var; + + return $this; + } + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + * @return string + */ + public function getDeprecationWarning() + { + return isset($this->deprecation_warning) ? $this->deprecation_warning : ''; + } + + public function hasDeprecationWarning() + { + return isset($this->deprecation_warning); + } + + public function clearDeprecationWarning() + { + unset($this->deprecation_warning); + } + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + * @param string $var + * @return $this + */ + public function setDeprecationWarning($var) + { + GPBUtil::checkString($var, True); + $this->deprecation_warning = $var; + + return $this; + } + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + * @return int + */ + public function getEditionRemoved() + { + return isset($this->edition_removed) ? $this->edition_removed : 0; + } + + public function hasEditionRemoved() + { + return isset($this->edition_removed); + } + + public function clearEditionRemoved() + { + unset($this->edition_removed); + } + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + * @param int $var + * @return $this + */ + public function setEditionRemoved($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_removed = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php new file mode 100644 index 0000000..5ecc06b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php @@ -0,0 +1,60 @@ +google.protobuf.FieldOptions.JSType + */ +class JSType +{ + /** + * Use the default type. + * + * Generated from protobuf enum JS_NORMAL = 0; + */ + const JS_NORMAL = 0; + /** + * Use JavaScript strings. + * + * Generated from protobuf enum JS_STRING = 1; + */ + const JS_STRING = 1; + /** + * Use JavaScript numbers. + * + * Generated from protobuf enum JS_NUMBER = 2; + */ + const JS_NUMBER = 2; + + private static $valueToName = [ + self::JS_NORMAL => 'JS_NORMAL', + self::JS_STRING => 'JS_STRING', + self::JS_NUMBER => 'JS_NUMBER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionRetention.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionRetention.php new file mode 100644 index 0000000..7bc16d4 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionRetention.php @@ -0,0 +1,56 @@ +google.protobuf.FieldOptions.OptionRetention + */ +class OptionRetention +{ + /** + * Generated from protobuf enum RETENTION_UNKNOWN = 0; + */ + const RETENTION_UNKNOWN = 0; + /** + * Generated from protobuf enum RETENTION_RUNTIME = 1; + */ + const RETENTION_RUNTIME = 1; + /** + * Generated from protobuf enum RETENTION_SOURCE = 2; + */ + const RETENTION_SOURCE = 2; + + private static $valueToName = [ + self::RETENTION_UNKNOWN => 'RETENTION_UNKNOWN', + self::RETENTION_RUNTIME => 'RETENTION_RUNTIME', + self::RETENTION_SOURCE => 'RETENTION_SOURCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php new file mode 100644 index 0000000..f633cdd --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php @@ -0,0 +1,93 @@ +google.protobuf.FieldOptions.OptionTargetType + */ +class OptionTargetType +{ + /** + * Generated from protobuf enum TARGET_TYPE_UNKNOWN = 0; + */ + const TARGET_TYPE_UNKNOWN = 0; + /** + * Generated from protobuf enum TARGET_TYPE_FILE = 1; + */ + const TARGET_TYPE_FILE = 1; + /** + * Generated from protobuf enum TARGET_TYPE_EXTENSION_RANGE = 2; + */ + const TARGET_TYPE_EXTENSION_RANGE = 2; + /** + * Generated from protobuf enum TARGET_TYPE_MESSAGE = 3; + */ + const TARGET_TYPE_MESSAGE = 3; + /** + * Generated from protobuf enum TARGET_TYPE_FIELD = 4; + */ + const TARGET_TYPE_FIELD = 4; + /** + * Generated from protobuf enum TARGET_TYPE_ONEOF = 5; + */ + const TARGET_TYPE_ONEOF = 5; + /** + * Generated from protobuf enum TARGET_TYPE_ENUM = 6; + */ + const TARGET_TYPE_ENUM = 6; + /** + * Generated from protobuf enum TARGET_TYPE_ENUM_ENTRY = 7; + */ + const TARGET_TYPE_ENUM_ENTRY = 7; + /** + * Generated from protobuf enum TARGET_TYPE_SERVICE = 8; + */ + const TARGET_TYPE_SERVICE = 8; + /** + * Generated from protobuf enum TARGET_TYPE_METHOD = 9; + */ + const TARGET_TYPE_METHOD = 9; + + private static $valueToName = [ + self::TARGET_TYPE_UNKNOWN => 'TARGET_TYPE_UNKNOWN', + self::TARGET_TYPE_FILE => 'TARGET_TYPE_FILE', + self::TARGET_TYPE_EXTENSION_RANGE => 'TARGET_TYPE_EXTENSION_RANGE', + self::TARGET_TYPE_MESSAGE => 'TARGET_TYPE_MESSAGE', + self::TARGET_TYPE_FIELD => 'TARGET_TYPE_FIELD', + self::TARGET_TYPE_ONEOF => 'TARGET_TYPE_ONEOF', + self::TARGET_TYPE_ENUM => 'TARGET_TYPE_ENUM', + self::TARGET_TYPE_ENUM_ENTRY => 'TARGET_TYPE_ENUM_ENTRY', + self::TARGET_TYPE_SERVICE => 'TARGET_TYPE_SERVICE', + self::TARGET_TYPE_METHOD => 'TARGET_TYPE_METHOD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php new file mode 100644 index 0000000..a81cef1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php @@ -0,0 +1,66 @@ +package = $package; + } + + public function getPackage() + { + return $this->package; + } + + public function getMessageType() + { + return $this->message_type; + } + + public function addMessageType($desc) + { + $this->message_type[] = $desc; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function addEnumType($desc) + { + $this->enum_type[]= $desc; + } + + public static function buildFromProto($proto) + { + $file = new FileDescriptor(); + $file->setPackage($proto->getPackage()); + foreach ($proto->getMessageType() as $message_proto) { + $file->addMessageType(Descriptor::buildFromProto( + $message_proto, $proto, "")); + } + foreach ($proto->getEnumType() as $enum_proto) { + $file->addEnumType( + EnumDescriptor::buildFromProto( + $enum_proto, + $proto, + "")); + } + return $file; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php new file mode 100644 index 0000000..56aa224 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php @@ -0,0 +1,596 @@ +google.protobuf.FileDescriptorProto + */ +class FileDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + */ + protected $package = null; + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + */ + private $dependency; + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + */ + private $public_dependency; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + */ + private $weak_dependency; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + */ + private $option_dependency; + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + */ + private $message_type; + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + */ + private $enum_type; + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + */ + private $service; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + */ + private $extension; + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + */ + protected $options = null; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + */ + protected $source_code_info = null; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional string syntax = 12; + */ + protected $syntax = null; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; + */ + protected $edition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * file name, relative to root of source tree + * @type string $package + * e.g. "foo", "foo.bar", etc. + * @type string[] $dependency + * Names of files imported by this file. + * @type int[] $public_dependency + * Indexes of the public imported files in the dependency list above. + * @type int[] $weak_dependency + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * @type string[] $option_dependency + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * @type \Google\Protobuf\Internal\DescriptorProto[] $message_type + * All top-level definitions in this file. + * @type \Google\Protobuf\Internal\EnumDescriptorProto[] $enum_type + * @type \Google\Protobuf\Internal\ServiceDescriptorProto[] $service + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $extension + * @type \Google\Protobuf\Internal\FileOptions $options + * @type \Google\Protobuf\Internal\SourceCodeInfo $source_code_info + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * @type string $syntax + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type int $edition + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + * @return string + */ + public function getPackage() + { + return isset($this->package) ? $this->package : ''; + } + + public function hasPackage() + { + return isset($this->package); + } + + public function clearPackage() + { + unset($this->package); + } + + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + * @param string $var + * @return $this + */ + public function setPackage($var) + { + GPBUtil::checkString($var, True); + $this->package = $var; + + return $this; + } + + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + * @return RepeatedField + */ + public function getDependency() + { + return $this->dependency; + } + + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + * @param string[] $var + * @return $this + */ + public function setDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dependency = $arr; + + return $this; + } + + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + * @return RepeatedField + */ + public function getPublicDependency() + { + return $this->public_dependency; + } + + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + * @param int[] $var + * @return $this + */ + public function setPublicDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->public_dependency = $arr; + + return $this; + } + + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + * @return RepeatedField + */ + public function getWeakDependency() + { + return $this->weak_dependency; + } + + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + * @param int[] $var + * @return $this + */ + public function setWeakDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->weak_dependency = $arr; + + return $this; + } + + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + * @return RepeatedField + */ + public function getOptionDependency() + { + return $this->option_dependency; + } + + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + * @param string[] $var + * @return $this + */ + public function setOptionDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->option_dependency = $arr; + + return $this; + } + + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto> + */ + public function getMessageType() + { + return $this->message_type; + } + + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + * @param \Google\Protobuf\Internal\DescriptorProto[] $var + * @return $this + */ + public function setMessageType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class); + $this->message_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto> + */ + public function getEnumType() + { + return $this->enum_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + * @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var + * @return $this + */ + public function setEnumType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class); + $this->enum_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + * @return RepeatedField<\Google\Protobuf\Internal\ServiceDescriptorProto> + */ + public function getService() + { + return $this->service; + } + + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + * @param \Google\Protobuf\Internal\ServiceDescriptorProto[] $var + * @return $this + */ + public function setService($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ServiceDescriptorProto::class); + $this->service = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> + */ + public function getExtension() + { + return $this->extension; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var + * @return $this + */ + public function setExtension($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->extension = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + * @return \Google\Protobuf\Internal\FileOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + * @param \Google\Protobuf\Internal\FileOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FileOptions::class); + $this->options = $var; + + return $this; + } + + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + * @return \Google\Protobuf\Internal\SourceCodeInfo|null + */ + public function getSourceCodeInfo() + { + return $this->source_code_info; + } + + public function hasSourceCodeInfo() + { + return isset($this->source_code_info); + } + + public function clearSourceCodeInfo() + { + unset($this->source_code_info); + } + + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + * @param \Google\Protobuf\Internal\SourceCodeInfo $var + * @return $this + */ + public function setSourceCodeInfo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\SourceCodeInfo::class); + $this->source_code_info = $var; + + return $this; + } + + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional string syntax = 12; + * @return string + */ + public function getSyntax() + { + return isset($this->syntax) ? $this->syntax : ''; + } + + public function hasSyntax() + { + return isset($this->syntax); + } + + public function clearSyntax() + { + unset($this->syntax); + } + + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional string syntax = 12; + * @param string $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkString($var, True); + $this->syntax = $var; + + return $this; + } + + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; + * @return int + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : 0; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php new file mode 100644 index 0000000..60d5f4b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php @@ -0,0 +1,64 @@ +google.protobuf.FileDescriptorSet + */ +class FileDescriptorSet extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + */ + private $file; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\FileDescriptorProto[] $file + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + * @return RepeatedField<\Google\Protobuf\Internal\FileDescriptorProto> + */ + public function getFile() + { + return $this->file; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + * @param \Google\Protobuf\Internal\FileDescriptorProto[] $var + * @return $this + */ + public function setFile($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FileDescriptorProto::class); + $this->file = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php new file mode 100644 index 0000000..91c9423 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php @@ -0,0 +1,1138 @@ +google.protobuf.FileOptions + */ +class FileOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + */ + protected $java_package = null; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + */ + protected $java_outer_classname = null; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + */ + protected $java_multiple_files = null; + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + protected $java_generate_equals_and_hash = null; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + */ + protected $java_string_check_utf8 = null; + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + protected $optimize_for = null; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + */ + protected $go_package = null; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + */ + protected $cc_generic_services = null; + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + */ + protected $java_generic_services = null; + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + */ + protected $py_generic_services = null; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + */ + protected $deprecated = null; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + */ + protected $cc_enable_arenas = null; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + */ + protected $objc_class_prefix = null; + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + */ + protected $csharp_namespace = null; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + */ + protected $swift_prefix = null; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + */ + protected $php_class_prefix = null; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + */ + protected $php_namespace = null; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + */ + protected $php_metadata_namespace = null; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + */ + protected $ruby_package = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + */ + protected $features = null; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $java_package + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * @type string $java_outer_classname + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * @type bool $java_multiple_files + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * @type bool $java_generate_equals_and_hash + * This option does nothing. + * @type bool $java_string_check_utf8 + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * @type int $optimize_for + * @type string $go_package + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * @type bool $cc_generic_services + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * @type bool $java_generic_services + * @type bool $py_generic_services + * @type bool $deprecated + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * @type bool $cc_enable_arenas + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * @type string $objc_class_prefix + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * @type string $csharp_namespace + * Namespace for generated classes; defaults to the package. + * @type string $swift_prefix + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * @type string $php_class_prefix + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * @type string $php_namespace + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * @type string $php_metadata_namespace + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * @type string $ruby_package + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + * @return string + */ + public function getJavaPackage() + { + return isset($this->java_package) ? $this->java_package : ''; + } + + public function hasJavaPackage() + { + return isset($this->java_package); + } + + public function clearJavaPackage() + { + unset($this->java_package); + } + + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + * @param string $var + * @return $this + */ + public function setJavaPackage($var) + { + GPBUtil::checkString($var, True); + $this->java_package = $var; + + return $this; + } + + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + * @return string + */ + public function getJavaOuterClassname() + { + return isset($this->java_outer_classname) ? $this->java_outer_classname : ''; + } + + public function hasJavaOuterClassname() + { + return isset($this->java_outer_classname); + } + + public function clearJavaOuterClassname() + { + unset($this->java_outer_classname); + } + + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + * @param string $var + * @return $this + */ + public function setJavaOuterClassname($var) + { + GPBUtil::checkString($var, True); + $this->java_outer_classname = $var; + + return $this; + } + + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + * @return bool + */ + public function getJavaMultipleFiles() + { + return isset($this->java_multiple_files) ? $this->java_multiple_files : false; + } + + public function hasJavaMultipleFiles() + { + return isset($this->java_multiple_files); + } + + public function clearJavaMultipleFiles() + { + unset($this->java_multiple_files); + } + + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaMultipleFiles($var) + { + GPBUtil::checkBool($var); + $this->java_multiple_files = $var; + + return $this; + } + + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getJavaGenerateEqualsAndHash() + { + if (isset($this->java_generate_equals_and_hash)) { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + } + return isset($this->java_generate_equals_and_hash) ? $this->java_generate_equals_and_hash : false; + } + + public function hasJavaGenerateEqualsAndHash() + { + if (isset($this->java_generate_equals_and_hash)) { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + } + return isset($this->java_generate_equals_and_hash); + } + + public function clearJavaGenerateEqualsAndHash() + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + unset($this->java_generate_equals_and_hash); + } + + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setJavaGenerateEqualsAndHash($var) + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->java_generate_equals_and_hash = $var; + + return $this; + } + + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + * @return bool + */ + public function getJavaStringCheckUtf8() + { + return isset($this->java_string_check_utf8) ? $this->java_string_check_utf8 : false; + } + + public function hasJavaStringCheckUtf8() + { + return isset($this->java_string_check_utf8); + } + + public function clearJavaStringCheckUtf8() + { + unset($this->java_string_check_utf8); + } + + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaStringCheckUtf8($var) + { + GPBUtil::checkBool($var); + $this->java_string_check_utf8 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + * @return int + */ + public function getOptimizeFor() + { + return isset($this->optimize_for) ? $this->optimize_for : 0; + } + + public function hasOptimizeFor() + { + return isset($this->optimize_for); + } + + public function clearOptimizeFor() + { + unset($this->optimize_for); + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + * @param int $var + * @return $this + */ + public function setOptimizeFor($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FileOptions\OptimizeMode::class); + $this->optimize_for = $var; + + return $this; + } + + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + * @return string + */ + public function getGoPackage() + { + return isset($this->go_package) ? $this->go_package : ''; + } + + public function hasGoPackage() + { + return isset($this->go_package); + } + + public function clearGoPackage() + { + unset($this->go_package); + } + + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + * @param string $var + * @return $this + */ + public function setGoPackage($var) + { + GPBUtil::checkString($var, True); + $this->go_package = $var; + + return $this; + } + + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + * @return bool + */ + public function getCcGenericServices() + { + return isset($this->cc_generic_services) ? $this->cc_generic_services : false; + } + + public function hasCcGenericServices() + { + return isset($this->cc_generic_services); + } + + public function clearCcGenericServices() + { + unset($this->cc_generic_services); + } + + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + * @param bool $var + * @return $this + */ + public function setCcGenericServices($var) + { + GPBUtil::checkBool($var); + $this->cc_generic_services = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + * @return bool + */ + public function getJavaGenericServices() + { + return isset($this->java_generic_services) ? $this->java_generic_services : false; + } + + public function hasJavaGenericServices() + { + return isset($this->java_generic_services); + } + + public function clearJavaGenericServices() + { + unset($this->java_generic_services); + } + + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaGenericServices($var) + { + GPBUtil::checkBool($var); + $this->java_generic_services = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + * @return bool + */ + public function getPyGenericServices() + { + return isset($this->py_generic_services) ? $this->py_generic_services : false; + } + + public function hasPyGenericServices() + { + return isset($this->py_generic_services); + } + + public function clearPyGenericServices() + { + unset($this->py_generic_services); + } + + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + * @param bool $var + * @return $this + */ + public function setPyGenericServices($var) + { + GPBUtil::checkBool($var); + $this->py_generic_services = $var; + + return $this; + } + + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + * @return bool + */ + public function getCcEnableArenas() + { + return isset($this->cc_enable_arenas) ? $this->cc_enable_arenas : false; + } + + public function hasCcEnableArenas() + { + return isset($this->cc_enable_arenas); + } + + public function clearCcEnableArenas() + { + unset($this->cc_enable_arenas); + } + + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + * @param bool $var + * @return $this + */ + public function setCcEnableArenas($var) + { + GPBUtil::checkBool($var); + $this->cc_enable_arenas = $var; + + return $this; + } + + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + * @return string + */ + public function getObjcClassPrefix() + { + return isset($this->objc_class_prefix) ? $this->objc_class_prefix : ''; + } + + public function hasObjcClassPrefix() + { + return isset($this->objc_class_prefix); + } + + public function clearObjcClassPrefix() + { + unset($this->objc_class_prefix); + } + + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + * @param string $var + * @return $this + */ + public function setObjcClassPrefix($var) + { + GPBUtil::checkString($var, True); + $this->objc_class_prefix = $var; + + return $this; + } + + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + * @return string + */ + public function getCsharpNamespace() + { + return isset($this->csharp_namespace) ? $this->csharp_namespace : ''; + } + + public function hasCsharpNamespace() + { + return isset($this->csharp_namespace); + } + + public function clearCsharpNamespace() + { + unset($this->csharp_namespace); + } + + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + * @param string $var + * @return $this + */ + public function setCsharpNamespace($var) + { + GPBUtil::checkString($var, True); + $this->csharp_namespace = $var; + + return $this; + } + + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + * @return string + */ + public function getSwiftPrefix() + { + return isset($this->swift_prefix) ? $this->swift_prefix : ''; + } + + public function hasSwiftPrefix() + { + return isset($this->swift_prefix); + } + + public function clearSwiftPrefix() + { + unset($this->swift_prefix); + } + + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + * @param string $var + * @return $this + */ + public function setSwiftPrefix($var) + { + GPBUtil::checkString($var, True); + $this->swift_prefix = $var; + + return $this; + } + + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + * @return string + */ + public function getPhpClassPrefix() + { + return isset($this->php_class_prefix) ? $this->php_class_prefix : ''; + } + + public function hasPhpClassPrefix() + { + return isset($this->php_class_prefix); + } + + public function clearPhpClassPrefix() + { + unset($this->php_class_prefix); + } + + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + * @param string $var + * @return $this + */ + public function setPhpClassPrefix($var) + { + GPBUtil::checkString($var, True); + $this->php_class_prefix = $var; + + return $this; + } + + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + * @return string + */ + public function getPhpNamespace() + { + return isset($this->php_namespace) ? $this->php_namespace : ''; + } + + public function hasPhpNamespace() + { + return isset($this->php_namespace); + } + + public function clearPhpNamespace() + { + unset($this->php_namespace); + } + + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + * @param string $var + * @return $this + */ + public function setPhpNamespace($var) + { + GPBUtil::checkString($var, True); + $this->php_namespace = $var; + + return $this; + } + + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + * @return string + */ + public function getPhpMetadataNamespace() + { + return isset($this->php_metadata_namespace) ? $this->php_metadata_namespace : ''; + } + + public function hasPhpMetadataNamespace() + { + return isset($this->php_metadata_namespace); + } + + public function clearPhpMetadataNamespace() + { + unset($this->php_metadata_namespace); + } + + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + * @param string $var + * @return $this + */ + public function setPhpMetadataNamespace($var) + { + GPBUtil::checkString($var, True); + $this->php_metadata_namespace = $var; + + return $this; + } + + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + * @return string + */ + public function getRubyPackage() + { + return isset($this->ruby_package) ? $this->ruby_package : ''; + } + + public function hasRubyPackage() + { + return isset($this->ruby_package); + } + + public function clearRubyPackage() + { + unset($this->ruby_package); + } + + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + * @param string $var + * @return $this + */ + public function setRubyPackage($var) + { + GPBUtil::checkString($var, True); + $this->ruby_package = $var; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php new file mode 100644 index 0000000..2ffe8b2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php @@ -0,0 +1,62 @@ +google.protobuf.FileOptions.OptimizeMode + */ +class OptimizeMode +{ + /** + * Generate complete code for parsing, serialization, + * + * Generated from protobuf enum SPEED = 1; + */ + const SPEED = 1; + /** + * etc. + * + * Generated from protobuf enum CODE_SIZE = 2; + */ + const CODE_SIZE = 2; + /** + * Generate code using MessageLite and the lite runtime. + * + * Generated from protobuf enum LITE_RUNTIME = 3; + */ + const LITE_RUNTIME = 3; + + private static $valueToName = [ + self::SPEED => 'SPEED', + self::CODE_SIZE => 'CODE_SIZE', + self::LITE_RUNTIME => 'LITE_RUNTIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php new file mode 100644 index 0000000..7104109 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php @@ -0,0 +1,24 @@ +writeRaw("\"", 1); + $field_name = GPBJsonWire::formatFieldName($field, $output->getOptions()); + $output->writeRaw($field_name, strlen($field_name)); + $output->writeRaw("\":", 2); + } + return static::serializeFieldValueToStream( + $value, + $field, + $output, + !$has_field_name); + } + + public static function serializeFieldValueToStream( + $values, + $field, + &$output, + $is_well_known = false) + { + if ($field->isMap()) { + $output->writeRaw("{", 1); + $first = true; + $map_entry = $field->getMessageType(); + $key_field = $map_entry->getFieldByNumber(1); + $value_field = $map_entry->getFieldByNumber(2); + + switch ($key_field->getType()) { + case GPBType::STRING: + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::FIXED64: + case GPBType::UINT64: + $additional_quote = false; + break; + default: + $additional_quote = true; + } + + foreach ($values as $key => $value) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if ($additional_quote) { + $output->writeRaw("\"", 1); + } + if (!static::serializeSingularFieldValueToStream( + $key, + $key_field, + $output, + $is_well_known)) { + return false; + } + if ($additional_quote) { + $output->writeRaw("\"", 1); + } + $output->writeRaw(":", 1); + if (!static::serializeSingularFieldValueToStream( + $value, + $value_field, + $output, + $is_well_known)) { + return false; + } + } + $output->writeRaw("}", 1); + return true; + } elseif ($field->isRepeated()) { + $output->writeRaw("[", 1); + $first = true; + foreach ($values as $value) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if (!static::serializeSingularFieldValueToStream( + $value, + $field, + $output, + $is_well_known)) { + return false; + } + } + $output->writeRaw("]", 1); + return true; + } else { + return static::serializeSingularFieldValueToStream( + $values, + $field, + $output, + $is_well_known); + } + } + + private static function serializeSingularFieldValueToStream( + $value, + $field, + &$output, $is_well_known = false) + { + switch ($field->getType()) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + if ($value < 0) { + $value = bcadd($value, "4294967296"); + } + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + if ($value < 0) { + $value = bcadd($value, "18446744073709551616"); + } + // Intentional fall through. + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + $output->writeRaw("\"", 1); + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + $output->writeRaw("\"", 1); + break; + case GPBType::FLOAT: + if (is_nan($value)) { + $str_value = "\"NaN\""; + } elseif ($value === INF) { + $str_value = "\"Infinity\""; + } elseif ($value === -INF) { + $str_value = "\"-Infinity\""; + } else { + $str_value = sprintf("%.8g", $value); + } + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::DOUBLE: + if (is_nan($value)) { + $str_value = "\"NaN\""; + } elseif ($value === INF) { + $str_value = "\"Infinity\""; + } elseif ($value === -INF) { + $str_value = "\"-Infinity\""; + } else { + $str_value = sprintf("%.17g", $value); + } + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::ENUM: + $enum_desc = $field->getEnumType(); + if ($enum_desc->getClass() === "Google\Protobuf\NullValue") { + $output->writeRaw("null", 4); + break; + } + if ($output->getOptions() & PrintOptions::ALWAYS_PRINT_ENUMS_AS_INTS) { + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + } + $enum_value_desc = $enum_desc->getValueByNumber($value); + if (!is_null($enum_value_desc)) { + $str_value = $enum_value_desc->getName(); + $output->writeRaw("\"", 1); + $output->writeRaw($str_value, strlen($str_value)); + $output->writeRaw("\"", 1); + } else { + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + } + break; + case GPBType::BOOL: + if ($value) { + $output->writeRaw("true", 4); + } else { + $output->writeRaw("false", 5); + } + break; + case GPBType::BYTES: + $bytes_value = base64_encode($value); + $output->writeRaw("\"", 1); + $output->writeRaw($bytes_value, strlen($bytes_value)); + $output->writeRaw("\"", 1); + break; + case GPBType::STRING: + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + $output->writeRaw($value, strlen($value)); + break; + // case GPBType::GROUP: + // echo "GROUP\xA"; + // trigger_error("Not implemented.", E_ERROR); + // break; + case GPBType::MESSAGE: + $value->serializeToJsonStream($output); + break; + default: + user_error("Unsupported type."); + return false; + } + return true; + } + + private static function formatFieldName($field, $options) + { + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + return $field->getName(); + } + return $field->getJsonName(); + } + + // Used for escaping control chars in strings. + private static $k_control_char_limit = 0x20; + + private static function jsonNiceEscape($c) + { + switch ($c) { + case '"': return "\\\""; + case '\\': return "\\\\"; + case '/': return "\\/"; + case '\b': return "\\b"; + case '\f': return "\\f"; + case '\n': return "\\n"; + case '\r': return "\\r"; + case '\t': return "\\t"; + default: return NULL; + } + } + + private static function isJsonEscaped($c) + { + // See RFC 4627. + return $c < chr($k_control_char_limit) || $c === "\"" || $c === "\\"; + } + + public static function escapedJson($value) + { + $escaped_value = ""; + $unescaped_run = ""; + for ($i = 0; $i < strlen($value); $i++) { + $c = $value[$i]; + // Handle escaping. + if (static::isJsonEscaped($c)) { + // Use a "nice" escape, like \n, if one exists for this + // character. + $escape = static::jsonNiceEscape($c); + if (is_null($escape)) { + $escape = "\\u00" . bin2hex($c); + } + if ($unescaped_run !== "") { + $escaped_value .= $unescaped_run; + $unescaped_run = ""; + } + $escaped_value .= $escape; + } else { + if ($unescaped_run === "") { + $unescaped_run .= $c; + } + } + } + $escaped_value .= $unescaped_run; + return $escaped_value; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php new file mode 100644 index 0000000..7f13998 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php @@ -0,0 +1,17 @@ + 0) { + $high = (int) bcsub($high, 4294967296); + } else { + $high = (int) $high; + } + if (bccomp($low, 2147483647) > 0) { + $low = (int) bcsub($low, 4294967296); + } else { + $low = (int) $low; + } + + if ($isNeg) { + $high = ~$high; + $low = ~$low; + $low++; + if (!$low) { + $high = (int)($high + 1); + } + } + + if ($trim) { + $high = 0; + } + } + + public static function checkString(&$var, $check_utf8) + { + if (is_array($var) || is_object($var)) { + throw new \InvalidArgumentException("Expect string."); + } + if (!is_string($var)) { + $var = strval($var); + } + if ($check_utf8 && !preg_match('//u', $var)) { + throw new \Exception("Expect utf-8 encoding."); + } + } + + public static function checkEnum(&$var) + { + static::checkInt32($var); + } + + public static function checkInt32(&$var) + { + if (is_numeric($var)) { + $var = intval($var); + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkUint32(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE === 8) { + $var = intval($var); + $var |= ((-(($var >> 31) & 0x1)) & ~0xFFFFFFFF); + } else { + if (bccomp($var, 0x7FFFFFFF) > 0) { + $var = bcsub($var, "4294967296"); + } + $var = (int) $var; + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkInt64(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE == 8) { + $var = intval($var); + } else { + if (is_float($var) || + is_integer($var) || + (is_string($var) && + bccomp($var, "9223372036854774784") < 0)) { + $var = number_format($var, 0, ".", ""); + } + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkUint64(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE == 8) { + $var = intval($var); + } else { + $var = number_format($var, 0, ".", ""); + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkFloat(&$var) + { + if (is_float($var) || is_numeric($var)) { + $var = unpack("f", pack("f", $var))[1]; + } else { + throw new \Exception("Expect float."); + } + } + + public static function checkDouble(&$var) + { + if (is_float($var) || is_numeric($var)) { + $var = floatval($var); + } else { + throw new \Exception("Expect float."); + } + } + + public static function checkBool(&$var) + { + if (is_array($var) || is_object($var)) { + throw new \Exception("Expect boolean."); + } + $var = boolval($var); + } + + public static function checkMessage(&$var, $klass, $newClass = null) + { + if (!$var instanceof $klass && !is_null($var)) { + throw new \Exception("Expect $klass."); + } + } + + public static function checkRepeatedField(&$var, $type, $klass = null) + { + if (!$var instanceof RepeatedField && !is_array($var)) { + throw new \Exception("Expect array."); + } + if (is_array($var)) { + $tmp = new RepeatedField($type, $klass); + foreach ($var as $value) { + $tmp[] = $value; + } + return $tmp; + } else { + if ($var->getType() != $type) { + throw new \Exception( + "Expect repeated field of different type."); + } + if ($var->getType() === GPBType::MESSAGE && + $var->getClass() !== $klass && + $var->getLegacyClass() !== $klass) { + throw new \Exception( + "Expect repeated field of " . $klass . "."); + } + return $var; + } + } + + public static function checkMapField(&$var, $key_type, $value_type, $klass = null) + { + if (!$var instanceof MapField && !is_array($var)) { + throw new \Exception("Expect dict."); + } + if (is_array($var)) { + $tmp = new MapField($key_type, $value_type, $klass); + foreach ($var as $key => $value) { + $tmp[$key] = $value; + } + return $tmp; + } else { + if ($var->getKeyType() != $key_type) { + throw new \Exception("Expect map field of key type."); + } + if ($var->getValueType() != $value_type) { + throw new \Exception("Expect map field of value type."); + } + if ($var->getValueType() === GPBType::MESSAGE && + $var->getValueClass() !== $klass && + $var->getLegacyValueClass() !== $klass) { + throw new \Exception( + "Expect map field of " . $klass . "."); + } + return $var; + } + } + + public static function Int64($value) + { + return new Int64($value); + } + + public static function Uint64($value) + { + return new Uint64($value); + } + + public static function getClassNamePrefix( + $classname, + $file_proto) + { + $option = $file_proto->getOptions(); + $prefix = is_null($option) ? "" : $option->getPhpClassPrefix(); + if ($prefix !== "") { + return $prefix; + } + + $reserved_words = array( + "abstract"=>0, "and"=>0, "array"=>0, "as"=>0, "break"=>0, + "callable"=>0, "case"=>0, "catch"=>0, "class"=>0, "clone"=>0, + "const"=>0, "continue"=>0, "declare"=>0, "default"=>0, "die"=>0, + "do"=>0, "echo"=>0, "else"=>0, "elseif"=>0, "empty"=>0, + "enddeclare"=>0, "endfor"=>0, "endforeach"=>0, "endif"=>0, + "endswitch"=>0, "endwhile"=>0, "eval"=>0, "exit"=>0, "extends"=>0, + "final"=>0, "finally"=>0, "fn"=>0, "for"=>0, "foreach"=>0, + "function"=>0, "global"=>0, "goto"=>0, "if"=>0, "implements"=>0, + "include"=>0, "include_once"=>0, "instanceof"=>0, "insteadof"=>0, + "interface"=>0, "isset"=>0, "list"=>0, "match"=>0, "namespace"=>0, + "new"=>0, "or"=>0, "parent"=>0, "print"=>0, "private"=>0, + "protected"=>0,"public"=>0, "readonly" => 0,"require"=>0, + "require_once"=>0,"return"=>0, "self"=>0, "static"=>0, "switch"=>0, + "throw"=>0,"trait"=>0, "try"=>0,"unset"=>0, "use"=>0, "var"=>0, + "while"=>0,"xor"=>0, "yield"=>0, "int"=>0, "float"=>0, "bool"=>0, + "string"=>0,"true"=>0, "false"=>0, "null"=>0, "void"=>0, + "iterable"=>0 + ); + + if (array_key_exists(strtolower($classname), $reserved_words)) { + if ($file_proto->getPackage() === "google.protobuf") { + return "GPB"; + } else { + return "PB"; + } + } + + return ""; + } + + private static function getPreviouslyUnreservedClassNamePrefix( + $classname, + $file_proto) + { + $previously_unreserved_words = array( + "readonly"=>0 + ); + + if (array_key_exists(strtolower($classname), $previously_unreserved_words)) { + $option = $file_proto->getOptions(); + $prefix = is_null($option) ? "" : $option->getPhpClassPrefix(); + if ($prefix !== "") { + return $prefix; + } + + return ""; + } + + return self::getClassNamePrefix($classname, $file_proto); + } + + public static function getLegacyClassNameWithoutPackage( + $name, + $file_proto) + { + $classname = implode('_', explode('.', $name)); + return static::getClassNamePrefix($classname, $file_proto) . $classname; + } + + public static function getClassNameWithoutPackage( + $name, + $file_proto) + { + $parts = explode('.', $name); + foreach ($parts as $i => $part) { + $parts[$i] = static::getClassNamePrefix($parts[$i], $file_proto) . $parts[$i]; + } + return implode('\\', $parts); + } + + private static function getPreviouslyUnreservedClassNameWithoutPackage( + $name, + $file_proto) + { + $parts = explode('.', $name); + foreach ($parts as $i => $part) { + $parts[$i] = static::getPreviouslyUnreservedClassNamePrefix($parts[$i], $file_proto) . $parts[$i]; + } + return implode('\\', $parts); + } + + public static function getFullClassName( + $proto, + $containing, + $file_proto, + &$message_name_without_package, + &$classname, + &$legacy_classname, + &$fullname, + &$previous_classname) + { + // Full name needs to start with '.'. + $message_name_without_package = $proto->getName(); + if ($containing !== "") { + $message_name_without_package = + $containing . "." . $message_name_without_package; + } + + $package = $file_proto->getPackage(); + if ($package === "") { + $fullname = $message_name_without_package; + } else { + $fullname = $package . "." . $message_name_without_package; + } + + $class_name_without_package = + static::getClassNameWithoutPackage($message_name_without_package, $file_proto); + $legacy_class_name_without_package = + static::getLegacyClassNameWithoutPackage( + $message_name_without_package, $file_proto); + $previous_class_name_without_package = + static::getPreviouslyUnreservedClassNameWithoutPackage( + $message_name_without_package, $file_proto); + + $option = $file_proto->getOptions(); + if (!is_null($option) && $option->hasPhpNamespace()) { + $namespace = $option->getPhpNamespace(); + if ($namespace !== "") { + $classname = $namespace . "\\" . $class_name_without_package; + $legacy_classname = + $namespace . "\\" . $legacy_class_name_without_package; + $previous_classname = + $namespace . "\\" . $previous_class_name_without_package; + return; + } else { + $classname = $class_name_without_package; + $legacy_classname = $legacy_class_name_without_package; + $previous_classname = $previous_class_name_without_package; + return; + } + } + + if ($package === "") { + $classname = $class_name_without_package; + $legacy_classname = $legacy_class_name_without_package; + $previous_classname = $previous_class_name_without_package; + } else { + $parts = array_map('ucwords', explode('.', $package)); + foreach ($parts as $i => $part) { + $parts[$i] = self::getClassNamePrefix($part, $file_proto).$part; + } + $classname = + implode('\\', $parts) . + "\\".self::getClassNamePrefix($class_name_without_package,$file_proto). + $class_name_without_package; + $legacy_classname = + implode('\\', array_map('ucwords', explode('.', $package))). + "\\".$legacy_class_name_without_package; + $previous_classname = + implode('\\', array_map('ucwords', explode('.', $package))). + "\\".self::getPreviouslyUnreservedClassNamePrefix( + $previous_class_name_without_package, $file_proto). + $previous_class_name_without_package; + } + } + + public static function combineInt32ToInt64($high, $low) + { + $isNeg = $high < 0; + if ($isNeg) { + $high = ~$high; + $low = ~$low; + $low++; + if (!$low) { + $high = (int) ($high + 1); + } + } + $result = bcadd(bcmul($high, 4294967296), $low); + if ($low < 0) { + $result = bcadd($result, 4294967296); + } + if ($isNeg) { + $result = bcsub(0, $result); + } + return $result; + } + + public static function parseTimestamp($timestamp) + { + // prevent parsing timestamps containing with the non-existent year "0000" + // DateTime::createFromFormat parses without failing but as a nonsensical date + if (substr($timestamp, 0, 4) === "0000") { + throw new \Exception("Year cannot be zero."); + } + // prevent parsing timestamps ending with a lowercase z + if (substr($timestamp, -1, 1) === "z") { + throw new \Exception("Timezone cannot be a lowercase z."); + } + + $nanoseconds = 0; + $periodIndex = strpos($timestamp, "."); + if ($periodIndex !== false) { + $nanosecondsLength = 0; + // find the next non-numeric character in the timestamp to calculate + // the length of the nanoseconds text + for ($i = $periodIndex + 1, $length = strlen($timestamp); $i < $length; $i++) { + if (!is_numeric($timestamp[$i])) { + $nanosecondsLength = $i - ($periodIndex + 1); + break; + } + } + if ($nanosecondsLength % 3 !== 0) { + throw new \Exception("Nanoseconds must be disible by 3."); + } + if ($nanosecondsLength > 9) { + throw new \Exception("Nanoseconds must be in the range of 0 to 999,999,999 nanoseconds."); + } + if ($nanosecondsLength > 0) { + $nanoseconds = substr($timestamp, $periodIndex + 1, $nanosecondsLength); + $nanoseconds = intval($nanoseconds); + + if ($nanosecondsLength < 9) { + $nanoseconds = $nanoseconds * pow(10, 9 - $nanosecondsLength); + } + + // remove the nanoseconds and preceding period from the timestamp + $date = substr($timestamp, 0, $periodIndex); + $timezone = substr($timestamp, $periodIndex + $nanosecondsLength + 1); + $timestamp = $date.$timezone; + } + } + + $date = \DateTime::createFromFormat(\DateTime::RFC3339, $timestamp, new \DateTimeZone("UTC")); + if ($date === false) { + throw new \Exception("Invalid RFC 3339 timestamp."); + } + + $value = new \Google\Protobuf\Timestamp(); + $seconds = $date->format("U"); + $value->setSeconds($seconds); + $value->setNanos($nanoseconds); + return $value; + } + + public static function formatTimestamp($value) + { + if (bccomp($value->getSeconds(), "253402300800") != -1) { + throw new GPBDecodeException("Duration number too large."); + } + if (bccomp($value->getSeconds(), "-62135596801") != 1) { + throw new GPBDecodeException("Duration number too small."); + } + $nanoseconds = static::getNanosecondsForTimestamp($value->getNanos()); + if (!empty($nanoseconds)) { + $nanoseconds = ".".$nanoseconds; + } + $date = new \DateTime('@'.$value->getSeconds(), new \DateTimeZone("UTC")); + return $date->format("Y-m-d\TH:i:s".$nanoseconds."\Z"); + } + + public static function parseDuration($value) + { + if (strlen($value) < 2 || substr($value, -1) !== "s") { + throw new GPBDecodeException("Missing s after duration string"); + } + $number = substr($value, 0, -1); + if (bccomp($number, "315576000001") != -1) { + throw new GPBDecodeException("Duration number too large."); + } + if (bccomp($number, "-315576000001") != 1) { + throw new GPBDecodeException("Duration number too small."); + } + $pos = strrpos($number, "."); + if ($pos !== false) { + $seconds = substr($number, 0, $pos); + if (bccomp($seconds, 0) < 0) { + $nanos = bcmul("0" . substr($number, $pos), -1000000000); + } else { + $nanos = bcmul("0" . substr($number, $pos), 1000000000); + } + } else { + $seconds = $number; + $nanos = 0; + } + $duration = new Duration(); + $duration->setSeconds($seconds); + $duration->setNanos($nanos); + return $duration; + } + + public static function formatDuration($value) + { + if (bccomp($value->getSeconds(), '315576000001') != -1) { + throw new GPBDecodeException('Duration number too large.'); + } + if (bccomp($value->getSeconds(), '-315576000001') != 1) { + throw new GPBDecodeException('Duration number too small.'); + } + + $nanos = $value->getNanos(); + if ($nanos === 0) { + return (string) $value->getSeconds(); + } + + if ($nanos % 1000000 === 0) { + $digits = 3; + } elseif ($nanos % 1000 === 0) { + $digits = 6; + } else { + $digits = 9; + } + + $nanos = bcdiv($nanos, '1000000000', $digits); + return bcadd($value->getSeconds(), $nanos, $digits); + } + + public static function parseFieldMask($paths_string) + { + $field_mask = new FieldMask(); + if (strlen($paths_string) === 0) { + return $field_mask; + } + $path_strings = explode(",", $paths_string); + $paths = $field_mask->getPaths(); + foreach($path_strings as &$path_string) { + $field_strings = explode(".", $path_string); + foreach($field_strings as &$field_string) { + $field_string = camel2underscore($field_string); + } + $path_string = implode(".", $field_strings); + $paths[] = $path_string; + } + return $field_mask; + } + + public static function formatFieldMask($field_mask) + { + $converted_paths = []; + foreach($field_mask->getPaths() as $path) { + $fields = explode('.', $path); + $converted_path = []; + foreach ($fields as $field) { + $segments = explode('_', $field); + $start = true; + $converted_segments = ""; + foreach($segments as $segment) { + if (!$start) { + $converted = ucfirst($segment); + } else { + $converted = $segment; + $start = false; + } + $converted_segments .= $converted; + } + $converted_path []= $converted_segments; + } + $converted_path = implode(".", $converted_path); + $converted_paths []= $converted_path; + } + return implode(",", $converted_paths); + } + + public static function getNanosecondsForTimestamp($nanoseconds) + { + if ($nanoseconds == 0) { + return ''; + } + if ($nanoseconds % static::NANOS_PER_MILLISECOND == 0) { + return sprintf('%03d', $nanoseconds / static::NANOS_PER_MILLISECOND); + } + if ($nanoseconds % static::NANOS_PER_MICROSECOND == 0) { + return sprintf('%06d', $nanoseconds / static::NANOS_PER_MICROSECOND); + } + return sprintf('%09d', $nanoseconds); + } + + public static function hasSpecialJsonMapping($msg) + { + return is_a($msg, 'Google\Protobuf\Any') || + is_a($msg, "Google\Protobuf\ListValue") || + is_a($msg, "Google\Protobuf\Struct") || + is_a($msg, "Google\Protobuf\Value") || + is_a($msg, "Google\Protobuf\Duration") || + is_a($msg, "Google\Protobuf\Timestamp") || + is_a($msg, "Google\Protobuf\FieldMask") || + static::hasJsonValue($msg); + } + + public static function hasJsonValue($msg) + { + return is_a($msg, "Google\Protobuf\DoubleValue") || + is_a($msg, "Google\Protobuf\FloatValue") || + is_a($msg, "Google\Protobuf\Int64Value") || + is_a($msg, "Google\Protobuf\UInt64Value") || + is_a($msg, "Google\Protobuf\Int32Value") || + is_a($msg, "Google\Protobuf\UInt32Value") || + is_a($msg, "Google\Protobuf\BoolValue") || + is_a($msg, "Google\Protobuf\StringValue") || + is_a($msg, "Google\Protobuf\BytesValue"); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php new file mode 100644 index 0000000..477eadc --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php @@ -0,0 +1,599 @@ +> self::TAG_TYPE_BITS) & 0x1fffffff; + } + + public static function getTagWireType($tag) + { + return $tag & 0x7; + } + + public static function getWireType($type) + { + switch ($type) { + case GPBType::FLOAT: + case GPBType::FIXED32: + case GPBType::SFIXED32: + return self::WIRETYPE_FIXED32; + case GPBType::DOUBLE: + case GPBType::FIXED64: + case GPBType::SFIXED64: + return self::WIRETYPE_FIXED64; + case GPBType::UINT32: + case GPBType::UINT64: + case GPBType::INT32: + case GPBType::INT64: + case GPBType::SINT32: + case GPBType::SINT64: + case GPBType::ENUM: + case GPBType::BOOL: + return self::WIRETYPE_VARINT; + case GPBType::STRING: + case GPBType::BYTES: + case GPBType::MESSAGE: + return self::WIRETYPE_LENGTH_DELIMITED; + case GPBType::GROUP: + user_error("Unsupported type."); + return 0; + default: + user_error("Unsupported type."); + return 0; + } + } + + // ZigZag Transform: Encodes signed integers so that they can be effectively + // used with varint encoding. + // + // varint operates on unsigned integers, encoding smaller numbers into fewer + // bytes. If you try to use it on a signed integer, it will treat this + // number as a very large unsigned integer, which means that even small + // signed numbers like -1 will take the maximum number of bytes (10) to + // encode. zigZagEncode() maps signed integers to unsigned in such a way + // that those with a small absolute value will have smaller encoded values, + // making them appropriate for encoding using varint. + // + // int32 -> uint32 + // ------------------------- + // 0 -> 0 + // -1 -> 1 + // 1 -> 2 + // -2 -> 3 + // ... -> ... + // 2147483647 -> 4294967294 + // -2147483648 -> 4294967295 + // + // >> encode >> + // << decode << + public static function zigZagEncode32($int32) + { + if (PHP_INT_SIZE == 8) { + $trim_int32 = $int32 & 0xFFFFFFFF; + return (($trim_int32 << 1) ^ ($int32 << 32 >> 63)) & 0xFFFFFFFF; + } else { + return ($int32 << 1) ^ ($int32 >> 31); + } + } + + public static function zigZagDecode32($uint32) + { + // Fill high 32 bits. + if (PHP_INT_SIZE === 8) { + $uint32 |= ($uint32 & 0xFFFFFFFF); + } + + $int32 = (($uint32 >> 1) & 0x7FFFFFFF) ^ (-($uint32 & 1)); + + return $int32; + } + + public static function zigZagEncode64($int64) + { + if (PHP_INT_SIZE == 4) { + if (bccomp($int64, 0) >= 0) { + return bcmul($int64, 2); + } else { + return bcsub(bcmul(bcsub(0, $int64), 2), 1); + } + } else { + return ((int)$int64 << 1) ^ ((int)$int64 >> 63); + } + } + + public static function zigZagDecode64($uint64) + { + if (PHP_INT_SIZE == 4) { + if (bcmod($uint64, 2) == 0) { + return bcdiv($uint64, 2, 0); + } else { + return bcsub(0, bcdiv(bcadd($uint64, 1), 2, 0)); + } + } else { + return (($uint64 >> 1) & 0x7FFFFFFFFFFFFFFF) ^ (-($uint64 & 1)); + } + } + + public static function readInt32(&$input, &$value) + { + return $input->readVarint32($value); + } + + public static function readInt64(&$input, &$value) + { + $success = $input->readVarint64($value); + if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $success; + } + + public static function readUint32(&$input, &$value) + { + return self::readInt32($input, $value); + } + + public static function readUint64(&$input, &$value) + { + return self::readInt64($input, $value); + } + + public static function readSint32(&$input, &$value) + { + if (!$input->readVarint32($value)) { + return false; + } + $value = GPBWire::zigZagDecode32($value); + return true; + } + + public static function readSint64(&$input, &$value) + { + if (!$input->readVarint64($value)) { + return false; + } + $value = GPBWire::zigZagDecode64($value); + return true; + } + + public static function readFixed32(&$input, &$value) + { + return $input->readLittleEndian32($value); + } + + public static function readFixed64(&$input, &$value) + { + return $input->readLittleEndian64($value); + } + + public static function readSfixed32(&$input, &$value) + { + if (!self::readFixed32($input, $value)) { + return false; + } + if (PHP_INT_SIZE === 8) { + $value |= (-($value >> 31) << 32); + } + return true; + } + + public static function readSfixed64(&$input, &$value) + { + $success = $input->readLittleEndian64($value); + if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $success; + } + + public static function readFloat(&$input, &$value) + { + $data = null; + if (!$input->readRaw(4, $data)) { + return false; + } + $value = unpack('g', $data)[1]; + return true; + } + + public static function readDouble(&$input, &$value) + { + $data = null; + if (!$input->readRaw(8, $data)) { + return false; + } + $value = unpack('e', $data)[1]; + return true; + } + + public static function readBool(&$input, &$value) + { + if (!$input->readVarint64($value)) { + return false; + } + if ($value == 0) { + $value = false; + } else { + $value = true; + } + return true; + } + + public static function readString(&$input, &$value) + { + $length = 0; + return $input->readVarintSizeAsInt($length) && $input->readRaw($length, $value); + } + + public static function readMessage(&$input, &$message) + { + $length = 0; + if (!$input->readVarintSizeAsInt($length)) { + return false; + } + $old_limit = 0; + $recursion_limit = 0; + $input->incrementRecursionDepthAndPushLimit( + $length, + $old_limit, + $recursion_limit); + if ($recursion_limit < 0 || !$message->parseFromStream($input)) { + return false; + } + return $input->decrementRecursionDepthAndPopLimit($old_limit); + } + + public static function writeTag(&$output, $tag) + { + return $output->writeTag($tag); + } + + public static function writeInt32(&$output, $value) + { + return $output->writeVarint32($value, false); + } + + public static function writeInt64(&$output, $value) + { + return $output->writeVarint64($value); + } + + public static function writeUint32(&$output, $value) + { + return $output->writeVarint32($value, true); + } + + public static function writeUint64(&$output, $value) + { + return $output->writeVarint64($value); + } + + public static function writeSint32(&$output, $value) + { + $value = GPBWire::zigZagEncode32($value); + return $output->writeVarint32($value, true); + } + + public static function writeSint64(&$output, $value) + { + $value = GPBWire::zigZagEncode64($value); + return $output->writeVarint64($value); + } + + public static function writeFixed32(&$output, $value) + { + return $output->writeLittleEndian32($value); + } + + public static function writeFixed64(&$output, $value) + { + return $output->writeLittleEndian64($value); + } + + public static function writeSfixed32(&$output, $value) + { + return $output->writeLittleEndian32($value); + } + + public static function writeSfixed64(&$output, $value) + { + return $output->writeLittleEndian64($value); + } + + public static function writeBool(&$output, $value) + { + if ($value) { + return $output->writeVarint32(1, true); + } else { + return $output->writeVarint32(0, true); + } + } + + public static function writeFloat(&$output, $value) + { + $data = pack("g", $value); + return $output->writeRaw($data, 4); + } + + public static function writeDouble(&$output, $value) + { + $data = pack("e", $value); + return $output->writeRaw($data, 8); + } + + public static function writeString(&$output, $value) + { + return self::writeBytes($output, $value); + } + + public static function writeBytes(&$output, $value) + { + $size = strlen($value); + if (!$output->writeVarint32($size, true)) { + return false; + } + return $output->writeRaw($value, $size); + } + + public static function writeMessage(&$output, $value) + { + $size = $value->byteSize(); + if (!$output->writeVarint32($size, true)) { + return false; + } + return $value->serializeToStream($output); + } + + public static function makeTag($number, $type) + { + return ($number << 3) | self::getWireType($type); + } + + public static function tagSize($field) + { + $tag = self::makeTag($field->getNumber(), $field->getType()); + return self::varint32Size($tag); + } + + public static function varint32Size($value, $sign_extended = false) + { + if ($value < 0) { + if ($sign_extended) { + return 10; + } else { + return 5; + } + } + if ($value < (1 << 7)) { + return 1; + } + if ($value < (1 << 14)) { + return 2; + } + if ($value < (1 << 21)) { + return 3; + } + if ($value < (1 << 28)) { + return 4; + } + return 5; + } + + public static function sint32Size($value) + { + $value = self::zigZagEncode32($value); + return self::varint32Size($value); + } + + public static function sint64Size($value) + { + $value = self::zigZagEncode64($value); + return self::varint64Size($value); + } + + public static function varint64Size($value) + { + if (PHP_INT_SIZE == 4) { + if (bccomp($value, 0) < 0 || + bccomp($value, "9223372036854775807") > 0) { + return 10; + } + if (bccomp($value, 1 << 7) < 0) { + return 1; + } + if (bccomp($value, 1 << 14) < 0) { + return 2; + } + if (bccomp($value, 1 << 21) < 0) { + return 3; + } + if (bccomp($value, 1 << 28) < 0) { + return 4; + } + if (bccomp($value, '34359738368') < 0) { + return 5; + } + if (bccomp($value, '4398046511104') < 0) { + return 6; + } + if (bccomp($value, '562949953421312') < 0) { + return 7; + } + if (bccomp($value, '72057594037927936') < 0) { + return 8; + } + return 9; + } else { + if ($value < 0) { + return 10; + } + if ($value < (1 << 7)) { + return 1; + } + if ($value < (1 << 14)) { + return 2; + } + if ($value < (1 << 21)) { + return 3; + } + if ($value < (1 << 28)) { + return 4; + } + if ($value < (1 << 35)) { + return 5; + } + if ($value < (1 << 42)) { + return 6; + } + if ($value < (1 << 49)) { + return 7; + } + if ($value < (1 << 56)) { + return 8; + } + return 9; + } + } + + public static function serializeFieldToStream( + $value, + $field, + $need_tag, + &$output) + { + if ($need_tag) { + if (!GPBWire::writeTag( + $output, + self::makeTag( + $field->getNumber(), + $field->getType()))) { + return false; + } + } + switch ($field->getType()) { + case GPBType::DOUBLE: + if (!GPBWire::writeDouble($output, $value)) { + return false; + } + break; + case GPBType::FLOAT: + if (!GPBWire::writeFloat($output, $value)) { + return false; + } + break; + case GPBType::INT64: + if (!GPBWire::writeInt64($output, $value)) { + return false; + } + break; + case GPBType::UINT64: + if (!GPBWire::writeUint64($output, $value)) { + return false; + } + break; + case GPBType::INT32: + if (!GPBWire::writeInt32($output, $value)) { + return false; + } + break; + case GPBType::FIXED32: + if (!GPBWire::writeFixed32($output, $value)) { + return false; + } + break; + case GPBType::FIXED64: + if (!GPBWire::writeFixed64($output, $value)) { + return false; + } + break; + case GPBType::BOOL: + if (!GPBWire::writeBool($output, $value)) { + return false; + } + break; + case GPBType::STRING: + if (!GPBWire::writeString($output, $value)) { + return false; + } + break; + // case GPBType::GROUP: + // echo "GROUP\xA"; + // trigger_error("Not implemented.", E_ERROR); + // break; + case GPBType::MESSAGE: + if (!GPBWire::writeMessage($output, $value)) { + return false; + } + break; + case GPBType::BYTES: + if (!GPBWire::writeBytes($output, $value)) { + return false; + } + break; + case GPBType::UINT32: + if (PHP_INT_SIZE === 8 && $value < 0) { + $value += 4294967296; + } + if (!GPBWire::writeUint32($output, $value)) { + return false; + } + break; + case GPBType::ENUM: + if (!GPBWire::writeInt32($output, $value)) { + return false; + } + break; + case GPBType::SFIXED32: + if (!GPBWire::writeSfixed32($output, $value)) { + return false; + } + break; + case GPBType::SFIXED64: + if (!GPBWire::writeSfixed64($output, $value)) { + return false; + } + break; + case GPBType::SINT32: + if (!GPBWire::writeSint32($output, $value)) { + return false; + } + break; + case GPBType::SINT64: + if (!GPBWire::writeSint64($output, $value)) { + return false; + } + break; + default: + user_error("Unsupported type."); + return false; + } + + return true; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php new file mode 100644 index 0000000..7b6e9b0 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php @@ -0,0 +1,20 @@ +google.protobuf.GeneratedCodeInfo + */ +class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + private $annotation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[] $annotation + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + * @return RepeatedField<\Google\Protobuf\Internal\GeneratedCodeInfo\Annotation> + */ + public function getAnnotation() + { + return $this->annotation; + } + + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + * @param \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[] $var + * @return $this + */ + public function setAnnotation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class); + $this->annotation = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php new file mode 100644 index 0000000..a7fdb42 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php @@ -0,0 +1,253 @@ +google.protobuf.GeneratedCodeInfo.Annotation + */ +class Annotation extends \Google\Protobuf\Internal\Message +{ + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + */ + private $path; + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + */ + protected $source_file = null; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + */ + protected $begin = null; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + */ + protected $end = null; + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + protected $semantic = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[] $path + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * @type string $source_file + * Identifies the filesystem path to the original source .proto. + * @type int $begin + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * @type int $end + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * @type int $semantic + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @return RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @param int[] $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->path = $arr; + + return $this; + } + + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + * @return string + */ + public function getSourceFile() + { + return isset($this->source_file) ? $this->source_file : ''; + } + + public function hasSourceFile() + { + return isset($this->source_file); + } + + public function clearSourceFile() + { + unset($this->source_file); + } + + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + * @param string $var + * @return $this + */ + public function setSourceFile($var) + { + GPBUtil::checkString($var, True); + $this->source_file = $var; + + return $this; + } + + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + * @return int + */ + public function getBegin() + { + return isset($this->begin) ? $this->begin : 0; + } + + public function hasBegin() + { + return isset($this->begin); + } + + public function clearBegin() + { + unset($this->begin); + } + + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + * @param int $var + * @return $this + */ + public function setBegin($var) + { + GPBUtil::checkInt32($var); + $this->begin = $var; + + return $this; + } + + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + * @return int + */ + public function getSemantic() + { + return isset($this->semantic) ? $this->semantic : 0; + } + + public function hasSemantic() + { + return isset($this->semantic); + } + + public function clearSemantic() + { + unset($this->semantic); + } + + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + * @param int $var + * @return $this + */ + public function setSemantic($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation\Semantic::class); + $this->semantic = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php new file mode 100644 index 0000000..7d39076 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php @@ -0,0 +1,63 @@ +google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +class Semantic +{ + /** + * There is no effect or the effect is indescribable. + * + * Generated from protobuf enum NONE = 0; + */ + const NONE = 0; + /** + * The element is set or otherwise mutated. + * + * Generated from protobuf enum SET = 1; + */ + const SET = 1; + /** + * An alias to the element is returned. + * + * Generated from protobuf enum ALIAS = 2; + */ + const ALIAS = 2; + + private static $valueToName = [ + self::NONE => 'NONE', + self::SET => 'SET', + self::ALIAS => 'ALIAS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php new file mode 100644 index 0000000..7624e52 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php @@ -0,0 +1,18 @@ +getPublicDescriptor(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php new file mode 100644 index 0000000..03f06d5 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php @@ -0,0 +1,20 @@ +public_desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php new file mode 100644 index 0000000..cc88846 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php @@ -0,0 +1,48 @@ +getFieldByNumber(2); + if ($value_field->getType() == GPBType::MESSAGE) { + $klass = $value_field->getMessageType()->getClass(); + $value = new $klass; + $this->setValue($value); + } + } + + public function setKey($key) { + $this->key = $key; + } + + public function getKey() { + return $this->key; + } + + public function setValue($value) { + $this->value = $value; + } + + public function getValue() { + return $this->value; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php new file mode 100644 index 0000000..b429ad8 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php @@ -0,0 +1,275 @@ +container = []; + $this->key_type = $key_type; + $this->value_type = $value_type; + $this->klass = $klass; + + if ($this->value_type == GPBType::MESSAGE) { + $pool = DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + if ($desc == NULL) { + new $klass; // No msg class instance has been created before. + $desc = $pool->getDescriptorByClassName($klass); + } + $this->klass = $desc->getClass(); + $this->legacy_klass = $desc->getLegacyClass(); + } + } + + /** + * @ignore + */ + public function getKeyType() + { + return $this->key_type; + } + + /** + * @ignore + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * @ignore + */ + public function getValueClass() + { + return $this->klass; + } + + /** + * @ignore + */ + public function getLegacyValueClass() + { + return $this->legacy_klass; + } + + /** + * Return the element at the given key. + * + * This will also be called for: $ele = $arr[$key] + * + * @param int|string $key The key of the element to be fetched. + * @return object The stored element at given key. + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function offsetGet($key) + { + return $this->container[$key]; + } + + /** + * Assign the element at the given key. + * + * This will also be called for: $arr[$key] = $value + * + * @param int|string $key The key of the element to be fetched. + * @param object $value The element to be assigned. + * @return void + * @throws \ErrorException Invalid type for key. + * @throws \ErrorException Invalid type for value. + * @throws \ErrorException Non-existing key. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) + { + $this->checkKey($this->key_type, $key); + + switch ($this->value_type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + case GPBType::ENUM: + GPBUtil::checkInt32($value); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($value); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($value); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($value); + break; + case GPBType::FLOAT: + GPBUtil::checkFloat($value); + break; + case GPBType::DOUBLE: + GPBUtil::checkDouble($value); + break; + case GPBType::BOOL: + GPBUtil::checkBool($value); + break; + case GPBType::STRING: + GPBUtil::checkString($value, true); + break; + case GPBType::MESSAGE: + if (is_null($value)) { + trigger_error("Map element cannot be null.", E_USER_ERROR); + } + GPBUtil::checkMessage($value, $this->klass); + break; + default: + break; + } + + $this->container[$key] = $value; + } + + /** + * Remove the element at the given key. + * + * This will also be called for: unset($arr) + * + * @param int|string $key The key of the element to be removed. + * @return void + * @throws \ErrorException Invalid type for key. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetUnset($key) + { + $this->checkKey($this->key_type, $key); + unset($this->container[$key]); + } + + /** + * Check the existence of the element at the given key. + * + * This will also be called for: isset($arr) + * + * @param int|string $key The key of the element to be removed. + * @return bool True if the element at the given key exists. + * @throws \ErrorException Invalid type for key. + */ + public function offsetExists($key): bool + { + $this->checkKey($this->key_type, $key); + return isset($this->container[$key]); + } + + /** + * @ignore + */ + public function getIterator(): Traversable + { + return new MapFieldIter($this->container, $this->key_type); + } + + /** + * Return the number of stored elements. + * + * This will also be called for: count($arr) + * + * @return integer The number of stored elements. + */ + public function count(): int + { + return count($this->container); + } + + /** + * @ignore + */ + private function checkKey($key_type, &$key) + { + switch ($key_type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + GPBUtil::checkInt32($key); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($key); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($key); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($key); + break; + case GPBType::BOOL: + GPBUtil::checkBool($key); + break; + case GPBType::STRING: + GPBUtil::checkString($key, true); + break; + default: + trigger_error( + "Given type cannot be map key.", + E_USER_ERROR); + break; + } + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php new file mode 100644 index 0000000..5b07735 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php @@ -0,0 +1,123 @@ +container = $container; + $this->key_type = $key_type; + } + + /** + * Reset the status of the iterator + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function rewind() + { + reset($this->container); + } + + /** + * Return the element at the current position. + * + * @return object The element at the current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function current() + { + return current($this->container); + } + + /** + * Return the current key. + * + * @return object The current key. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function key() + { + $key = key($this->container); + switch ($this->key_type) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + if (PHP_INT_SIZE === 8) { + return $key; + } + // Intentionally fall through + case GPBType::STRING: + // PHP associative array stores int string as int for key. + return strval($key); + case GPBType::BOOL: + // PHP associative array stores bool as integer for key. + return boolval($key); + default: + return $key; + } + } + + /** + * Move to the next position. + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function next() + { + next($this->container); + } + + /** + * Check whether there are more elements to iterate. + * + * @return bool True if there are more elements to iterate. + */ + public function valid(): bool + { + return key($this->container) !== null; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php new file mode 100644 index 0000000..81419d8 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php @@ -0,0 +1,2108 @@ +initWithDescriptor($data); + } else { + $this->initWithGeneratedPool(); + if (is_array($data)) { + $this->mergeFromArray($data); + } else if (!empty($data)) { + throw new \InvalidArgumentException( + 'Message constructor must be an array or null.' + ); + } + } + } + + /** + * @ignore + */ + private function initWithGeneratedPool() + { + $pool = DescriptorPool::getGeneratedPool(); + $this->desc = $pool->getDescriptorByClassName(get_class($this)); + if (is_null($this->desc)) { + throw new \InvalidArgumentException( + get_class($this) ." is not found in descriptor pool. " . + 'Only generated classes may derive from Message.'); + } + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + if ($field->isMap()) { + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + switch ($value_field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getMessageType()->getClass()); + $this->$setter($map_field); + break; + case GPBType::ENUM: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getEnumType()->getClass()); + $this->$setter($map_field); + break; + default: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType()); + $this->$setter($map_field); + break; + } + } else if ($field->isRepeated()) { + switch ($field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getMessageType()->getClass()); + $this->$setter($repeated_field); + break; + case GPBType::ENUM: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getEnumType()->getClass()); + $this->$setter($repeated_field); + break; + default: + $repeated_field = new RepeatedField($field->getType()); + $this->$setter($repeated_field); + break; + } + } else if ($field->getOneofIndex() !== -1) { + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $this->$oneof_name = new OneofField($oneof); + } else if (!$field->isRequired() && !$field->isRepeated() && + PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } + } + } + } + + /** + * @ignore + */ + private function initWithDescriptor(Descriptor $desc) + { + $this->desc = $desc; + foreach ($desc->getField() as $field) { + $setter = $field->getSetter(); + $defaultValue = $this->defaultValue($field); + $this->$setter($defaultValue); + } + } + + protected function readWrapperValue($member) + { + $field = $this->desc->getFieldByName($member); + $oneof_index = $field->getOneofIndex(); + if ($oneof_index === -1) { + $wrapper = $this->$member; + } else { + $wrapper = $this->readOneof($field->getNumber()); + } + + if (is_null($wrapper)) { + return NULL; + } else { + return $wrapper->getValue(); + } + } + + protected function writeWrapperValue($member, $value) + { + $field = $this->desc->getFieldByName($member); + $wrapped_value = $value; + if (!is_null($value)) { + $desc = $field->getMessageType(); + $klass = $desc->getClass(); + $wrapped_value = new $klass; + $wrapped_value->setValue($value); + } + + $oneof_index = $field->getOneofIndex(); + if ($oneof_index === -1) { + $this->$member = $wrapped_value; + } else { + $this->writeOneof($field->getNumber(), $wrapped_value); + } + } + + protected function readOneof($number) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $oneof_field = $this->$oneof_name; + if ($number === $oneof_field->getNumber()) { + return $oneof_field->getValue(); + } else { + return $this->defaultValue($field); + } + } + + protected function hasOneof($number) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $oneof_field = $this->$oneof_name; + return $number === $oneof_field->getNumber(); + } + + protected function writeOneof($number, $value) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + if ($value === null) { + $this->$oneof_name = new OneofField($oneof); + } else { + $oneof_field = $this->$oneof_name; + $oneof_field->setValue($value); + $oneof_field->setFieldName($field->getName()); + $oneof_field->setNumber($number); + } + } + + protected function whichOneof($oneof_name) + { + $oneof_field = $this->$oneof_name; + $number = $oneof_field->getNumber(); + if ($number == 0) { + return ""; + } + $field = $this->desc->getFieldByNumber($number); + return $field->getName(); + } + + /** + * @ignore + */ + private function defaultValue($field) + { + $value = null; + + switch ($field->getType()) { + case GPBType::DOUBLE: + case GPBType::FLOAT: + return 0.0; + case GPBType::UINT32: + case GPBType::INT32: + case GPBType::FIXED32: + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::ENUM: + return 0; + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + if (PHP_INT_SIZE === 4) { + return '0'; + } else { + return 0; + } + case GPBType::BOOL: + return false; + case GPBType::STRING: + case GPBType::BYTES: + return ""; + case GPBType::GROUP: + case GPBType::MESSAGE: + return null; + default: + user_error("Unsupported type."); + return false; + } + } + + /** + * @ignore + */ + private function skipField($input, $tag) + { + $number = GPBWire::getTagFieldNumber($tag); + if ($number === 0) { + throw new GPBDecodeException("Illegal field number zero."); + } + + $start = $input->current(); + switch (GPBWire::getTagWireType($tag)) { + case GPBWireType::VARINT: + $uint64 = 0; + if (!$input->readVarint64($uint64)) { + throw new GPBDecodeException( + "Unexpected EOF inside varint."); + } + break; + case GPBWireType::FIXED64: + $uint64 = 0; + if (!$input->readLittleEndian64($uint64)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed64."); + } + break; + case GPBWireType::FIXED32: + $uint32 = 0; + if (!$input->readLittleEndian32($uint32)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed32."); + } + break; + case GPBWireType::LENGTH_DELIMITED: + $length = 0; + if (!$input->readVarint32($length)) { + throw new GPBDecodeException( + "Unexpected EOF inside length."); + } + $data = NULL; + if (!$input->readRaw($length, $data)) { + throw new GPBDecodeException( + "Unexpected EOF inside length delimited data."); + } + break; + case GPBWireType::START_GROUP: + case GPBWireType::END_GROUP: + throw new GPBDecodeException("Unexpected wire type."); + default: + throw new GPBDecodeException("Unexpected wire type."); + } + $end = $input->current(); + + $bytes = str_repeat(chr(0), CodedOutputStream::MAX_VARINT64_BYTES); + $size = CodedOutputStream::writeVarintToArray($tag, $bytes, true); + $this->unknown .= substr($bytes, 0, $size) . $input->substr($start, $end); + } + + /** + * @ignore + */ + private static function parseFieldFromStreamNoTag($input, $field, &$value) + { + switch ($field->getType()) { + case GPBType::DOUBLE: + if (!GPBWire::readDouble($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside double field."); + } + break; + case GPBType::FLOAT: + if (!GPBWire::readFloat($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside float field."); + } + break; + case GPBType::INT64: + if (!GPBWire::readInt64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside int64 field."); + } + break; + case GPBType::UINT64: + if (!GPBWire::readUint64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside uint64 field."); + } + break; + case GPBType::INT32: + if (!GPBWire::readInt32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside int32 field."); + } + break; + case GPBType::FIXED64: + if (!GPBWire::readFixed64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed64 field."); + } + break; + case GPBType::FIXED32: + if (!GPBWire::readFixed32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed32 field."); + } + break; + case GPBType::BOOL: + if (!GPBWire::readBool($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside bool field."); + } + break; + case GPBType::STRING: + // We don't check UTF-8 here; that will be validated by the + // setter later. + if (!GPBWire::readString($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside string field."); + } + break; + case GPBType::GROUP: + trigger_error("Not implemented.", E_USER_ERROR); + break; + case GPBType::MESSAGE: + if ($field->isMap()) { + $value = new MapEntry($field->getMessageType()); + } else { + $klass = $field->getMessageType()->getClass(); + $value = new $klass; + } + if (!GPBWire::readMessage($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside message."); + } + break; + case GPBType::BYTES: + if (!GPBWire::readString($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside bytes field."); + } + break; + case GPBType::UINT32: + if (!GPBWire::readUint32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside uint32 field."); + } + break; + case GPBType::ENUM: + // TODO: Check unknown enum value. + if (!GPBWire::readInt32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside enum field."); + } + break; + case GPBType::SFIXED32: + if (!GPBWire::readSfixed32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sfixed32 field."); + } + break; + case GPBType::SFIXED64: + if (!GPBWire::readSfixed64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sfixed64 field."); + } + break; + case GPBType::SINT32: + if (!GPBWire::readSint32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sint32 field."); + } + break; + case GPBType::SINT64: + if (!GPBWire::readSint64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sint64 field."); + } + break; + default: + user_error("Unsupported type."); + return false; + } + return true; + } + + /** + * @ignore + */ + private function parseFieldFromStream($tag, $input, $field) + { + $value = null; + + if (is_null($field)) { + $value_format = GPBWire::UNKNOWN; + } elseif (GPBWire::getTagWireType($tag) === + GPBWire::getWireType($field->getType())) { + $value_format = GPBWire::NORMAL_FORMAT; + } elseif ($field->isPackable() && + GPBWire::getTagWireType($tag) === + GPBWire::WIRETYPE_LENGTH_DELIMITED) { + $value_format = GPBWire::PACKED_FORMAT; + } else { + // the wire type doesn't match. Put it in our unknown field set. + $value_format = GPBWire::UNKNOWN; + } + + if ($value_format === GPBWire::UNKNOWN) { + $this->skipField($input, $tag); + return; + } elseif ($value_format === GPBWire::NORMAL_FORMAT) { + self::parseFieldFromStreamNoTag($input, $field, $value); + } elseif ($value_format === GPBWire::PACKED_FORMAT) { + $length = 0; + if (!GPBWire::readInt32($input, $length)) { + throw new GPBDecodeException( + "Unexpected EOF inside packed length."); + } + $limit = $input->pushLimit($length); + $getter = $field->getGetter(); + while ($input->bytesUntilLimit() > 0) { + self::parseFieldFromStreamNoTag($input, $field, $value); + $this->appendHelper($field, $value); + } + $input->popLimit($limit); + return; + } else { + return; + } + + if ($field->isMap()) { + $this->kvUpdateHelper($field, $value->getKey(), $value->getValue()); + } else if ($field->isRepeated()) { + $this->appendHelper($field, $value); + } else { + $setter = $field->getSetter(); + $this->$setter($value); + } + } + + /** + * Clear all containing fields. + * @return null + */ + public function clear() + { + $this->unknown = ""; + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + if ($field->isMap()) { + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + switch ($value_field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getMessageType()->getClass()); + $this->$setter($map_field); + break; + case GPBType::ENUM: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getEnumType()->getClass()); + $this->$setter($map_field); + break; + default: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType()); + $this->$setter($map_field); + break; + } + } else if ($field->isRepeated()) { + switch ($field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getMessageType()->getClass()); + $this->$setter($repeated_field); + break; + case GPBType::ENUM: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getEnumType()->getClass()); + $this->$setter($repeated_field); + break; + default: + $repeated_field = new RepeatedField($field->getType()); + $this->$setter($repeated_field); + break; + } + } else if ($field->getOneofIndex() !== -1) { + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $this->$oneof_name = new OneofField($oneof); + } else if (!$field->isRequired() && !$field->isRepeated()) { + switch ($field->getType()) { + case GPBType::DOUBLE : + case GPBType::FLOAT : + $this->$setter(0.0); + break; + case GPBType::INT32 : + case GPBType::FIXED32 : + case GPBType::UINT32 : + case GPBType::SFIXED32 : + case GPBType::SINT32 : + case GPBType::ENUM : + $this->$setter(0); + break; + case GPBType::BOOL : + $this->$setter(false); + break; + case GPBType::STRING : + case GPBType::BYTES : + $this->$setter(""); + break; + case GPBType::GROUP : + case GPBType::MESSAGE : + $null = null; + $this->$setter($null); + break; + } + if (PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } + } else { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter(0); + } + } + } + } + } + + /** + * Clear all unknown fields previously parsed. + * @return null + */ + public function discardUnknownFields() + { + $this->unknown = ""; + foreach ($this->desc->getField() as $field) { + if ($field->getType() != GPBType::MESSAGE) { + continue; + } + if ($field->isMap()) { + $value_field = $field->getMessageType()->getFieldByNumber(2); + if ($value_field->getType() != GPBType::MESSAGE) { + continue; + } + $getter = $field->getGetter(); + $map = $this->$getter(); + foreach ($map as $key => $value) { + $value->discardUnknownFields(); + } + } else if ($field->isRepeated()) { + $getter = $field->getGetter(); + $arr = $this->$getter(); + foreach ($arr as $sub) { + $sub->discardUnknownFields(); + } + } else if (!$field->isRequired() && !$field->isRepeated()) { + $getter = $field->getGetter(); + $sub = $this->$getter(); + if (!is_null($sub)) { + $sub->discardUnknownFields(); + } + } + } + } + + /** + * Merges the contents of the specified message into current message. + * + * This method merges the contents of the specified message into the + * current message. Singular fields that are set in the specified message + * overwrite the corresponding fields in the current message. Repeated + * fields are appended. Map fields key-value pairs are overwritten. + * Singular/Oneof sub-messages are recursively merged. All overwritten + * sub-messages are deep-copied. + * + * @param object $msg Protobuf message to be merged from. + * @return null + */ + public function mergeFrom($msg) + { + if (get_class($this) !== get_class($msg)) { + user_error("Cannot merge messages with different class."); + return; + } + + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + $getter = $field->getGetter(); + if ($field->isMap()) { + if (count($msg->$getter()) != 0) { + $value_field = $field->getMessageType()->getFieldByNumber(2); + foreach ($msg->$getter() as $key => $value) { + if ($value_field->getType() == GPBType::MESSAGE) { + $klass = $value_field->getMessageType()->getClass(); + $copy = new $klass; + $copy->mergeFrom($value); + + $this->kvUpdateHelper($field, $key, $copy); + } else { + $this->kvUpdateHelper($field, $key, $value); + } + } + } + } else if ($field->isRepeated()) { + if (count($msg->$getter()) != 0) { + foreach ($msg->$getter() as $tmp) { + if ($field->getType() == GPBType::MESSAGE) { + $klass = $field->getMessageType()->getClass(); + $copy = new $klass; + $copy->mergeFrom($tmp); + $this->appendHelper($field, $copy); + } else { + $this->appendHelper($field, $tmp); + } + } + } + } else if (!$field->isRequired() && !$field->isRepeated()) { + if($msg->$getter() !== $this->defaultValue($field)) { + $tmp = $msg->$getter(); + if ($field->getType() == GPBType::MESSAGE) { + if (is_null($this->$getter())) { + $klass = $field->getMessageType()->getClass(); + $new_msg = new $klass; + $this->$setter($new_msg); + } + $this->$getter()->mergeFrom($tmp); + } else { + $this->$setter($tmp); + } + } + } + } + } + + /** + * Parses a protocol buffer contained in a string. + * + * This function takes a string in the (non-human-readable) binary wire + * format, matching the encoding output by serializeToString(). + * See mergeFrom() for merging behavior, if the field is already set in the + * specified message. + * + * @param string $data Binary protobuf data. + * @return null + * @throws \Exception Invalid data. + */ + public function mergeFromString($data) + { + $input = new CodedInputStream($data); + $this->parseFromStream($input); + } + + /** + * Parses a json string to protobuf message. + * + * This function takes a string in the json wire format, matching the + * encoding output by serializeToJsonString(). + * See mergeFrom() for merging behavior, if the field is already set in the + * specified message. + * + * @param string $data Json protobuf data. + * @param bool $ignore_unknown + * @return null + * @throws \Exception Invalid data. + */ + public function mergeFromJsonString($data, $ignore_unknown = false) + { + $input = new RawInputStream($data); + $this->parseFromJsonStream($input, $ignore_unknown); + } + + /** + * @ignore + */ + public function parseFromStream($input) + { + while (true) { + $tag = $input->readTag(); + // End of input. This is a valid place to end, so return true. + if ($tag === 0) { + return true; + } + + $number = GPBWire::getTagFieldNumber($tag); + $field = $this->desc->getFieldByNumber($number); + + $this->parseFieldFromStream($tag, $input, $field); + } + } + + private function convertJsonValueToProtoValue( + $value, + $field, + $ignore_unknown, + $is_map_key = false) + { + switch ($field->getType()) { + case GPBType::MESSAGE: + $klass = $field->getMessageType()->getClass(); + $submsg = new $klass; + + if (is_a($submsg, "Google\Protobuf\Duration")) { + if (is_null($value)) { + return $this->defaultValue($field); + } else if (!is_string($value)) { + throw new GPBDecodeException("Expect string."); + } + return GPBUtil::parseDuration($value); + } else if ($field->isTimestamp()) { + if (is_null($value)) { + return $this->defaultValue($field); + } else if (!is_string($value)) { + throw new GPBDecodeException("Expect string."); + } + try { + $timestamp = GPBUtil::parseTimestamp($value); + } catch (\Exception $e) { + throw new GPBDecodeException( + "Invalid RFC 3339 timestamp: ".$e->getMessage()); + } + + $submsg->setSeconds($timestamp->getSeconds()); + $submsg->setNanos($timestamp->getNanos()); + } else if (is_a($submsg, "Google\Protobuf\FieldMask")) { + if (is_null($value)) { + return $this->defaultValue($field); + } + try { + return GPBUtil::parseFieldMask($value); + } catch (\Exception $e) { + throw new GPBDecodeException( + "Invalid FieldMask: ".$e->getMessage()); + } + } else { + if (is_null($value) && + !is_a($submsg, "Google\Protobuf\Value")) { + return $this->defaultValue($field); + } + if (GPBUtil::hasSpecialJsonMapping($submsg)) { + } elseif (!is_object($value) && !is_array($value)) { + throw new GPBDecodeException("Expect message."); + } + $submsg->mergeFromJsonArray($value, $ignore_unknown); + } + return $submsg; + case GPBType::ENUM: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (is_integer($value)) { + return $value; + } + $enum_value = $field->getEnumType()->getValueByName($value); + if (!is_null($enum_value)) { + return $enum_value->getNumber(); + } else if ($ignore_unknown) { + return $this->defaultValue($field); + } else { + throw new GPBDecodeException( + "Enum field only accepts integer or enum value name"); + } + case GPBType::STRING: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (is_numeric($value)) { + return strval($value); + } + if (!is_string($value)) { + throw new GPBDecodeException( + "String field only accepts string value"); + } + return $value; + case GPBType::BYTES: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_string($value)) { + throw new GPBDecodeException( + "Byte field only accepts string value"); + } + $proto_value = base64_decode($value, true); + if ($proto_value === false) { + throw new GPBDecodeException("Invalid base64 characters"); + } + return $proto_value; + case GPBType::BOOL: + if (is_null($value)) { + return $this->defaultValue($field); + } + if ($is_map_key) { + if ($value === "true") { + return true; + } + if ($value === "false") { + return false; + } + throw new GPBDecodeException( + "Bool field only accepts bool value"); + } + if (!is_bool($value)) { + throw new GPBDecodeException( + "Bool field only accepts bool value"); + } + return $value; + case GPBType::FLOAT: + case GPBType::DOUBLE: + if (is_null($value)) { + return $this->defaultValue($field); + } + if ($value === "Infinity") { + return INF; + } + if ($value === "-Infinity") { + return -INF; + } + if ($value === "NaN") { + return NAN; + } + return $value; + case GPBType::INT32: + case GPBType::SINT32: + case GPBType::SFIXED32: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (bccomp($value, "2147483647") > 0) { + throw new GPBDecodeException( + "Int32 too large"); + } + if (bccomp($value, "-2147483648") < 0) { + throw new GPBDecodeException( + "Int32 too small"); + } + return $value; + case GPBType::UINT32: + case GPBType::FIXED32: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for uint32 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (bccomp($value, 4294967295) > 0) { + throw new GPBDecodeException( + "Uint32 too large"); + } + return $value; + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::SFIXED64: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (bccomp($value, "9223372036854775807") > 0) { + throw new GPBDecodeException( + "Int64 too large"); + } + if (bccomp($value, "-9223372036854775808") < 0) { + throw new GPBDecodeException( + "Int64 too small"); + } + return $value; + case GPBType::UINT64: + case GPBType::FIXED64: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (bccomp($value, "18446744073709551615") > 0) { + throw new GPBDecodeException( + "Uint64 too large"); + } + if (bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $value; + default: + return $value; + } + } + + /** + * Populates the message from a user-supplied PHP array. Array keys + * correspond to Message properties and nested message properties. + * + * Example: + * ``` + * $message->mergeFromArray([ + * 'name' => 'This is a message name', + * 'interval' => [ + * 'startTime' => time() - 60, + * 'endTime' => time(), + * ] + * ]); + * ``` + * + * This method will trigger an error if it is passed data that cannot + * be converted to the correct type. For example, a StringValue field + * must receive data that is either a string or a StringValue object. + * + * @param array $array An array containing message properties and values. + * @return null + */ + protected function mergeFromArray(array $array) + { + // Just call the setters for the field names + foreach ($array as $key => $value) { + $field = $this->desc->getFieldByName($key); + if (is_null($field)) { + throw new \UnexpectedValueException( + 'Invalid message property: ' . $key); + } + $setter = $field->getSetter(); + if ($field->isMap()) { + $valueField = $field->getMessageType()->getFieldByName('value'); + if (!is_null($valueField) && $valueField->isWrapperType()) { + self::normalizeArrayElementsToMessageType($value, $valueField->getMessageType()->getClass()); + } + } elseif ($field->isWrapperType()) { + $class = $field->getMessageType()->getClass(); + if ($field->isRepeated()) { + self::normalizeArrayElementsToMessageType($value, $class); + } else { + self::normalizeToMessageType($value, $class); + } + } + $this->$setter($value); + } + } + + /** + * Tries to normalize the elements in $value into a provided protobuf + * wrapper type $class. If $value is any type other than array, we do + * not do any conversion, and instead rely on the existing protobuf + * type checking. If $value is an array, we process each element and + * try to convert it to an instance of $class. + * + * @param mixed $value The array of values to normalize. + * @param string $class The expected wrapper class name + */ + private static function normalizeArrayElementsToMessageType(&$value, $class) + { + if (!is_array($value)) { + // In the case that $value is not an array, we do not want to + // attempt any conversion. Note that this includes the cases + // when $value is a RepeatedField of MapField. In those cases, + // we do not need to convert the elements, as they should + // already be the correct types. + return; + } else { + // Normalize each element in the array. + foreach ($value as $key => &$elementValue) { + self::normalizeToMessageType($elementValue, $class); + } + } + } + + /** + * Tries to normalize $value into a provided protobuf wrapper type $class. + * If $value is any type other than an object, we attempt to construct an + * instance of $class and assign $value to it using the setValue method + * shared by all wrapper types. + * + * This method will raise an error if it receives a type that cannot be + * assigned to the wrapper type via setValue. + * + * @param mixed $value The value to normalize. + * @param string $class The expected wrapper class name + */ + private static function normalizeToMessageType(&$value, $class) + { + if (is_null($value) || is_object($value)) { + // This handles the case that $value is an instance of $class. We + // choose not to do any more strict checking here, relying on the + // existing type checking done by GPBUtil. + return; + } else { + // Try to instantiate $class and set the value + try { + $msg = new $class; + $msg->setValue($value); + $value = $msg; + return; + } catch (\Exception $exception) { + trigger_error( + "Error normalizing value to type '$class': " . $exception->getMessage(), + E_USER_ERROR + ); + } + } + } + + protected function mergeFromJsonArray($array, $ignore_unknown) + { + if (is_a($this, "Google\Protobuf\Any")) { + $this->clear(); + $this->setTypeUrl($array["@type"]); + $msg = $this->unpack(); + if (GPBUtil::hasSpecialJsonMapping($msg)) { + $msg->mergeFromJsonArray($array["value"], $ignore_unknown); + } else { + unset($array["@type"]); + $msg->mergeFromJsonArray($array, $ignore_unknown); + } + $this->setValue($msg->serializeToString()); + return; + } + if (is_a($this, "Google\Protobuf\DoubleValue") || + is_a($this, "Google\Protobuf\FloatValue") || + is_a($this, "Google\Protobuf\Int64Value") || + is_a($this, "Google\Protobuf\UInt64Value") || + is_a($this, "Google\Protobuf\Int32Value") || + is_a($this, "Google\Protobuf\UInt32Value") || + is_a($this, "Google\Protobuf\BoolValue") || + is_a($this, "Google\Protobuf\StringValue")) { + $this->setValue($array); + return; + } + if (is_a($this, "Google\Protobuf\BytesValue")) { + $this->setValue(base64_decode($array)); + return; + } + if (is_a($this, "Google\Protobuf\Duration")) { + $this->mergeFrom(GPBUtil::parseDuration($array)); + return; + } + if (is_a($this, "Google\Protobuf\FieldMask")) { + $this->mergeFrom(GPBUtil::parseFieldMask($array)); + return; + } + if (is_a($this, "Google\Protobuf\Timestamp")) { + $this->mergeFrom(GPBUtil::parseTimestamp($array)); + return; + } + if (is_a($this, "Google\Protobuf\Struct")) { + $fields = $this->getFields(); + foreach($array as $key => $value) { + $v = new Value(); + $v->mergeFromJsonArray($value, $ignore_unknown); + $fields[$key] = $v; + } + return; + } + if (is_a($this, "Google\Protobuf\Value")) { + if (is_bool($array)) { + $this->setBoolValue($array); + } elseif (is_string($array)) { + $this->setStringValue($array); + } elseif (is_null($array)) { + $this->setNullValue(0); + } elseif (is_double($array) || is_integer($array)) { + $this->setNumberValue($array); + } elseif (is_array($array)) { + if (array_values($array) !== $array) { + // Associative array + $struct_value = $this->getStructValue(); + if (is_null($struct_value)) { + $struct_value = new Struct(); + $this->setStructValue($struct_value); + } + foreach ($array as $key => $v) { + $value = new Value(); + $value->mergeFromJsonArray($v, $ignore_unknown); + $values = $struct_value->getFields(); + $values[$key]= $value; + } + } else { + // Array + $list_value = $this->getListValue(); + if (is_null($list_value)) { + $list_value = new ListValue(); + $this->setListValue($list_value); + } + foreach ($array as $v) { + $value = new Value(); + $value->mergeFromJsonArray($v, $ignore_unknown); + $values = $list_value->getValues(); + $values[]= $value; + } + } + } else { + throw new GPBDecodeException("Invalid type for Value."); + } + return; + } + $this->mergeFromArrayJsonImpl($array, $ignore_unknown); + } + + private function mergeFromArrayJsonImpl($array, $ignore_unknown) + { + foreach ($array as $key => $value) { + $field = $this->desc->getFieldByJsonName($key); + if (is_null($field)) { + $field = $this->desc->getFieldByName($key); + if (is_null($field)) { + if ($ignore_unknown) { + continue; + } else { + throw new GPBDecodeException( + $key . ' is unknown.' + ); + } + } + } + if ($field->isMap()) { + if (is_null($value)) { + continue; + } + $key_field = $field->getMessageType()->getFieldByNumber(1); + $value_field = $field->getMessageType()->getFieldByNumber(2); + foreach ($value as $tmp_key => $tmp_value) { + if (is_null($tmp_value)) { + throw new \Exception( + "Map value field element cannot be null."); + } + $proto_key = $this->convertJsonValueToProtoValue( + $tmp_key, + $key_field, + $ignore_unknown, + true); + $proto_value = $this->convertJsonValueToProtoValue( + $tmp_value, + $value_field, + $ignore_unknown); + + // Mapped unknown enum string values should be silently + // ignored if ignore_unknown is set. + if ($value_field->getType() == GPBType::ENUM && + is_string($tmp_value) && + is_null( + $value_field->getEnumType()->getValueByName($tmp_value) + ) && + $ignore_unknown) { + continue; + } + + self::kvUpdateHelper($field, $proto_key, $proto_value); + } + } else if ($field->isRepeated()) { + if (is_null($value)) { + continue; + } + foreach ($value as $tmp) { + if (is_null($tmp)) { + throw new \Exception( + "Repeated field elements cannot be null."); + } + $proto_value = $this->convertJsonValueToProtoValue( + $tmp, + $field, + $ignore_unknown); + + // Repeated unknown enum string values should be silently + // ignored if ignore_unknown is set. + if ($field->getType() == GPBType::ENUM && + is_string($tmp) && + is_null($field->getEnumType()->getValueByName($tmp)) && + $ignore_unknown) { + continue; + } + + self::appendHelper($field, $proto_value); + } + } else { + $setter = $field->getSetter(); + $proto_value = $this->convertJsonValueToProtoValue( + $value, + $field, + $ignore_unknown); + if ($field->getType() === GPBType::MESSAGE) { + if (is_null($proto_value)) { + continue; + } + $getter = $field->getGetter(); + $submsg = $this->$getter(); + if (!is_null($submsg)) { + $submsg->mergeFrom($proto_value); + continue; + } + } + $this->$setter($proto_value); + } + } + } + + /** + * @ignore + */ + public function parseFromJsonStream($input, $ignore_unknown) + { + $array = json_decode($input->getData(), true, 512, JSON_BIGINT_AS_STRING); + if ($this instanceof \Google\Protobuf\ListValue) { + $array = ["values"=>$array]; + } + if (is_null($array)) { + if ($this instanceof \Google\Protobuf\Value) { + $this->setNullValue(\Google\Protobuf\NullValue::NULL_VALUE); + return; + } else { + throw new GPBDecodeException( + "Cannot decode json string: " . $input->getData()); + } + } + try { + $this->mergeFromJsonArray($array, $ignore_unknown); + } catch (\Exception $e) { + throw new GPBDecodeException($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * @ignore + */ + private function serializeSingularFieldToStream($field, &$output) + { + if (!$this->existField($field)) { + return true; + } + $getter = $field->getGetter(); + $value = $this->$getter(); + if (!GPBWire::serializeFieldToStream($value, $field, true, $output)) { + return false; + } + return true; + } + + /** + * @ignore + */ + private function serializeRepeatedFieldToStream($field, &$output) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count === 0) { + return true; + } + + $packed = $field->getPacked(); + if ($packed) { + if (!GPBWire::writeTag( + $output, + GPBWire::makeTag($field->getNumber(), GPBType::STRING))) { + return false; + } + $size = 0; + foreach ($values as $value) { + $size += $this->fieldDataOnlyByteSize($field, $value); + } + if (!$output->writeVarint32($size, true)) { + return false; + } + } + + foreach ($values as $value) { + if (!GPBWire::serializeFieldToStream( + $value, + $field, + !$packed, + $output)) { + return false; + } + } + return true; + } + + /** + * @ignore + */ + private function serializeMapFieldToStream($field, $output) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count === 0) { + return true; + } + + foreach ($values as $key => $value) { + $map_entry = new MapEntry($field->getMessageType()); + $map_entry->setKey($key); + $map_entry->setValue($value); + if (!GPBWire::serializeFieldToStream( + $map_entry, + $field, + true, + $output)) { + return false; + } + } + return true; + } + + /** + * @ignore + */ + private function serializeFieldToStream(&$output, $field) + { + if ($field->isMap()) { + return $this->serializeMapFieldToStream($field, $output); + } elseif ($field->isRepeated()) { + return $this->serializeRepeatedFieldToStream($field, $output); + } else { + return $this->serializeSingularFieldToStream($field, $output); + } + } + + /** + * @ignore + */ + private function serializeFieldToJsonStream(&$output, $field) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + return GPBJsonWire::serializeFieldToStream( + $values, $field, $output, !GPBUtil::hasSpecialJsonMapping($this)); + } + + /** + * @ignore + */ + public function serializeToStream(&$output) + { + $fields = $this->desc->getField(); + foreach ($fields as $field) { + if (!$this->serializeFieldToStream($output, $field)) { + return false; + } + } + $output->writeRaw($this->unknown, strlen($this->unknown)); + return true; + } + + /** + * @ignore + */ + public function serializeToJsonStream(&$output) + { + if (is_a($this, 'Google\Protobuf\Any')) { + $output->writeRaw("{", 1); + $type_field = $this->desc->getFieldByNumber(1); + $value_msg = $this->unpack(); + + // Serialize type url. + $output->writeRaw("\"@type\":", 8); + $output->writeRaw("\"", 1); + $output->writeRaw($this->getTypeUrl(), strlen($this->getTypeUrl())); + $output->writeRaw("\"", 1); + + // Serialize value + if (GPBUtil::hasSpecialJsonMapping($value_msg)) { + $output->writeRaw(",\"value\":", 9); + $value_msg->serializeToJsonStream($output); + } else { + $value_fields = $value_msg->desc->getField(); + foreach ($value_fields as $field) { + if ($value_msg->existField($field)) { + $output->writeRaw(",", 1); + if (!$value_msg->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } + } + + $output->writeRaw("}", 1); + } elseif (is_a($this, 'Google\Protobuf\FieldMask')) { + $field_mask = GPBUtil::formatFieldMask($this); + $output->writeRaw("\"", 1); + $output->writeRaw($field_mask, strlen($field_mask)); + $output->writeRaw("\"", 1); + } elseif (is_a($this, 'Google\Protobuf\Duration')) { + $duration = GPBUtil::formatDuration($this) . "s"; + $output->writeRaw("\"", 1); + $output->writeRaw($duration, strlen($duration)); + $output->writeRaw("\"", 1); + } elseif (get_class($this) === 'Google\Protobuf\Timestamp') { + $timestamp = GPBUtil::formatTimestamp($this); + $timestamp = json_encode($timestamp); + $output->writeRaw($timestamp, strlen($timestamp)); + } elseif (get_class($this) === 'Google\Protobuf\ListValue') { + $field = $this->desc->getField()[1]; + if (!$this->existField($field)) { + $output->writeRaw("[]", 2); + } else { + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } elseif (get_class($this) === 'Google\Protobuf\Struct') { + $field = $this->desc->getField()[1]; + if (!$this->existField($field)) { + $output->writeRaw("{}", 2); + } else { + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } else { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $output->writeRaw("{", 1); + } + $fields = $this->desc->getField(); + $first = true; + foreach ($fields as $field) { + if ($this->existField($field) || + GPBUtil::hasJsonValue($this)) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $output->writeRaw("}", 1); + } + } + return true; + } + + /** + * Serialize the message to string. + * @return string Serialized binary protobuf data. + */ + public function serializeToString() + { + $output = new CodedOutputStream($this->byteSize()); + $this->serializeToStream($output); + return $output->getData(); + } + + /** + * Serialize the message to json string. + * @return string Serialized json protobuf data. + */ + public function serializeToJsonString($options = 0) + { + $output = new CodedOutputStream($this->jsonByteSize($options), $options); + $this->serializeToJsonStream($output); + return $output->getData(); + } + + /** + * @ignore + */ + private function existField($field) + { + $getter = $field->getGetter(); + $hazzer = "has" . substr($getter, 3); + + if (method_exists($this, $hazzer)) { + return $this->$hazzer(); + } else if ($field->getOneofIndex() !== -1) { + // For old generated code, which does not have hazzers for oneof + // fields. + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + return $this->$oneof_name->getNumber() === $field->getNumber(); + } + + $values = $this->$getter(); + if ($field->isMap()) { + return count($values) !== 0; + } elseif ($field->isRepeated()) { + return count($values) !== 0; + } else { + return $values !== $this->defaultValue($field); + } + } + + /** + * @ignore + */ + private function repeatedFieldDataOnlyByteSize($field) + { + $size = 0; + + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + $size += $count * GPBWire::tagSize($field); + foreach ($values as $value) { + $size += $this->singularFieldDataOnlyByteSize($field); + } + } + } + + /** + * @ignore + */ + private function fieldDataOnlyByteSize($field, $value) + { + $size = 0; + + switch ($field->getType()) { + case GPBType::BOOL: + $size += 1; + break; + case GPBType::FLOAT: + case GPBType::FIXED32: + case GPBType::SFIXED32: + $size += 4; + break; + case GPBType::DOUBLE: + case GPBType::FIXED64: + case GPBType::SFIXED64: + $size += 8; + break; + case GPBType::INT32: + case GPBType::ENUM: + $size += GPBWire::varint32Size($value, true); + break; + case GPBType::UINT32: + $size += GPBWire::varint32Size($value); + break; + case GPBType::UINT64: + case GPBType::INT64: + $size += GPBWire::varint64Size($value); + break; + case GPBType::SINT32: + $size += GPBWire::sint32Size($value); + break; + case GPBType::SINT64: + $size += GPBWire::sint64Size($value); + break; + case GPBType::STRING: + case GPBType::BYTES: + $size += strlen($value); + $size += GPBWire::varint32Size($size); + break; + case GPBType::MESSAGE: + $size += $value->byteSize(); + $size += GPBWire::varint32Size($size); + break; + case GPBType::GROUP: + // TODO: Add support. + user_error("Unsupported type."); + break; + default: + user_error("Unsupported type."); + return 0; + } + + return $size; + } + + /** + * @ignore + */ + private function fieldDataOnlyJsonByteSize($field, $value, $options = 0) + { + $size = 0; + + switch ($field->getType()) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + $size += strlen(strval($value)); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + if ($value < 0) { + $value = bcadd($value, "4294967296"); + } + $size += strlen(strval($value)); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + if ($value < 0) { + $value = bcadd($value, "18446744073709551616"); + } + // Intentional fall through. + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + $size += 2; // size for "" + $size += strlen(strval($value)); + break; + case GPBType::FLOAT: + if (is_nan($value)) { + $size += strlen("NaN") + 2; + } elseif ($value === INF) { + $size += strlen("Infinity") + 2; + } elseif ($value === -INF) { + $size += strlen("-Infinity") + 2; + } else { + $size += strlen(sprintf("%.8g", $value)); + } + break; + case GPBType::DOUBLE: + if (is_nan($value)) { + $size += strlen("NaN") + 2; + } elseif ($value === INF) { + $size += strlen("Infinity") + 2; + } elseif ($value === -INF) { + $size += strlen("-Infinity") + 2; + } else { + $size += strlen(sprintf("%.17g", $value)); + } + break; + case GPBType::ENUM: + $enum_desc = $field->getEnumType(); + if ($enum_desc->getClass() === "Google\Protobuf\NullValue") { + $size += 4; + break; + } + if ($options & PrintOptions::ALWAYS_PRINT_ENUMS_AS_INTS) { + $size += strlen(strval($value)); // size for integer length + } else { + $enum_value_desc = $enum_desc->getValueByNumber($value); + if (!is_null($enum_value_desc)) { + $size += 2; // size for "" + $size += strlen($enum_value_desc->getName()); + } else { + $str_value = strval($value); + $size += strlen($str_value); + } + } + break; + case GPBType::BOOL: + if ($value) { + $size += 4; + } else { + $size += 5; + } + break; + case GPBType::STRING: + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + $size += strlen($value); + break; + case GPBType::BYTES: + # if (is_a($this, "Google\Protobuf\BytesValue")) { + # $size += strlen(json_encode($value)); + # } else { + # $size += strlen(base64_encode($value)); + # $size += 2; // size for \"\" + # } + $size += strlen(base64_encode($value)); + $size += 2; // size for \"\" + break; + case GPBType::MESSAGE: + $size += $value->jsonByteSize($options); + break; +# case GPBType::GROUP: +# // TODO: Add support. +# user_error("Unsupported type."); +# break; + default: + user_error("Unsupported type " . $field->getType()); + return 0; + } + + return $size; + } + + /** + * @ignore + */ + private function fieldByteSize($field) + { + $size = 0; + if ($field->isMap()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + $size += $count * GPBWire::tagSize($field); + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + foreach ($values as $key => $value) { + $data_size = 0; + if ($key != $this->defaultValue($key_field)) { + $data_size += $this->fieldDataOnlyByteSize( + $key_field, + $key); + $data_size += GPBWire::tagSize($key_field); + } + if ($value != $this->defaultValue($value_field)) { + $data_size += $this->fieldDataOnlyByteSize( + $value_field, + $value); + $data_size += GPBWire::tagSize($value_field); + } + $size += GPBWire::varint32Size($data_size) + $data_size; + } + } + } elseif ($field->isRepeated()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if ($field->getPacked()) { + $data_size = 0; + foreach ($values as $value) { + $data_size += $this->fieldDataOnlyByteSize($field, $value); + } + $size += GPBWire::tagSize($field); + $size += GPBWire::varint32Size($data_size); + $size += $data_size; + } else { + $size += $count * GPBWire::tagSize($field); + foreach ($values as $value) { + $size += $this->fieldDataOnlyByteSize($field, $value); + } + } + } + } elseif ($this->existField($field)) { + $size += GPBWire::tagSize($field); + $getter = $field->getGetter(); + $value = $this->$getter(); + $size += $this->fieldDataOnlyByteSize($field, $value); + } + return $size; + } + + /** + * @ignore + */ + private function fieldJsonByteSize($field, $options = 0) + { + $size = 0; + + if ($field->isMap()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name + } + $size += 2; // size for "{}". + $size += $count - 1; // size for commas + $getter = $field->getGetter(); + $map_entry = $field->getMessageType(); + $key_field = $map_entry->getFieldByNumber(1); + $value_field = $map_entry->getFieldByNumber(2); + switch ($key_field->getType()) { + case GPBType::STRING: + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::FIXED64: + case GPBType::UINT64: + $additional_quote = false; + break; + default: + $additional_quote = true; + } + foreach ($values as $key => $value) { + if ($additional_quote) { + $size += 2; // size for "" + } + $size += $this->fieldDataOnlyJsonByteSize($key_field, $key, $options); + $size += $this->fieldDataOnlyJsonByteSize($value_field, $value, $options); + $size += 1; // size for : + } + } + } elseif ($field->isRepeated()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name + } + $size += 2; // size for "[]". + $size += $count - 1; // size for commas + $getter = $field->getGetter(); + foreach ($values as $value) { + $size += $this->fieldDataOnlyJsonByteSize($field, $value, $options); + } + } + } elseif ($this->existField($field) || GPBUtil::hasJsonValue($this)) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name + } + $getter = $field->getGetter(); + $value = $this->$getter(); + $size += $this->fieldDataOnlyJsonByteSize($field, $value, $options); + } + return $size; + } + + /** + * @ignore + */ + public function byteSize() + { + $size = 0; + + $fields = $this->desc->getField(); + foreach ($fields as $field) { + $size += $this->fieldByteSize($field); + } + $size += strlen($this->unknown); + return $size; + } + + private function appendHelper($field, $append_value) + { + $getter = $field->getGetter(); + $setter = $field->getSetter(); + + $field_arr_value = $this->$getter(); + $field_arr_value[] = $append_value; + + if (!is_object($field_arr_value)) { + $this->$setter($field_arr_value); + } + } + + private function kvUpdateHelper($field, $update_key, $update_value) + { + $getter = $field->getGetter(); + $setter = $field->getSetter(); + + $field_arr_value = $this->$getter(); + $field_arr_value[$update_key] = $update_value; + + if (!is_object($field_arr_value)) { + $this->$setter($field_arr_value); + } + } + + /** + * @ignore + */ + public function jsonByteSize($options = 0) + { + $size = 0; + if (is_a($this, 'Google\Protobuf\Any')) { + // Size for "{}". + $size += 2; + + // Size for "\"@type\":". + $size += 8; + + // Size for url. +2 for "" /. + $size += strlen($this->getTypeUrl()) + 2; + + $value_msg = $this->unpack(); + if (GPBUtil::hasSpecialJsonMapping($value_msg)) { + // Size for "\",value\":". + $size += 9; + $size += $value_msg->jsonByteSize($options); + } else { + $value_size = $value_msg->jsonByteSize($options); + // size === 2 it's empty message {} which is not serialized inside any + if ($value_size !== 2) { + // Size for value. +1 for comma, -2 for "{}". + $size += $value_size -1; + } + } + } elseif (get_class($this) === 'Google\Protobuf\FieldMask') { + $field_mask = GPBUtil::formatFieldMask($this); + $size += strlen($field_mask) + 2; // 2 for "" + } elseif (get_class($this) === 'Google\Protobuf\Duration') { + $duration = GPBUtil::formatDuration($this) . "s"; + $size += strlen($duration) + 2; // 2 for "" + } elseif (get_class($this) === 'Google\Protobuf\Timestamp') { + $timestamp = GPBUtil::formatTimestamp($this); + $timestamp = json_encode($timestamp); + $size += strlen($timestamp); + } elseif (get_class($this) === 'Google\Protobuf\ListValue') { + $field = $this->desc->getField()[1]; + if ($this->existField($field)) { + $field_size = $this->fieldJsonByteSize($field, $options); + $size += $field_size; + } else { + // Size for "[]". + $size += 2; + } + } elseif (get_class($this) === 'Google\Protobuf\Struct') { + $field = $this->desc->getField()[1]; + if ($this->existField($field)) { + $field_size = $this->fieldJsonByteSize($field, $options); + $size += $field_size; + } else { + // Size for "{}". + $size += 2; + } + } else { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + // Size for "{}". + $size += 2; + } + + $fields = $this->desc->getField(); + $count = 0; + foreach ($fields as $field) { + $field_size = $this->fieldJsonByteSize($field, $options); + $size += $field_size; + if ($field_size != 0) { + $count++; + } + } + // size for comma + $size += $count > 0 ? ($count - 1) : 0; + } + return $size; + } + + public function __debugInfo() + { + if (is_a($this, 'Google\Protobuf\FieldMask')) { + return ['paths' => $this->getPaths()->__debugInfo()]; + } + + if (is_a($this, 'Google\Protobuf\Value')) { + switch ($this->getKind()) { + case 'null_value': + return ['nullValue' => $this->getNullValue()]; + case 'number_value': + return ['numberValue' => $this->getNumberValue()]; + case 'string_value': + return ['stringValue' => $this->getStringValue()]; + case 'bool_value': + return ['boolValue' => $this->getBoolValue()]; + case 'struct_value': + return ['structValue' => $this->getStructValue()->__debugInfo()]; + case 'list_value': + return ['listValue' => $this->getListValue()->__debugInfo()]; + } + return []; + } + + if (is_a($this, 'Google\Protobuf\BoolValue') + || is_a($this, 'Google\Protobuf\BytesValue') + || is_a($this, 'Google\Protobuf\DoubleValue') + || is_a($this, 'Google\Protobuf\FloatValue') + || is_a($this, 'Google\Protobuf\StringValue') + || is_a($this, 'Google\Protobuf\Int32Value') + || is_a($this, 'Google\Protobuf\Int64Value') + || is_a($this, 'Google\Protobuf\UInt32Value') + || is_a($this, 'Google\Protobuf\UInt64Value') + ) { + return [ + 'value' => json_decode($this->serializeToJsonString(), true), + ]; + } + + if ( + is_a($this, 'Google\Protobuf\Duration') + || is_a($this, 'Google\Protobuf\Timestamp') + ) { + return [ + 'seconds' => $this->getSeconds(), + 'nanos' => $this->getNanos(), + ]; + } + + return json_decode($this->serializeToJsonString(), true); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php new file mode 100644 index 0000000..d62b276 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php @@ -0,0 +1,97 @@ +descriptor = new Descriptor(); + $this->descriptor->setFullName($full_name); + $this->descriptor->setClass($klass); + $this->pool = $pool; + } + + private function getFieldDescriptor($name, $label, $type, + $number, $type_name = null) + { + $field = new FieldDescriptor(); + $field->setName($name); + $camel_name = implode('', array_map('ucwords', explode('_', $name))); + $field->setGetter('get' . $camel_name); + $field->setSetter('set' . $camel_name); + $field->setType($type); + $field->setNumber($number); + $field->setLabel($label); + + // At this time, the message/enum type may have not been added to pool. + // So we use the type name as place holder and will replace it with the + // actual descriptor in cross building. + switch ($type) { + case GPBType::MESSAGE: + $field->setMessageType($type_name); + break; + case GPBType::ENUM: + $field->setEnumType($type_name); + break; + default: + break; + } + + return $field; + } + + public function optional($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::OPTIONAL, + $type, + $number, + $type_name)); + return $this; + } + + public function repeated($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::REPEATED, + $type, + $number, + $type_name)); + return $this; + } + + public function required($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::REQUIRED, + $type, + $number, + $type_name)); + return $this; + } + + public function finalizeToPool() + { + $this->pool->addDescriptor($this->descriptor); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php new file mode 100644 index 0000000..d09e6fa --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php @@ -0,0 +1,527 @@ +google.protobuf.MessageOptions + */ +class MessageOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + */ + protected $message_set_wire_format = null; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + protected $no_standard_descriptor_accessor = null; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * Generated from protobuf field optional bool map_entry = 7; + */ + protected $map_entry = null; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + protected $deprecated_legacy_json_field_conflicts = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + */ + protected $features = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $message_set_wire_format + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * @type bool $no_standard_descriptor_accessor + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * @type bool $deprecated + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * @type bool $map_entry + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * @type bool $deprecated_legacy_json_field_conflicts + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + * @return bool + */ + public function getMessageSetWireFormat() + { + return isset($this->message_set_wire_format) ? $this->message_set_wire_format : false; + } + + public function hasMessageSetWireFormat() + { + return isset($this->message_set_wire_format); + } + + public function clearMessageSetWireFormat() + { + unset($this->message_set_wire_format); + } + + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + * @param bool $var + * @return $this + */ + public function setMessageSetWireFormat($var) + { + GPBUtil::checkBool($var); + $this->message_set_wire_format = $var; + + return $this; + } + + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + * @return bool + */ + public function getNoStandardDescriptorAccessor() + { + return isset($this->no_standard_descriptor_accessor) ? $this->no_standard_descriptor_accessor : false; + } + + public function hasNoStandardDescriptorAccessor() + { + return isset($this->no_standard_descriptor_accessor); + } + + public function clearNoStandardDescriptorAccessor() + { + unset($this->no_standard_descriptor_accessor); + } + + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + * @param bool $var + * @return $this + */ + public function setNoStandardDescriptorAccessor($var) + { + GPBUtil::checkBool($var); + $this->no_standard_descriptor_accessor = $var; + + return $this; + } + + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * Generated from protobuf field optional bool map_entry = 7; + * @return bool + */ + public function getMapEntry() + { + return isset($this->map_entry) ? $this->map_entry : false; + } + + public function hasMapEntry() + { + return isset($this->map_entry); + } + + public function clearMapEntry() + { + unset($this->map_entry); + } + + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * Generated from protobuf field optional bool map_entry = 7; + * @param bool $var + * @return $this + */ + public function setMapEntry($var) + { + GPBUtil::checkBool($var); + $this->map_entry = $var; + + return $this; + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getDeprecatedLegacyJsonFieldConflicts() + { + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } + return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; + } + + public function hasDeprecatedLegacyJsonFieldConflicts() + { + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } + return isset($this->deprecated_legacy_json_field_conflicts); + } + + public function clearDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + unset($this->deprecated_legacy_json_field_conflicts); + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setDeprecatedLegacyJsonFieldConflicts($var) + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->deprecated_legacy_json_field_conflicts = $var; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php new file mode 100644 index 0000000..59ab867 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php @@ -0,0 +1,283 @@ +google.protobuf.MethodDescriptorProto + */ +class MethodDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + */ + protected $input_type = null; + /** + * Generated from protobuf field optional string output_type = 3; + */ + protected $output_type = null; + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + */ + protected $options = null; + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + */ + protected $client_streaming = null; + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + */ + protected $server_streaming = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type string $input_type + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * @type string $output_type + * @type \Google\Protobuf\Internal\MethodOptions $options + * @type bool $client_streaming + * Identifies if client streams multiple client messages + * @type bool $server_streaming + * Identifies if server streams multiple server messages + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + * @return string + */ + public function getInputType() + { + return isset($this->input_type) ? $this->input_type : ''; + } + + public function hasInputType() + { + return isset($this->input_type); + } + + public function clearInputType() + { + unset($this->input_type); + } + + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + * @param string $var + * @return $this + */ + public function setInputType($var) + { + GPBUtil::checkString($var, True); + $this->input_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string output_type = 3; + * @return string + */ + public function getOutputType() + { + return isset($this->output_type) ? $this->output_type : ''; + } + + public function hasOutputType() + { + return isset($this->output_type); + } + + public function clearOutputType() + { + unset($this->output_type); + } + + /** + * Generated from protobuf field optional string output_type = 3; + * @param string $var + * @return $this + */ + public function setOutputType($var) + { + GPBUtil::checkString($var, True); + $this->output_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + * @return \Google\Protobuf\Internal\MethodOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + * @param \Google\Protobuf\Internal\MethodOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MethodOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + * @return bool + */ + public function getClientStreaming() + { + return isset($this->client_streaming) ? $this->client_streaming : false; + } + + public function hasClientStreaming() + { + return isset($this->client_streaming); + } + + public function clearClientStreaming() + { + unset($this->client_streaming); + } + + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + * @param bool $var + * @return $this + */ + public function setClientStreaming($var) + { + GPBUtil::checkBool($var); + $this->client_streaming = $var; + + return $this; + } + + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + * @return bool + */ + public function getServerStreaming() + { + return isset($this->server_streaming) ? $this->server_streaming : false; + } + + public function hasServerStreaming() + { + return isset($this->server_streaming); + } + + public function clearServerStreaming() + { + unset($this->server_streaming); + } + + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + * @param bool $var + * @return $this + */ + public function setServerStreaming($var) + { + GPBUtil::checkBool($var); + $this->server_streaming = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php new file mode 100644 index 0000000..aae2a3d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php @@ -0,0 +1,217 @@ +google.protobuf.MethodOptions + */ +class MethodOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + */ + protected $deprecated = null; + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + protected $idempotency_level = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + */ + protected $features = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deprecated + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * @type int $idempotency_level + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + * @return int + */ + public function getIdempotencyLevel() + { + return isset($this->idempotency_level) ? $this->idempotency_level : 0; + } + + public function hasIdempotencyLevel() + { + return isset($this->idempotency_level); + } + + public function clearIdempotencyLevel() + { + unset($this->idempotency_level); + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + * @param int $var + * @return $this + */ + public function setIdempotencyLevel($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\MethodOptions\IdempotencyLevel::class); + $this->idempotency_level = $var; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php new file mode 100644 index 0000000..ce99b8c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php @@ -0,0 +1,62 @@ +google.protobuf.MethodOptions.IdempotencyLevel + */ +class IdempotencyLevel +{ + /** + * Generated from protobuf enum IDEMPOTENCY_UNKNOWN = 0; + */ + const IDEMPOTENCY_UNKNOWN = 0; + /** + * implies idempotent + * + * Generated from protobuf enum NO_SIDE_EFFECTS = 1; + */ + const NO_SIDE_EFFECTS = 1; + /** + * idempotent, but may have side effects + * + * Generated from protobuf enum IDEMPOTENT = 2; + */ + const IDEMPOTENT = 2; + + private static $valueToName = [ + self::IDEMPOTENCY_UNKNOWN => 'IDEMPOTENCY_UNKNOWN', + self::NO_SIDE_EFFECTS => 'NO_SIDE_EFFECTS', + self::IDEMPOTENT => 'IDEMPOTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php new file mode 100644 index 0000000..1d7cd28 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php @@ -0,0 +1,64 @@ +public_desc = new \Google\Protobuf\OneofDescriptor($this); + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function addField(FieldDescriptor $field) + { + $this->fields[] = $field; + } + + public function getFields() + { + return $this->fields; + } + + public function isSynthetic() + { + return !is_null($this->fields) && count($this->fields) === 1 + && $this->fields[0]->getProto3Optional(); + } + + public static function buildFromProto($oneof_proto, $desc, $index) + { + $oneof = new OneofDescriptor(); + $oneof->setName($oneof_proto->getName()); + foreach ($desc->getField() as $field) { + /** @var FieldDescriptor $field */ + if ($field->getOneofIndex() == $index) { + $oneof->addField($field); + $field->setContainingOneof($oneof); + } + } + return $oneof; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php new file mode 100644 index 0000000..16da70f --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php @@ -0,0 +1,110 @@ +google.protobuf.OneofDescriptorProto + */ +class OneofDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type \Google\Protobuf\Internal\OneofOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + * @return \Google\Protobuf\Internal\OneofOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + * @param \Google\Protobuf\Internal\OneofOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\OneofOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php new file mode 100644 index 0000000..4b98992 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php @@ -0,0 +1,54 @@ +desc = $desc; + } + + public function setValue($value) + { + $this->value = $value; + } + + public function getValue() + { + return $this->value; + } + + public function setFieldName($field_name) + { + $this->field_name = $field_name; + } + + public function getFieldName() + { + return $this->field_name; + } + + public function setNumber($number) + { + $this->number = $number; + } + + public function getNumber() + { + return $this->number; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php new file mode 100644 index 0000000..1d68a13 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php @@ -0,0 +1,124 @@ +google.protobuf.OneofOptions + */ +class OneofOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + */ + protected $features = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php new file mode 100644 index 0000000..7ab1b3e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php @@ -0,0 +1,27 @@ +buffer = $buffer; + } + + public function getData() + { + return $this->buffer; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php new file mode 100644 index 0000000..cd6ef02 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php @@ -0,0 +1,13 @@ +position = 0; + $this->container = $container; + } + + /** + * Reset the status of the iterator + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function rewind() + { + $this->position = 0; + } + + /** + * Return the element at the current position. + * + * @return object The element at the current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function current() + { + return $this->container[$this->position]; + } + + /** + * Return the current position. + * + * @return integer The current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function key() + { + return $this->position; + } + + /** + * Move to the next position. + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function next() + { + ++$this->position; + } + + /** + * Check whether there are more elements to iterate. + * + * @return bool True if there are more elements to iterate. + */ + public function valid(): bool + { + return isset($this->container[$this->position]); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php new file mode 100644 index 0000000..27b274b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php @@ -0,0 +1,137 @@ +google.protobuf.ServiceDescriptorProto + */ +class ServiceDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + */ + private $method; + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type \Google\Protobuf\Internal\MethodDescriptorProto[] $method + * @type \Google\Protobuf\Internal\ServiceOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + * @return RepeatedField<\Google\Protobuf\Internal\MethodDescriptorProto> + */ + public function getMethod() + { + return $this->method; + } + + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + * @param \Google\Protobuf\Internal\MethodDescriptorProto[] $var + * @return $this + */ + public function setMethod($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\MethodDescriptorProto::class); + $this->method = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + * @return \Google\Protobuf\Internal\ServiceOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + * @param \Google\Protobuf\Internal\ServiceOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ServiceOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php new file mode 100644 index 0000000..d478bb2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php @@ -0,0 +1,180 @@ +google.protobuf.ServiceOptions + */ +class ServiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + */ + protected $features = null; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + */ + protected $deprecated = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type bool $deprecated + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php new file mode 100644 index 0000000..b194a04 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php @@ -0,0 +1,231 @@ +google.protobuf.SourceCodeInfo + */ +class SourceCodeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + */ + private $location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\SourceCodeInfo\Location[] $location + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + * @return RepeatedField<\Google\Protobuf\Internal\SourceCodeInfo\Location> + */ + public function getLocation() + { + return $this->location; + } + + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + * @param \Google\Protobuf\Internal\SourceCodeInfo\Location[] $var + * @return $this + */ + public function setLocation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo\Location::class); + $this->location = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php new file mode 100644 index 0000000..87d3452 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php @@ -0,0 +1,446 @@ +google.protobuf.SourceCodeInfo.Location + */ +class Location extends \Google\Protobuf\Internal\Message +{ + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + */ + private $path; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + */ + private $span; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + */ + protected $leading_comments = null; + /** + * Generated from protobuf field optional string trailing_comments = 4; + */ + protected $trailing_comments = null; + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + */ + private $leading_detached_comments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[] $path + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * @type int[] $span + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * @type string $leading_comments + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} + * optional int32 grault = 6; + * // ignored detached comments. + * @type string $trailing_comments + * @type string[] $leading_detached_comments + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @return RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @param int[] $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->path = $arr; + + return $this; + } + + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + * @return RepeatedField + */ + public function getSpan() + { + return $this->span; + } + + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + * @param int[] $var + * @return $this + */ + public function setSpan($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->span = $arr; + + return $this; + } + + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + * @return string + */ + public function getLeadingComments() + { + return isset($this->leading_comments) ? $this->leading_comments : ''; + } + + public function hasLeadingComments() + { + return isset($this->leading_comments); + } + + public function clearLeadingComments() + { + unset($this->leading_comments); + } + + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + * @param string $var + * @return $this + */ + public function setLeadingComments($var) + { + GPBUtil::checkString($var, True); + $this->leading_comments = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string trailing_comments = 4; + * @return string + */ + public function getTrailingComments() + { + return isset($this->trailing_comments) ? $this->trailing_comments : ''; + } + + public function hasTrailingComments() + { + return isset($this->trailing_comments); + } + + public function clearTrailingComments() + { + unset($this->trailing_comments); + } + + /** + * Generated from protobuf field optional string trailing_comments = 4; + * @param string $var + * @return $this + */ + public function setTrailingComments($var) + { + GPBUtil::checkString($var, True); + $this->trailing_comments = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + * @return RepeatedField + */ + public function getLeadingDetachedComments() + { + return $this->leading_detached_comments; + } + + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + * @param string[] $var + * @return $this + */ + public function setLeadingDetachedComments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->leading_detached_comments = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SymbolVisibility.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SymbolVisibility.php new file mode 100644 index 0000000..0eb388d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SymbolVisibility.php @@ -0,0 +1,60 @@ +google.protobuf.SymbolVisibility + */ +class SymbolVisibility +{ + /** + * Generated from protobuf enum VISIBILITY_UNSET = 0; + */ + const VISIBILITY_UNSET = 0; + /** + * Generated from protobuf enum VISIBILITY_LOCAL = 1; + */ + const VISIBILITY_LOCAL = 1; + /** + * Generated from protobuf enum VISIBILITY_EXPORT = 2; + */ + const VISIBILITY_EXPORT = 2; + + private static $valueToName = [ + self::VISIBILITY_UNSET => 'VISIBILITY_UNSET', + self::VISIBILITY_LOCAL => 'VISIBILITY_LOCAL', + self::VISIBILITY_EXPORT => 'VISIBILITY_EXPORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/TimestampBase.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/TimestampBase.php new file mode 100644 index 0000000..653d1e9 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/TimestampBase.php @@ -0,0 +1,32 @@ +seconds = $datetime->getTimestamp(); + $this->nanos = 1000 * $datetime->format('u'); + } + + /** + * Converts Timestamp to PHP DateTime. + * + * @return \DateTime $datetime + */ + public function toDateTime() + { + $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000); + return \DateTime::createFromFormat('U.u', $time); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php new file mode 100644 index 0000000..b365b6c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php @@ -0,0 +1,301 @@ +google.protobuf.UninterpretedOption + */ +class UninterpretedOption extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + */ + private $name; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + */ + protected $identifier_value = null; + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + */ + protected $positive_int_value = null; + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + */ + protected $negative_int_value = null; + /** + * Generated from protobuf field optional double double_value = 6; + */ + protected $double_value = null; + /** + * Generated from protobuf field optional bytes string_value = 7; + */ + protected $string_value = null; + /** + * Generated from protobuf field optional string aggregate_value = 8; + */ + protected $aggregate_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\UninterpretedOption\NamePart[] $name + * @type string $identifier_value + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * @type int|string $positive_int_value + * @type int|string $negative_int_value + * @type float $double_value + * @type string $string_value + * @type string $aggregate_value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption\NamePart> + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + * @param \Google\Protobuf\Internal\UninterpretedOption\NamePart[] $var + * @return $this + */ + public function setName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption\NamePart::class); + $this->name = $arr; + + return $this; + } + + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + * @return string + */ + public function getIdentifierValue() + { + return isset($this->identifier_value) ? $this->identifier_value : ''; + } + + public function hasIdentifierValue() + { + return isset($this->identifier_value); + } + + public function clearIdentifierValue() + { + unset($this->identifier_value); + } + + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + * @param string $var + * @return $this + */ + public function setIdentifierValue($var) + { + GPBUtil::checkString($var, True); + $this->identifier_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + * @return int|string + */ + public function getPositiveIntValue() + { + return isset($this->positive_int_value) ? $this->positive_int_value : 0; + } + + public function hasPositiveIntValue() + { + return isset($this->positive_int_value); + } + + public function clearPositiveIntValue() + { + unset($this->positive_int_value); + } + + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + * @param int|string $var + * @return $this + */ + public function setPositiveIntValue($var) + { + GPBUtil::checkUint64($var); + $this->positive_int_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + * @return int|string + */ + public function getNegativeIntValue() + { + return isset($this->negative_int_value) ? $this->negative_int_value : 0; + } + + public function hasNegativeIntValue() + { + return isset($this->negative_int_value); + } + + public function clearNegativeIntValue() + { + unset($this->negative_int_value); + } + + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + * @param int|string $var + * @return $this + */ + public function setNegativeIntValue($var) + { + GPBUtil::checkInt64($var); + $this->negative_int_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional double double_value = 6; + * @return float + */ + public function getDoubleValue() + { + return isset($this->double_value) ? $this->double_value : 0.0; + } + + public function hasDoubleValue() + { + return isset($this->double_value); + } + + public function clearDoubleValue() + { + unset($this->double_value); + } + + /** + * Generated from protobuf field optional double double_value = 6; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->double_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bytes string_value = 7; + * @return string + */ + public function getStringValue() + { + return isset($this->string_value) ? $this->string_value : ''; + } + + public function hasStringValue() + { + return isset($this->string_value); + } + + public function clearStringValue() + { + unset($this->string_value); + } + + /** + * Generated from protobuf field optional bytes string_value = 7; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, False); + $this->string_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string aggregate_value = 8; + * @return string + */ + public function getAggregateValue() + { + return isset($this->aggregate_value) ? $this->aggregate_value : ''; + } + + public function hasAggregateValue() + { + return isset($this->aggregate_value); + } + + public function clearAggregateValue() + { + unset($this->aggregate_value); + } + + /** + * Generated from protobuf field optional string aggregate_value = 8; + * @param string $var + * @return $this + */ + public function setAggregateValue($var) + { + GPBUtil::checkString($var, True); + $this->aggregate_value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php new file mode 100644 index 0000000..547e3f4 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php @@ -0,0 +1,114 @@ +google.protobuf.UninterpretedOption.NamePart + */ +class NamePart extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field required string name_part = 1; + */ + protected $name_part = null; + /** + * Generated from protobuf field required bool is_extension = 2; + */ + protected $is_extension = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name_part + * @type bool $is_extension + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field required string name_part = 1; + * @return string + */ + public function getNamePart() + { + return isset($this->name_part) ? $this->name_part : ''; + } + + public function hasNamePart() + { + return isset($this->name_part); + } + + public function clearNamePart() + { + unset($this->name_part); + } + + /** + * Generated from protobuf field required string name_part = 1; + * @param string $var + * @return $this + */ + public function setNamePart($var) + { + GPBUtil::checkString($var, True); + $this->name_part = $var; + + return $this; + } + + /** + * Generated from protobuf field required bool is_extension = 2; + * @return bool + */ + public function getIsExtension() + { + return isset($this->is_extension) ? $this->is_extension : false; + } + + public function hasIsExtension() + { + return isset($this->is_extension); + } + + public function clearIsExtension() + { + unset($this->is_extension); + } + + /** + * Generated from protobuf field required bool is_extension = 2; + * @param bool $var + * @return $this + */ + public function setIsExtension($var) + { + GPBUtil::checkBool($var); + $this->is_extension = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/ListValue.php b/vendor/google/protobuf/src/Google/Protobuf/ListValue.php new file mode 100644 index 0000000..5d8b8b3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/ListValue.php @@ -0,0 +1,69 @@ +google.protobuf.ListValue + */ +class ListValue extends \Google\Protobuf\Internal\Message +{ + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Value[] $values + * Repeated field of dynamically typed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @return RepeatedField<\Google\Protobuf\Value> + */ + public function getValues() + { + return $this->values; + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @param \Google\Protobuf\Value[] $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Method.php b/vendor/google/protobuf/src/Google/Protobuf/Method.php new file mode 100644 index 0000000..6eb9c35 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Method.php @@ -0,0 +1,340 @@ +google.protobuf.Method + */ +class Method extends \Google\Protobuf\Internal\Message +{ + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + */ + protected $request_type_url = ''; + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + */ + protected $request_streaming = false; + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + */ + protected $response_type_url = ''; + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + */ + protected $response_streaming = false; + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + */ + private $options; + /** + * The source syntax of this method. + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @deprecated + */ + protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field string edition = 8 [deprecated = true]; + * @deprecated + */ + protected $edition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The simple name of this method. + * @type string $request_type_url + * A URL of the input message type. + * @type bool $request_streaming + * If true, the request is streamed. + * @type string $response_type_url + * The URL of the output message type. + * @type bool $response_streaming + * If true, the response is streamed. + * @type \Google\Protobuf\Option[] $options + * Any metadata attached to the method. + * @type int $syntax + * The source syntax of this method. + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @return string + */ + public function getRequestTypeUrl() + { + return $this->request_type_url; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @param string $var + * @return $this + */ + public function setRequestTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->request_type_url = $var; + + return $this; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @return bool + */ + public function getRequestStreaming() + { + return $this->request_streaming; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @param bool $var + * @return $this + */ + public function setRequestStreaming($var) + { + GPBUtil::checkBool($var); + $this->request_streaming = $var; + + return $this; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @return string + */ + public function getResponseTypeUrl() + { + return $this->response_type_url; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @param string $var + * @return $this + */ + public function setResponseTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->response_type_url = $var; + + return $this; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @return bool + */ + public function getResponseStreaming() + { + return $this->response_streaming; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @param bool $var + * @return $this + */ + public function setResponseStreaming($var) + { + GPBUtil::checkBool($var); + $this->response_streaming = $var; + + return $this; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source syntax of this method. + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @return int + * @deprecated + */ + public function getSyntax() + { + if ($this->syntax !== 0) { + @trigger_error('syntax is deprecated.', E_USER_DEPRECATED); + } + return $this->syntax; + } + + /** + * The source syntax of this method. + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setSyntax($var) + { + @trigger_error('syntax is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field string edition = 8 [deprecated = true]; + * @return string + * @deprecated + */ + public function getEdition() + { + if ($this->edition !== '') { + @trigger_error('edition is deprecated.', E_USER_DEPRECATED); + } + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * Generated from protobuf field string edition = 8 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setEdition($var) + { + @trigger_error('edition is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Mixin.php b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php new file mode 100644 index 0000000..0250b8e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php @@ -0,0 +1,167 @@ +google.protobuf.Mixin + */ +class Mixin extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + */ + protected $root = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of the interface which is included. + * @type string $root + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @return string + */ + public function getRoot() + { + return $this->root; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @param string $var + * @return $this + */ + public function setRoot($var) + { + GPBUtil::checkString($var, True); + $this->root = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/NullValue.php b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php new file mode 100644 index 0000000..2c40d97 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php @@ -0,0 +1,50 @@ +google.protobuf.NullValue + */ +class NullValue +{ + /** + * Null value. + * + * Generated from protobuf enum NULL_VALUE = 0; + */ + const NULL_VALUE = 0; + + private static $valueToName = [ + self::NULL_VALUE => 'NULL_VALUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php new file mode 100644 index 0000000..685a887 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php @@ -0,0 +1,64 @@ +internal_desc = $internal_desc; + } + + /** + * @return string The name of the oneof + */ + public function getName() + { + return $this->internal_desc->getName(); + } + + /** + * @param int $index Must be >= 0 and < getFieldCount() + * @return FieldDescriptor + */ + public function getField($index) + { + if ( + is_null($this->internal_desc->getFields()) + || !isset($this->internal_desc->getFields()[$index]) + ) { + return null; + } + return $this->getPublicDescriptor($this->internal_desc->getFields()[$index]); + } + + /** + * @return int Number of fields in the oneof + */ + public function getFieldCount() + { + return count($this->internal_desc->getFields()); + } + + public function isSynthetic() + { + return $this->internal_desc->isSynthetic(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Option.php b/vendor/google/protobuf/src/Google/Protobuf/Option.php new file mode 100644 index 0000000..4dc52ca --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Option.php @@ -0,0 +1,140 @@ +google.protobuf.Option + */ +class Option extends \Google\Protobuf\Internal\Message +{ + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * @type \Google\Protobuf\Any $value + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @return \Google\Protobuf\Any|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/PrintOptions.php b/vendor/google/protobuf/src/Google/Protobuf/PrintOptions.php new file mode 100644 index 0000000..e85f534 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/PrintOptions.php @@ -0,0 +1,16 @@ + + * @implements \IteratorAggregate + */ +class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable +{ + + /** + * @ignore + */ + private $container; + /** + * @ignore + */ + private $type; + /** + * @ignore + * @var string|class-string + */ + private $klass; + + /** + * Constructs an instance of RepeatedField. + * + * @param integer $type Type of the stored element. + * @param string|class-string $klass Message/Enum class name (message/enum fields only). + * @ignore + */ + public function __construct($type, $klass = null) + { + $this->container = []; + $this->type = $type; + if ($this->type == GPBType::MESSAGE) { + $pool = DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + if ($desc == NULL) { + new $klass; // No msg class instance has been created before. + $desc = $pool->getDescriptorByClassName($klass); + } + $this->klass = $desc->getClass(); + } + } + + /** + * @ignore + */ + public function getType() + { + return $this->type; + } + + /** + * @ignore + * @return string|class-string + */ + public function getClass() + { + return $this->klass; + } + + /** + * Return the element at the given index. + * + * This will also be called for: $ele = $arr[0] + * + * @param integer $offset The index of the element to be fetched. + * @return T The stored element at given index. + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset]; + } + + /** + * Assign the element at the given index. + * + * This will also be called for: $arr []= $ele and $arr[0] = ele + * + * @param int|null $offset The index of the element to be assigned. + * @param T $value The element to be assigned. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @throws \ErrorException Incorrect type of the element. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + switch ($this->type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + case GPBType::ENUM: + GPBUtil::checkInt32($value); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($value); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($value); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($value); + break; + case GPBType::FLOAT: + GPBUtil::checkFloat($value); + break; + case GPBType::DOUBLE: + GPBUtil::checkDouble($value); + break; + case GPBType::BOOL: + GPBUtil::checkBool($value); + break; + case GPBType::BYTES: + GPBUtil::checkString($value, false); + break; + case GPBType::STRING: + GPBUtil::checkString($value, true); + break; + case GPBType::MESSAGE: + if (is_null($value)) { + throw new \TypeError("RepeatedField element cannot be null."); + } + GPBUtil::checkMessage($value, $this->klass); + break; + default: + break; + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + $count = count($this->container); + if (!is_numeric($offset) || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot modify element at the given index", + E_USER_ERROR); + return; + } + $this->container[$offset] = $value; + } + } + + /** + * Remove the element at the given index. + * + * This will also be called for: unset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException The element to be removed is not at the end of the + * RepeatedField. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $count = count($this->container); + if (!is_numeric($offset) || $count === 0 || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot remove element at the given index", + E_USER_ERROR); + return; + } + array_splice($this->container, $offset, 1); + } + + /** + * Check the existence of the element at the given index. + * + * This will also be called for: isset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return bool True if the element at the given offset exists. + * @throws \ErrorException Invalid type for index. + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * @ignore + */ + public function getIterator(): Traversable + { + return new RepeatedFieldIter($this->container); + } + + /** + * Return the number of stored elements. + * + * This will also be called for: count($arr) + * + * @return integer The number of stored elements. + */ + public function count(): int + { + return count($this->container); + } + + public function __debugInfo() + { + return array_map( + function ($item) { + if ($item instanceof Message || $item instanceof RepeatedField) { + return $item->__debugInfo(); + } + return $item; + }, + iterator_to_array($this) + ); + } +} + +class_alias(RepeatedField::class, Internal\RepeatedField::class); diff --git a/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php new file mode 100644 index 0000000..3cebbde --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php @@ -0,0 +1,73 @@ +google.protobuf.SourceContext + */ +class SourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + */ + protected $file_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $file_name + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @return string + */ + public function getFileName() + { + return $this->file_name; + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @param string $var + * @return $this + */ + public function setFileName($var) + { + GPBUtil::checkString($var, True); + $this->file_name = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/StringValue.php b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php new file mode 100644 index 0000000..f5b80dc --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php @@ -0,0 +1,71 @@ +google.protobuf.StringValue + */ +class StringValue extends \Google\Protobuf\Internal\Message +{ + /** + * The string value. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The string value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/Google/Protobuf/Struct.php new file mode 100644 index 0000000..0c433a9 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Struct.php @@ -0,0 +1,74 @@ +google.protobuf.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $fields + * Unordered map of dynamically typed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Syntax.php b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php new file mode 100644 index 0000000..90a75b7 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php @@ -0,0 +1,62 @@ +google.protobuf.Syntax + */ +class Syntax +{ + /** + * Syntax `proto2`. + * + * Generated from protobuf enum SYNTAX_PROTO2 = 0; + */ + const SYNTAX_PROTO2 = 0; + /** + * Syntax `proto3`. + * + * Generated from protobuf enum SYNTAX_PROTO3 = 1; + */ + const SYNTAX_PROTO3 = 1; + /** + * Syntax `editions`. + * + * Generated from protobuf enum SYNTAX_EDITIONS = 2; + */ + const SYNTAX_EDITIONS = 2; + + private static $valueToName = [ + self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2', + self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3', + self::SYNTAX_EDITIONS => 'SYNTAX_EDITIONS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php new file mode 100644 index 0000000..54d675c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php @@ -0,0 +1,187 @@ +google.protobuf.Timestamp + */ +class Timestamp extends \Google\Protobuf\Internal\TimestampBase +{ + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + */ + protected $seconds = 0; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * @type int $nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); + parent::__construct($data); + } + + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + * @return int|string + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Type.php new file mode 100644 index 0000000..ef37e77 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Type.php @@ -0,0 +1,286 @@ +google.protobuf.Type + */ +class Type extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + */ + private $fields; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + */ + private $oneofs; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + protected $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + */ + protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + */ + protected $edition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified message name. + * @type \Google\Protobuf\Field[] $fields + * The list of fields. + * @type string[] $oneofs + * The list of types appearing in `oneof` definitions in this type. + * @type \Google\Protobuf\Option[] $options + * The protocol buffer options. + * @type \Google\Protobuf\SourceContext $source_context + * The source context. + * @type int $syntax + * The source syntax. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @return RepeatedField<\Google\Protobuf\Field> + */ + public function getFields() + { + return $this->fields; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @param \Google\Protobuf\Field[] $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Field::class); + $this->fields = $arr; + + return $this; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @return RepeatedField + */ + public function getOneofs() + { + return $this->oneofs; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @param string[] $var + * @return $this + */ + public function setOneofs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->oneofs = $arr; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @return RepeatedField<\Google\Protobuf\Option> + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @param \Google\Protobuf\Option[] $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + * @return string + */ + public function getEdition() + { + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php new file mode 100644 index 0000000..028689f --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php @@ -0,0 +1,71 @@ +google.protobuf.UInt32Value + */ +class UInt32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $value + * The uint32 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php new file mode 100644 index 0000000..db52ec1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php @@ -0,0 +1,71 @@ +google.protobuf.UInt64Value + */ +class UInt64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The uint64 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Value.php b/vendor/google/protobuf/src/Google/Protobuf/Value.php new file mode 100644 index 0000000..85e4c1e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Value.php @@ -0,0 +1,245 @@ +google.protobuf.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $null_value + * Represents a null value. + * @type float $number_value + * Represents a double value. + * @type string $string_value + * Represents a string value. + * @type bool $bool_value + * Represents a boolean value. + * @type \Google\Protobuf\Struct $struct_value + * Represents a structured value. + * @type \Google\Protobuf\ListValue $list_value + * Represents a repeated `Value`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @return int + */ + public function getNullValue() + { + return $this->readOneof(1); + } + + public function hasNullValue() + { + return $this->hasOneof(1); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @param int $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(2); + } + + public function hasNumberValue() + { + return $this->hasOneof(2); + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructValue() + { + return $this->readOneof(5); + } + + public function hasStructValue() + { + return $this->hasOneof(5); + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @return \Google\Protobuf\ListValue|null + */ + public function getListValue() + { + return $this->readOneof(6); + } + + public function hasListValue() + { + return $this->hasOneof(6); + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @param \Google\Protobuf\ListValue $var + * @return $this + */ + public function setListValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/vendor/google/protobuf/src/phpdoc.dist.xml b/vendor/google/protobuf/src/phpdoc.dist.xml new file mode 100644 index 0000000..dd31302 --- /dev/null +++ b/vendor/google/protobuf/src/phpdoc.dist.xml @@ -0,0 +1,15 @@ + + + + + doc + + + doc + + + Google/Protobuf/Internal/MapField.php + Google/Protobuf/Internal/Message.php + Google/Protobuf/Internal/RepeatedField.php + + diff --git a/vendor/grpc/grpc/LICENSE b/vendor/grpc/grpc/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/vendor/grpc/grpc/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/vendor/grpc/grpc/MAINTAINERS.md b/vendor/grpc/grpc/MAINTAINERS.md new file mode 100644 index 0000000..975a694 --- /dev/null +++ b/vendor/grpc/grpc/MAINTAINERS.md @@ -0,0 +1,16 @@ +This page lists all active maintainers of this repository. If you were a +maintainer and would like to add your name to the Emeritus list, please send us a +PR. + +See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) +for governance guidelines and how to become a maintainer. +See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) +for general contribution guidelines. + +## Maintainers (in alphabetical order) +- [stanley-cheung](https://github.com/stanley-cheung), Google Inc. +- [wenbozhu](https://github.com/wenbozhu), Google Inc. +- [zhouyihaiding](https://github.com/zhouyihaiding), Google Inc. + +## Emeritus Maintainers (in alphabetical order) +- [murgatroid99](https://github.com/murgatroid99), Google Inc. diff --git a/vendor/grpc/grpc/README.md b/vendor/grpc/grpc/README.md new file mode 100644 index 0000000..293c27b --- /dev/null +++ b/vendor/grpc/grpc/README.md @@ -0,0 +1,9 @@ +# gRPC PHP Client Library + +This repository contains only PHP files to support Composer installation. + +This repository is a mirror of [gRPC](https://github.com/grpc/grpc). Any support +requests, bug reports, or development contributions should be directed to +that project. + +To install gRPC for PHP, please see https://github.com/grpc/grpc/tree/master/src/php diff --git a/vendor/grpc/grpc/composer.json b/vendor/grpc/grpc/composer.json new file mode 100644 index 0000000..a585b40 --- /dev/null +++ b/vendor/grpc/grpc/composer.json @@ -0,0 +1,24 @@ +{ + "name": "grpc/grpc", + "type": "library", + "description": "gRPC library for PHP", + "keywords": ["rpc"], + "homepage": "https://grpc.io", + "license": "Apache-2.0", + "version": "1.74.0", + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "google/auth": "^v1.3.0" + }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, + "autoload": { + "psr-4": { + "Grpc\\": "src/lib/" + } + } +} diff --git a/vendor/grpc/grpc/etc/roots.pem b/vendor/grpc/grpc/etc/roots.pem new file mode 100644 index 0000000..e5c84fa --- /dev/null +++ b/vendor/grpc/grpc/etc/roots.pem @@ -0,0 +1,4337 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Label: "GlobalSign Root CA" +# Serial: 4835703278459707669005204 +# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a +# SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c +# SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99 +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Label: "GlobalSign Root CA - R2" +# Serial: 4835703278459682885658125 +# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30 +# SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe +# SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Label: "Entrust.net Premium 2048 Secure Server CA" +# Serial: 946069240 +# MD5 Fingerprint: ee:29:31:bc:32:7e:9a:e6:e8:b5:f7:51:b4:34:71:90 +# SHA1 Fingerprint: 50:30:06:09:1d:97:d4:f5:ae:39:f7:cb:e7:92:7d:7d:65:2d:34:31 +# SHA256 Fingerprint: 6d:c4:71:72:e0:1c:bc:b0:bf:62:58:0d:89:5f:e2:b8:ac:9a:d4:f8:73:80:1e:0c:10:b9:c8:37:d2:1e:b1:77 +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 +MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub +j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo +U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b +u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ +bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er +fF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Label: "Baltimore CyberTrust Root" +# Serial: 33554617 +# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4 +# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74 +# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Label: "Entrust Root Certification Authority" +# Serial: 1164660820 +# MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4 +# SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9 +# SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 +Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW +KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw +NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw +NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy +ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV +BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo +Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 +4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 +KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI +rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi +94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB +sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi +gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo +kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE +vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t +O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua +AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP +9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ +eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m +0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +# Issuer: CN=AAA Certificate Services O=Comodo CA Limited +# Subject: CN=AAA Certificate Services O=Comodo CA Limited +# Label: "Comodo AAA Services root" +# Serial: 1 +# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0 +# SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49 +# SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4 +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 2 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 2 O=QuoVadis Limited +# Label: "QuoVadis Root CA 2" +# Serial: 1289 +# MD5 Fingerprint: 5e:39:7b:dd:f8:ba:ec:82:e9:ac:62:ba:0c:54:00:2b +# SHA1 Fingerprint: ca:3a:fb:cf:12:40:36:4b:44:b2:16:20:88:80:48:39:19:93:7c:f7 +# SHA256 Fingerprint: 85:a0:dd:7d:d7:20:ad:b7:ff:05:f8:3d:54:2b:20:9d:c7:ff:45:28:f7:d6:77:b1:83:89:fe:a5:e5:c4:9e:86 +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa +GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg +Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J +WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB +rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp ++ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 +ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i +Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz +PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og +/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH +oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI +yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud +EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 +A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL +MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f +BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn +g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl +fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K +WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha +B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc +hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR +TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD +mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z +ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y +4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza +8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 3" +# Serial: 1478 +# MD5 Fingerprint: 31:85:3c:62:94:97:63:b9:aa:fd:89:4e:af:6f:e0:cf +# SHA1 Fingerprint: 1f:49:14:f7:d8:74:95:1d:dd:ae:02:c0:be:fd:3a:2d:82:75:51:85 +# SHA256 Fingerprint: 18:f1:fc:7f:20:5d:f8:ad:dd:eb:7f:e0:07:dd:57:e3:af:37:5a:9c:4d:8d:73:54:6b:f4:f1:fe:d1:e1:8d:35 +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM +V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB +4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr +H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd +8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv +vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT +mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe +btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc +T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt +WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ +c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A +4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD +VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG +CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 +aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu +dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw +czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G +A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg +Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 +7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem +d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd ++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B +4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN +t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x +DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 +k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s +zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j +Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT +mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK +4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +# Issuer: O=SECOM Trust.net OU=Security Communication RootCA1 +# Subject: O=SECOM Trust.net OU=Security Communication RootCA1 +# Label: "Security Communication Root CA" +# Serial: 0 +# MD5 Fingerprint: f1:bc:63:6a:54:e0:b5:27:f5:cd:e7:1a:e3:4d:6e:4a +# SHA1 Fingerprint: 36:b1:2b:49:f9:81:9e:d7:4c:9e:bc:38:0f:c6:56:8f:5d:ac:b2:f7 +# SHA256 Fingerprint: e7:5e:72:ed:9f:56:0e:ec:6e:b4:80:00:73:a4:3f:c3:ad:19:19:5a:39:22:82:01:78:95:97:4a:99:02:6b:6c +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY +MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t +dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 +WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD +VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 +9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ +DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 +Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N +QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ +xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G +A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG +kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr +Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 +Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU +JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot +RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== +-----END CERTIFICATE----- + +# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Label: "XRamp Global CA Root" +# Serial: 107108908803651509692980124233745014957 +# MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1 +# SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6 +# SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2 +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Label: "Go Daddy Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67 +# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4 +# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4 +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh +MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE +YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 +MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo +ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg +MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN +ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA +PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w +wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi +EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY +avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ +YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE +sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h +/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 +IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy +OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P +TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER +dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf +ReYNnyicsbkqWletNw+vHX/bvZ8= +-----END CERTIFICATE----- + +# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Label: "Starfield Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24 +# SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a +# SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58 +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl +MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp +U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw +NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE +ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp +ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 +DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf +8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN ++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 +X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa +K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA +1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G +A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR +zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 +YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD +bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 +L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D +eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp +VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY +WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root CA" +# Serial: 17154717934120587862167794914071425081 +# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72 +# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43 +# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c +JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP +mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ +wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 +VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ +AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB +AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun +pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC +dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf +fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm +NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx +H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root CA" +# Serial: 10944719598952040374951832963794454346 +# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e +# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36 +# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61 +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB +CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 +nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt +43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P +T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 +gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR +TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw +DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr +hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg +06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF +PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls +YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert High Assurance EV Root CA" +# Serial: 3553400076410547919724730734378100087 +# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a +# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25 +# SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d0:0b:a6:ab:d7:80:6e:d3:b1:18:cf +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- + +# Issuer: CN=SwissSign Gold CA - G2 O=SwissSign AG +# Subject: CN=SwissSign Gold CA - G2 O=SwissSign AG +# Label: "SwissSign Gold CA - G2" +# Serial: 13492815561806991280 +# MD5 Fingerprint: 24:77:d9:a8:91:d1:3b:fa:88:2d:c2:ff:f8:cd:33:93 +# SHA1 Fingerprint: d8:c5:38:8a:b7:30:1b:1b:6e:d4:7a:e6:45:25:3a:6f:9f:1a:27:61 +# SHA256 Fingerprint: 62:dd:0b:e9:b9:f5:0a:16:3e:a0:f8:e7:5c:05:3b:1e:ca:57:ea:55:c8:68:8f:64:7c:68:81:f2:c8:35:7b:95 +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln +biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF +MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT +d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 +76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ +bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c +6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE +emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd +MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt +MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y +MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y +FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi +aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM +gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB +qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 +lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn +8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 +45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO +UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 +O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC +bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv +GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a +77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC +hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 +92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp +Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w +ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt +Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +# Issuer: CN=SwissSign Silver CA - G2 O=SwissSign AG +# Subject: CN=SwissSign Silver CA - G2 O=SwissSign AG +# Label: "SwissSign Silver CA - G2" +# Serial: 5700383053117599563 +# MD5 Fingerprint: e0:06:a1:c9:7d:cf:c9:fc:0d:c0:56:75:96:d8:62:13 +# SHA1 Fingerprint: 9b:aa:e5:9f:56:ee:21:cb:43:5a:be:25:93:df:a7:f0:40:d1:1d:cb +# SHA256 Fingerprint: be:6c:4d:a2:bb:b9:ba:59:b6:f3:93:97:68:37:42:46:c3:c0:05:99:3f:a9:8f:02:0d:1d:ed:be:d4:8a:81:d5 +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu +IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow +RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY +U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv +Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br +YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF +nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH +6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt +eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ +c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ +MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH +HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf +jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 +5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB +rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU +F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c +wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB +AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp +WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 +xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ +2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ +IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 +aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X +em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR +dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ +OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ +hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy +tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +# Issuer: CN=SecureTrust CA O=SecureTrust Corporation +# Subject: CN=SecureTrust CA O=SecureTrust Corporation +# Label: "SecureTrust CA" +# Serial: 17199774589125277788362757014266862032 +# MD5 Fingerprint: dc:32:c3:a7:6d:25:57:c7:68:09:9d:ea:2d:a9:a2:d1 +# SHA1 Fingerprint: 87:82:c6:c3:04:35:3b:cf:d2:96:92:d2:59:3e:7d:44:d9:34:ff:11 +# SHA256 Fingerprint: f1:c1:b5:0a:e5:a2:0d:d8:03:0e:c9:f6:bc:24:82:3d:d3:67:b5:25:57:59:b4:e7:1b:61:fc:e9:f7:37:5d:73 +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz +MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv +cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz +Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO +0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao +wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj +7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS +8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT +BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg +JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 +6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ +3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm +D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS +CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +# Issuer: CN=Secure Global CA O=SecureTrust Corporation +# Subject: CN=Secure Global CA O=SecureTrust Corporation +# Label: "Secure Global CA" +# Serial: 9751836167731051554232119481456978597 +# MD5 Fingerprint: cf:f4:27:0d:d4:ed:dc:65:16:49:6d:3d:da:bf:6e:de +# SHA1 Fingerprint: 3a:44:73:5a:e5:81:90:1f:24:86:61:46:1e:3b:9c:c4:5f:f5:3a:1b +# SHA256 Fingerprint: 42:00:f5:04:3a:c8:59:0e:bb:52:7d:20:9e:d1:50:30:29:fb:cb:d4:1c:a1:b5:06:ec:27:f1:5a:de:7d:ac:69 +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx +MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg +Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ +iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa +/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ +jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI +HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 +sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w +gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw +KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG +AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L +URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO +H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm +I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY +iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO Certification Authority O=COMODO CA Limited +# Label: "COMODO Certification Authority" +# Serial: 104350513648249232941998508985834464573 +# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75 +# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b +# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66 +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE----- + +# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Label: "Network Solutions Certificate Authority" +# Serial: 116697915152937497490437556386812487904 +# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e +# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce +# SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi +MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV +UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO +ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz +c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP +OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl +mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF +BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 +qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw +gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu +bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp +dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 +6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ +h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH +/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN +pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Label: "COMODO ECC Certification Authority" +# Serial: 41578283867086692638256921589707938090 +# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23 +# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11 +# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7 +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT +IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw +MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy +ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N +T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR +FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J +cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW +BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm +fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv +GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +# Issuer: CN=Certigna O=Dhimyotis +# Subject: CN=Certigna O=Dhimyotis +# Label: "Certigna" +# Serial: 18364802974209362175 +# MD5 Fingerprint: ab:57:a6:5b:7d:42:82:19:b5:d8:58:26:28:5e:fd:ff +# SHA1 Fingerprint: b1:2e:13:63:45:86:a4:6f:1a:b2:60:68:37:58:2d:c4:ac:fd:94:97 +# SHA256 Fingerprint: e3:b6:a2:db:2e:d7:ce:48:84:2f:7a:c5:32:41:c7:b7:1d:54:14:4b:fb:40:c1:1f:3f:1d:0b:42:f5:ee:a1:2d +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X +DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ +BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 +QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny +gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw +zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q +130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 +JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw +ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj +AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG +9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h +bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc +fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu +HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w +t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +# Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc +# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc +# Label: "Cybertrust Global Root" +# Serial: 4835703278459682877484360 +# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1 +# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6 +# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3 +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG +A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh +bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE +ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS +b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 +7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS +J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y +HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP +t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz +FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY +XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw +hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js +MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA +A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj +Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx +XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o +omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc +A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +# Issuer: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority +# Subject: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority +# Label: "ePKI Root Certification Authority" +# Serial: 28956088682735189655030529057352760477 +# MD5 Fingerprint: 1b:2e:00:ca:26:06:90:3d:ad:fe:6f:15:68:d3:6b:b3 +# SHA1 Fingerprint: 67:65:0d:f1:7e:8e:7e:5b:82:40:a4:f4:56:4b:cf:e2:3d:69:c6:f0 +# SHA256 Fingerprint: c0:a6:f4:dc:63:a2:4b:fd:cf:54:ef:2a:6a:08:2a:0a:72:de:35:80:3e:2f:f5:ff:52:7a:e5:d8:72:06:df:d5 +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe +MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 +ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw +IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL +SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH +SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh +ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X +DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 +TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ +fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA +sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU +WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS +nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH +dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip +NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC +AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF +MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB +uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl +PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP +JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ +gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 +j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 +5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB +o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS +/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z +Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE +W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D +hNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +# Issuer: O=certSIGN OU=certSIGN ROOT CA +# Subject: O=certSIGN OU=certSIGN ROOT CA +# Label: "certSIGN ROOT CA" +# Serial: 35210227249154 +# MD5 Fingerprint: 18:98:c0:d6:e9:3a:fc:f9:b0:f5:0c:f7:4b:01:44:17 +# SHA1 Fingerprint: fa:b7:ee:36:97:26:62:fb:2d:b0:2a:f6:bf:03:fd:e8:7c:4b:2f:9b +# SHA256 Fingerprint: ea:a9:62:c4:fa:4a:6b:af:eb:e4:15:19:6d:35:1c:cd:88:8d:4f:53:f3:fa:8a:e6:d7:c4:66:a9:4e:60:42:bb +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT +AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD +QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP +MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do +0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ +UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d +RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ +OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv +JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C +AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O +BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ +LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY +MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ +44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I +Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw +i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN +9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +# Issuer: CN=NetLock Arany (Class Gold) Főtanúsítvány O=NetLock Kft. OU=Tanúsítványkiadók (Certification Services) +# Subject: CN=NetLock Arany (Class Gold) Főtanúsítvány O=NetLock Kft. OU=Tanúsítványkiadók (Certification Services) +# Label: "NetLock Arany (Class Gold) Főtanúsítvány" +# Serial: 80544274841616 +# MD5 Fingerprint: c5:a1:b7:ff:73:dd:d6:d7:34:32:18:df:fc:3c:ad:88 +# SHA1 Fingerprint: 06:08:3f:59:3f:15:a1:04:a0:69:a4:6b:a9:03:d0:06:b7:97:09:91 +# SHA256 Fingerprint: 6c:61:da:c3:a2:de:f0:31:50:6b:e0:36:d2:a6:fe:40:19:94:fb:d1:3d:f9:c8:d4:66:59:92:74:c4:46:ec:98 +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG +EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 +MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR +dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB +pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM +b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm +aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz +IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT +lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz +AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 +VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG +ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 +BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG +AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M +U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh +bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C ++C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F +uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 +XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +# Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post +# Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post +# Label: "Hongkong Post Root CA 1" +# Serial: 1000 +# MD5 Fingerprint: a8:0d:6f:39:78:b9:43:6d:77:42:6d:98:5a:cc:23:ca +# SHA1 Fingerprint: d6:da:a8:20:8d:09:d2:15:4d:24:b5:2f:cb:34:6e:b2:58:b2:8a:58 +# SHA256 Fingerprint: f9:e6:7d:33:6c:51:00:2a:c0:54:c6:32:02:2d:66:dd:a2:e7:e3:ff:f1:0a:d0:61:ed:31:d8:bb:b4:10:cf:b2 +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx +FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg +Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG +A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr +b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ +jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn +PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh +ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 +nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h +q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED +MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC +mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 +7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB +oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs +EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO +fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi +AmvZWg== +-----END CERTIFICATE----- + +# Issuer: CN=SecureSign RootCA11 O=Japan Certification Services, Inc. +# Subject: CN=SecureSign RootCA11 O=Japan Certification Services, Inc. +# Label: "SecureSign RootCA11" +# Serial: 1 +# MD5 Fingerprint: b7:52:74:e2:92:b4:80:93:f2:75:e4:cc:d7:f2:ea:26 +# SHA1 Fingerprint: 3b:c4:9f:48:f8:f3:73:a0:9c:1e:bd:f8:5b:b1:c3:65:c7:d8:11:b3 +# SHA256 Fingerprint: bf:0f:ee:fb:9e:3a:58:1a:d5:f9:e9:db:75:89:98:57:43:d2:61:08:5c:4d:31:4f:6f:5d:72:59:aa:42:16:12 +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr +MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG +A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 +MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp +Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD +QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz +i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 +h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV +MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 +UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni +8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC +h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD +VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB +AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm +KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ +X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr +QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 +pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN +QSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +# Issuer: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd. +# Subject: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd. +# Label: "Microsec e-Szigno Root CA 2009" +# Serial: 14014712776195784473 +# MD5 Fingerprint: f8:49:f4:03:bc:44:2d:83:be:48:69:7d:29:64:fc:b1 +# SHA1 Fingerprint: 89:df:74:fe:5c:f4:0f:4a:80:f9:e3:37:7d:54:da:91:e1:01:31:8e +# SHA256 Fingerprint: 3c:5f:81:fe:a5:fa:b8:2c:64:bf:a2:ea:ec:af:cd:e8:e0:77:fc:86:20:a7:ca:e5:37:16:3d:f3:6e:db:f3:78 +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD +VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 +ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G +CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y +OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx +FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp +Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP +kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc +cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U +fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 +N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC +xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 ++rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM +Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG +SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h +mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk +ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c +2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t +HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Label: "GlobalSign Root CA - R3" +# Serial: 4835703278459759426209954 +# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28 +# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad +# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- + +# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 +# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 +# Label: "Autoridad de Certificacion Firmaprofesional CIF A62634068" +# Serial: 6047274297262753887 +# MD5 Fingerprint: 73:3a:74:7a:ec:bb:a3:96:a6:c2:e4:e2:c8:9b:c0:c3 +# SHA1 Fingerprint: ae:c5:fb:3f:c8:e1:bf:c4:e5:4f:03:07:5a:9a:e8:00:b7:f7:b6:fa +# SHA256 Fingerprint: 04:04:80:28:bf:1f:28:64:d4:8f:9a:d4:d8:32:94:36:6a:82:88:56:55:3f:3b:14:30:3f:90:14:7f:5d:40:ef +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE +BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h +cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy +MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg +Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 +thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM +cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG +L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i +NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h +X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b +m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy +Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja +EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T +KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF +6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh +OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD +VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv +ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl +AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF +661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 +am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 +ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 +PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS +3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k +SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF +3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM +ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g +StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz +Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB +jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +# Issuer: CN=Izenpe.com O=IZENPE S.A. +# Subject: CN=Izenpe.com O=IZENPE S.A. +# Label: "Izenpe.com" +# Serial: 917563065490389241595536686991402621 +# MD5 Fingerprint: a6:b0:cd:85:80:da:5c:50:34:a3:39:90:2f:55:67:73 +# SHA1 Fingerprint: 2f:78:3d:25:52:18:a7:4a:65:39:71:b5:2c:a2:9c:45:15:6f:e9:19 +# SHA256 Fingerprint: 25:30:cc:8e:98:32:15:02:ba:d9:6f:9b:1f:ba:1b:09:9e:2d:29:9e:0f:45:48:bb:91:4f:36:3b:c0:d4:53:1f +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 +MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 +ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD +VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j +b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq +scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO +xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H +LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX +uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD +yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ +JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q +rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN +BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L +hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB +QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ +HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu +Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg +QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB +BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA +A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb +laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 +awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo +JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw +LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT +VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk +LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb +UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ +QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ +naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls +QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Label: "Go Daddy Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01 +# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b +# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT +EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp +ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz +NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH +EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE +AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD +E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH +/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy +DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh +GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR +tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA +AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX +WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu +9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr +gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo +2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI +4uJEvlz36hz1 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96 +# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e +# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5 +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs +ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw +MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj +aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp +Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg +nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 +HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N +Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN +dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 +HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G +CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU +sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 +4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg +8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 +mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Services Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2 +# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f +# SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5 +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs +ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy +ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy +dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p +OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 +8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K +Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe +hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk +6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q +AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI +bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB +ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z +qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn +0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN +sSi6 +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Commercial O=AffirmTrust +# Subject: CN=AffirmTrust Commercial O=AffirmTrust +# Label: "AffirmTrust Commercial" +# Serial: 8608355977964138876 +# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7 +# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7 +# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7 +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Networking O=AffirmTrust +# Subject: CN=AffirmTrust Networking O=AffirmTrust +# Label: "AffirmTrust Networking" +# Serial: 8957382827206547757 +# MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f +# SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f +# SHA256 Fingerprint: 0a:81:ec:5a:92:97:77:f1:45:90:4a:f3:8d:5d:50:9f:66:b5:e2:c5:8f:cd:b5:31:05:8b:0e:17:f3:f0:b4:1b +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium O=AffirmTrust +# Subject: CN=AffirmTrust Premium O=AffirmTrust +# Label: "AffirmTrust Premium" +# Serial: 7893706540734352110 +# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57 +# SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27 +# SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust +# Subject: CN=AffirmTrust Premium ECC O=AffirmTrust +# Label: "AffirmTrust Premium ECC" +# Serial: 8401224907861490260 +# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d +# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb +# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23 +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- + +# Issuer: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Subject: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Label: "Certum Trusted Network CA" +# Serial: 279744 +# MD5 Fingerprint: d5:e9:81:40:c5:18:69:fc:46:2c:89:75:62:0f:aa:78 +# SHA1 Fingerprint: 07:e0:32:e0:20:b7:2c:3f:19:2f:06:28:a2:59:3a:19:a7:0f:06:9e +# SHA256 Fingerprint: 5c:58:46:8d:55:f5:8e:49:7e:74:39:82:d2:b5:00:10:b6:d1:65:37:4a:cf:83:a7:d4:a3:2d:b7:68:c4:40:8e +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM +MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D +ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU +cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 +WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg +Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw +IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH +UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM +TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU +BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM +kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x +AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV +HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y +sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL +I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 +J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY +VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +# Issuer: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA +# Subject: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA +# Label: "TWCA Root Certification Authority" +# Serial: 1 +# MD5 Fingerprint: aa:08:8f:f6:f9:7b:b7:f2:b1:a7:1e:9b:ea:ea:bd:79 +# SHA1 Fingerprint: cf:9e:87:6d:d3:eb:fc:42:26:97:a3:b5:a3:7a:a0:76:a9:06:23:48 +# SHA256 Fingerprint: bf:d8:8f:e1:10:1c:41:ae:3e:80:1b:f8:be:56:35:0e:e9:ba:d1:a6:b9:bd:51:5e:dc:5c:6d:5b:87:11:ac:44 +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES +MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU +V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz +WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO +LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE +AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH +K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX +RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z +rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx +3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq +hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC +MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls +XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D +lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn +aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ +YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2 +# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2 +# Label: "Security Communication RootCA2" +# Serial: 0 +# MD5 Fingerprint: 6c:39:7d:a4:0e:55:59:b2:3f:d6:41:b1:12:50:de:43 +# SHA1 Fingerprint: 5f:3b:8c:f2:f8:10:b3:7d:78:b4:ce:ec:19:19:c3:73:34:b9:c7:74 +# SHA256 Fingerprint: 51:3b:2c:ec:b8:10:d4:cd:e5:dd:85:39:1a:df:c6:c2:dd:60:d8:7b:b7:36:d2:b5:21:48:4a:a4:7a:0e:be:f6 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX +DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy +dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj +YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV +OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr +zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM +VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ +hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO +ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw +awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs +OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF +coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc +okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 +t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy +1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ +SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +# Issuer: CN=EC-ACC O=Agencia Catalana de Certificacio (NIF Q-0801176-I) OU=Serveis Publics de Certificacio/Vegeu https://www.catcert.net/verarrel (c)03/Jerarquia Entitats de Certificacio Catalanes +# Subject: CN=EC-ACC O=Agencia Catalana de Certificacio (NIF Q-0801176-I) OU=Serveis Publics de Certificacio/Vegeu https://www.catcert.net/verarrel (c)03/Jerarquia Entitats de Certificacio Catalanes +# Label: "EC-ACC" +# Serial: -23701579247955709139626555126524820479 +# MD5 Fingerprint: eb:f5:9d:29:0d:61:f9:42:1f:7c:c2:ba:6d:e3:15:09 +# SHA1 Fingerprint: 28:90:3a:63:5b:52:80:fa:e6:77:4c:0b:6d:a7:d6:ba:a6:4a:f2:e8 +# SHA256 Fingerprint: 88:49:7f:01:60:2f:31:54:24:6a:e2:8c:4d:5a:ef:10:f1:d8:7e:bb:76:62:6f:4a:e0:b7:f9:5b:a7:96:87:99 +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB +8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy +dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 +YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 +dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh +IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD +LUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG +EwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g +KE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD +ZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu +bmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg +ZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R +85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm +4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV +HMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd +QlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t +lGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB +o4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4 +opvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo +dHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW +ZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN +AQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y +/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k +SBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy +Rp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS +Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl +nJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI= +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions RootCA 2011" +# Serial: 0 +# MD5 Fingerprint: 73:9f:4c:4b:73:5b:79:e9:fa:ba:1c:ef:6e:cb:d5:c9 +# SHA1 Fingerprint: fe:45:65:9b:79:03:5b:98:a1:61:b5:51:2e:ac:da:58:09:48:22:4d +# SHA256 Fingerprint: bc:10:4f:15:a4:8b:e7:09:dc:a5:42:a7:e1:d4:b9:df:6f:05:45:27:e8:02:ea:a9:2d:59:54:44:25:8a:fe:71 +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix +RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p +YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw +NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK +EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl +cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz +dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ +fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns +bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD +75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP +FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV +HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp +5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu +b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA +A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p +6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 +dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys +Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI +l7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +# Issuer: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967 +# Subject: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967 +# Label: "Actalis Authentication Root CA" +# Serial: 6271844772424770508 +# MD5 Fingerprint: 69:c1:0d:4f:07:a3:1b:c3:fe:56:3d:04:bc:11:f6:a6 +# SHA1 Fingerprint: f3:73:b3:87:06:5a:28:84:8a:f2:f3:4a:ce:19:2b:dd:c7:8e:9c:ac +# SHA256 Fingerprint: 55:92:60:84:ec:96:3a:64:b9:6e:2a:be:01:ce:0b:a8:6a:64:fb:fe:bc:c7:aa:b5:af:c1:55:b3:7f:d7:60:66 +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +# Issuer: CN=Buypass Class 2 Root CA O=Buypass AS-983163327 +# Subject: CN=Buypass Class 2 Root CA O=Buypass AS-983163327 +# Label: "Buypass Class 2 Root CA" +# Serial: 2 +# MD5 Fingerprint: 46:a7:d2:fe:45:fb:64:5a:a8:59:90:9b:78:44:9b:29 +# SHA1 Fingerprint: 49:0a:75:74:de:87:0a:47:fe:58:ee:f6:c7:6b:eb:c6:0b:12:40:99 +# SHA256 Fingerprint: 9a:11:40:25:19:7c:5b:b9:5d:94:e6:3d:55:cd:43:79:08:47:b6:46:b2:3c:df:11:ad:a4:a0:0e:ff:15:fb:48 +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr +6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV +L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 +1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx +MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ +QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB +arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr +Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi +FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS +P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN +9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz +uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h +9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t +OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo ++fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 +KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 +DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us +H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ +I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 +5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h +3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz +Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= +-----END CERTIFICATE----- + +# Issuer: CN=Buypass Class 3 Root CA O=Buypass AS-983163327 +# Subject: CN=Buypass Class 3 Root CA O=Buypass AS-983163327 +# Label: "Buypass Class 3 Root CA" +# Serial: 2 +# MD5 Fingerprint: 3d:3b:18:9e:2c:64:5a:e8:d5:88:ce:0e:f9:37:c2:ec +# SHA1 Fingerprint: da:fa:f7:fa:66:84:ec:06:8f:14:50:bd:c7:c2:81:a5:bc:a9:64:57 +# SHA256 Fingerprint: ed:f7:eb:bc:a2:7a:2a:38:4d:38:7b:7d:40:10:c6:66:e2:ed:b4:84:3e:4c:29:b4:ae:1d:5b:93:32:e6:b2:4d +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y +ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E +N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 +tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX +0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c +/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X +KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY +zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS +O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D +34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP +K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv +Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj +QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS +IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 +HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa +O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv +033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u +dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE +kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 +3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD +u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq +4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= +-----END CERTIFICATE----- + +# Issuer: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Subject: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Label: "T-TeleSec GlobalRoot Class 3" +# Serial: 1 +# MD5 Fingerprint: ca:fb:40:a8:4e:39:92:8a:1d:fe:8e:2f:c4:27:ea:ef +# SHA1 Fingerprint: 55:a6:72:3e:cb:f2:ec:cd:c3:23:74:70:19:9d:2a:be:11:e3:81:d1 +# SHA256 Fingerprint: fd:73:da:d3:1c:64:4f:f1:b4:3b:ef:0c:cd:da:96:71:0b:9c:d9:87:5e:ca:7e:31:70:7a:f3:e9:6d:52:2b:bd +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN +8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ +RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 +hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 +ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM +EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 +A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy +WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ +1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 +6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT +91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p +TpPDpFQUWw== +-----END CERTIFICATE----- + +# Issuer: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH +# Subject: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH +# Label: "D-TRUST Root Class 3 CA 2 2009" +# Serial: 623603 +# MD5 Fingerprint: cd:e0:25:69:8d:47:ac:9c:89:35:90:f7:fd:51:3d:2f +# SHA1 Fingerprint: 58:e8:ab:b0:36:15:33:fb:80:f7:9b:1b:6d:29:d3:ff:8d:5f:00:f0 +# SHA256 Fingerprint: 49:e7:a4:42:ac:f0:ea:62:87:05:00:54:b5:25:64:b6:50:e4:f4:9e:42:e3:48:d6:aa:38:e0:39:e9:57:b1:c1 +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha +ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM +HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 +UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 +tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R +ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM +lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp +/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G +A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj +dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy +MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl +cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js +L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL +BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni +acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K +zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 +PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y +Johw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +# Issuer: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH +# Subject: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH +# Label: "D-TRUST Root Class 3 CA 2 EV 2009" +# Serial: 623604 +# MD5 Fingerprint: aa:c6:43:2c:5e:2d:cd:c4:34:c0:50:4f:11:02:4f:b6 +# SHA1 Fingerprint: 96:c9:1b:0b:95:b4:10:98:42:fa:d0:d8:22:79:fe:60:fa:b9:16:83 +# SHA256 Fingerprint: ee:c5:49:6b:98:8c:e9:86:25:b9:34:09:2e:ec:29:08:be:d0:b0:f3:16:c2:d4:73:0c:84:ea:f1:f3:d3:48:81 +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw +NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV +BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn +ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 +3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z +qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR +p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 +HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw +ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea +HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw +Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh +c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E +RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt +dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku +Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp +3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF +CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na +xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX +KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + +# Issuer: CN=CA Disig Root R2 O=Disig a.s. +# Subject: CN=CA Disig Root R2 O=Disig a.s. +# Label: "CA Disig Root R2" +# Serial: 10572350602393338211 +# MD5 Fingerprint: 26:01:fb:d8:27:a7:17:9a:45:54:38:1a:43:01:3b:03 +# SHA1 Fingerprint: b5:61:eb:ea:a4:de:e4:25:4b:69:1a:98:a5:57:47:c2:34:c7:d9:71 +# SHA256 Fingerprint: e2:3d:4a:03:6d:7b:70:e9:f5:95:b1:42:20:79:d2:b9:1e:df:bb:1f:b6:51:a0:63:3e:aa:8a:9d:c5:f8:07:03 +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy +MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe +NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH +PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I +x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe +QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR +yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO +QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 +H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ +QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD +i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs +nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 +rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI +hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf +GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb +lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka ++elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal +TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i +nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 +gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr +G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os +zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x +L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +# Issuer: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV +# Subject: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV +# Label: "ACCVRAIZ1" +# Serial: 6828503384748696800 +# MD5 Fingerprint: d0:a0:5a:ee:05:b6:09:94:21:a1:7d:f1:b2:29:82:02 +# SHA1 Fingerprint: 93:05:7a:88:15:c6:4f:ce:88:2f:fa:91:16:52:28:78:bc:53:64:17 +# SHA256 Fingerprint: 9a:6e:c0:12:e1:a7:da:9d:be:34:19:4d:47:8a:d7:c0:db:18:22:fb:07:1d:f1:29:81:49:6e:d1:04:38:41:13 +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE +AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw +CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ +BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND +VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb +qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY +HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo +G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA +lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr +IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ +0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH +k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 +4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO +m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa +cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl +uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI +KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls +ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG +AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT +VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG +CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA +cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA +QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA +7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA +cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA +QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA +czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu +aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt +aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud +DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF +BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp +D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU +JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m +AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD +vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms +tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH +7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA +h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF +d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H +pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- + +# Issuer: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA +# Subject: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA +# Label: "TWCA Global Root CA" +# Serial: 3262 +# MD5 Fingerprint: f9:03:7e:cf:e6:9e:3c:73:7a:2a:90:07:69:ff:2b:96 +# SHA1 Fingerprint: 9c:bb:48:53:f6:a4:f6:d3:52:a4:e8:32:52:55:60:13:f5:ad:af:65 +# SHA256 Fingerprint: 59:76:90:07:f7:68:5d:0f:cd:50:87:2f:9f:95:d5:75:5a:5b:2b:45:7d:81:f3:69:2b:61:0a:98:67:2f:0e:1b +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx +EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT +VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5 +NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT +B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF +10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz +0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh +MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH +zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc +46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1WKKD+u4ZqyPpcC1jcxkt2 +yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99sy2sbZCi +laLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYP +oA/pyJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQA +BDzfuBSO6N+pjWxnkjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcE +qYSjMq+u7msXi7Kx/mzhkIyIqJdIzshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm +4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6gcFGn90xHNcgL +1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF +H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo +RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+ +nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh +15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW +6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW +nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j +wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz +aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy +KwbQBM0= +-----END CERTIFICATE----- + +# Issuer: CN=TeliaSonera Root CA v1 O=TeliaSonera +# Subject: CN=TeliaSonera Root CA v1 O=TeliaSonera +# Label: "TeliaSonera Root CA v1" +# Serial: 199041966741090107964904287217786801558 +# MD5 Fingerprint: 37:41:49:1b:18:56:9a:26:f5:ad:c2:66:fb:40:a5:4c +# SHA1 Fingerprint: 43:13:bb:96:f1:d5:86:9b:c1:4e:6a:92:f6:cf:f6:34:69:87:82:37 +# SHA256 Fingerprint: dd:69:36:fe:21:f8:f0:77:c1:23:a1:a5:21:c1:22:24:f7:22:55:b7:3e:03:a7:26:06:93:e8:a2:4b:0f:a3:89 +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw +NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv +b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD +VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F +VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 +7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X +Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ +/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs +81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm +dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe +Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu +sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 +pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs +slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ +arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD +VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG +9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl +dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj +TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed +Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 +Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI +OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 +vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW +t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn +HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx +SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +# Issuer: CN=E-Tugra Certification Authority O=E-Tuğra EBG Bilişim Teknolojileri ve Hizmetleri A.Ş. OU=E-Tugra Sertifikasyon Merkezi +# Subject: CN=E-Tugra Certification Authority O=E-Tuğra EBG Bilişim Teknolojileri ve Hizmetleri A.Ş. OU=E-Tugra Sertifikasyon Merkezi +# Label: "E-Tugra Certification Authority" +# Serial: 7667447206703254355 +# MD5 Fingerprint: b8:a1:03:63:b0:bd:21:71:70:8a:6f:13:3a:bb:79:49 +# SHA1 Fingerprint: 51:c6:e7:08:49:06:6e:f3:92:d4:5c:a0:0d:6d:a3:62:8f:c3:52:39 +# SHA256 Fingerprint: b0:bf:d5:2b:b0:d7:d9:bd:92:bf:5d:4d:c1:3d:a2:55:c0:2c:54:2f:37:83:65:ea:89:39:11:f5:5e:55:f2:3c +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV +BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC +aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV +BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 +Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz +MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ +BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp +em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY +B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH +D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF +Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo +q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D +k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH +fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut +dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM +ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 +zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX +U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 +Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 +XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF +Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR +HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY +GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c +77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 ++GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK +vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 +FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl +yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P +AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD +y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d +NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +# Issuer: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Subject: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Label: "T-TeleSec GlobalRoot Class 2" +# Serial: 1 +# MD5 Fingerprint: 2b:9b:9e:e4:7b:6c:1f:00:72:1a:cc:c1:77:79:df:6a +# SHA1 Fingerprint: 59:0d:2d:7d:88:4f:40:2e:61:7e:a5:62:32:17:65:cf:17:d8:94:e9 +# SHA256 Fingerprint: 91:e2:f5:78:8d:58:10:eb:a7:ba:58:73:7d:e1:54:8a:8e:ca:cd:01:45:98:bc:0b:14:3e:04:1b:17:05:25:52 +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd +AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC +FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi +1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq +jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ +wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/ +WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy +NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC +uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw +IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6 +g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP +BSeOE6Fuwg== +-----END CERTIFICATE----- + +# Issuer: CN=Atos TrustedRoot 2011 O=Atos +# Subject: CN=Atos TrustedRoot 2011 O=Atos +# Label: "Atos TrustedRoot 2011" +# Serial: 6643877497813316402 +# MD5 Fingerprint: ae:b9:c4:32:4b:ac:7f:5d:66:cc:77:94:bb:2a:77:56 +# SHA1 Fingerprint: 2b:b1:f5:3e:55:0c:1d:c5:f1:d4:e6:b7:6a:46:4b:55:06:02:ac:21 +# SHA256 Fingerprint: f3:56:be:a2:44:b7:a9:1e:b3:5d:53:ca:9a:d7:86:4a:ce:01:8e:2d:35:d5:f8:f9:6d:df:68:a6:f4:1a:a4:74 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE +AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG +EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM +FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC +REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp +Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM +VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+ +SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ +4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L +cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi +eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG +A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3 +DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j +vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP +DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc +maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D +lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv +KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 1 G3" +# Serial: 687049649626669250736271037606554624078720034195 +# MD5 Fingerprint: a4:bc:5b:3f:fe:37:9a:fa:64:f0:e2:fa:05:3d:0b:ab +# SHA1 Fingerprint: 1b:8e:ea:57:96:29:1a:c9:39:ea:b8:0a:81:1a:73:73:c0:93:79:67 +# SHA256 Fingerprint: 8a:86:6f:d1:b2:76:b5:7e:57:8e:92:1c:65:82:8a:2b:ed:58:e9:f2:f2:88:05:41:34:b7:f1:f4:bf:c9:cc:74 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00 +MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakEPBtV +wedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWe +rNrwU8lmPNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF341 +68Xfuw6cwI2H44g4hWf6Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh +4Pw5qlPafX7PGglTvF0FBM+hSo+LdoINofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXp +UhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/lg6AnhF4EwfWQvTA9xO+o +abw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV7qJZjqlc +3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/G +KubX9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSt +hfbZxbGL0eUQMk1fiyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KO +Tk0k+17kBL5yG6YnLUlamXrXXAkgt3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOt +zCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZIhvcNAQELBQAD +ggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC +MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2 +cDMT/uFPpiN3GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUN +qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5 +YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv +b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2 +8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k +NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj +ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp +q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt +nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 2 G3" +# Serial: 390156079458959257446133169266079962026824725800 +# MD5 Fingerprint: af:0c:86:6e:bf:40:2d:7f:0b:3e:12:50:ba:12:3d:06 +# SHA1 Fingerprint: 09:3c:61:f3:8b:8b:dc:7d:55:df:75:38:02:05:00:e1:25:f5:c8:36 +# SHA256 Fingerprint: 8f:e4:fb:0a:f9:3a:4d:0d:67:db:0b:eb:b2:3e:37:c7:1b:f3:25:dc:bc:dd:24:0e:a0:4d:af:58:b4:7e:18:40 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00 +MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf +qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW +n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym +c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+ +O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1 +o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+lV0POKa2Mq1W/xPtbAd0j +IaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZoL1NesNKq +IcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz +8eQQsSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43eh +vNURG3YBZwjgQQvD6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l +7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALG +cC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD +ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 +AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC +roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga +W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n +lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE ++V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV +csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd +dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg +KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM +HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4 +WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 3 G3" +# Serial: 268090761170461462463995952157327242137089239581 +# MD5 Fingerprint: df:7d:b9:ad:54:6f:68:a1:df:89:57:03:97:43:b0:d7 +# SHA1 Fingerprint: 48:12:bd:92:3c:a8:c4:39:06:e7:30:6d:27:96:e6:a4:cf:22:2e:7d +# SHA256 Fingerprint: 88:ef:81:de:20:2e:b0:18:45:2e:43:f8:64:72:5c:ea:5f:bd:1f:c2:d9:d2:05:73:07:09:c5:d8:b8:69:0f:46 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00 +MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286IxSR +/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNu +FoM7pmRLMon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXR +U7Ox7sWTaYI+FrUoRqHe6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+c +ra1AdHkrAj80//ogaX3T7mH1urPnMNA3I4ZyYUUpSFlob3emLoG+B01vr87ERROR +FHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3UVDmrJqMz6nWB2i3ND0/k +A9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f75li59wzw +eyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634Ryl +sSqiMd5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBp +VzgeAVuNVejH38DMdyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0Q +A4XN8f+MFrXBsj6IbGB/kE+V9/YtrQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ +ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZIhvcNAQELBQAD +ggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px +KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnI +FUBhynLWcKzSt/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5Wvv +oxXqA/4Ti2Tk08HS6IT7SdEQTXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFg +u/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9DuDcpmvJRPpq3t/O5jrFc/ZSXPsoaP +0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGibIh6BJpsQBJFxwAYf +3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl +8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+ +DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN +PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ +ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root G2" +# Serial: 15385348160840213938643033620894905419 +# MD5 Fingerprint: 92:38:b9:f8:63:24:82:65:2c:57:33:e6:fe:81:8f:9d +# SHA1 Fingerprint: a1:4b:48:d9:43:ee:0a:0e:40:90:4f:3c:e0:a4:c0:91:93:51:5d:3f +# SHA256 Fingerprint: 7d:05:eb:b6:82:33:9f:8c:94:51:ee:09:4e:eb:fe:fa:79:53:a1:14:ed:b2:f4:49:49:45:2f:ab:7d:2f:c1:85 +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA +n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc +biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp +EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA +bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu +YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB +AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW +BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI +QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I +0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni +lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9 +B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv +ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root G3" +# Serial: 15459312981008553731928384953135426796 +# MD5 Fingerprint: 7c:7f:65:31:0c:81:df:8d:ba:3e:99:e2:5c:ad:6e:fb +# SHA1 Fingerprint: f5:17:a2:4f:9a:48:c6:c9:f8:a2:00:26:9f:dc:0f:48:2c:ab:30:89 +# SHA256 Fingerprint: 7e:37:cb:8b:4c:47:09:0c:ab:36:55:1b:a6:f4:5d:b8:40:68:0f:ba:16:6a:95:2d:b1:00:71:7f:43:05:3f:c2 +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg +RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf +Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q +RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD +AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY +JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv +6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root G2" +# Serial: 4293743540046975378534879503202253541 +# MD5 Fingerprint: e4:a6:8a:c8:54:ac:52:42:46:0a:fd:72:48:1b:2a:44 +# SHA1 Fingerprint: df:3c:24:f9:bf:d6:66:76:1b:26:80:73:fe:06:d1:cc:8d:4f:82:a4 +# SHA256 Fingerprint: cb:3c:cb:b7:60:31:e5:e0:13:8f:8d:d3:9a:23:f9:de:47:ff:c3:5e:43:c1:14:4c:ea:27:d4:6a:5a:b1:cb:5f +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH +MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI +2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx +1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ +q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz +tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ +vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV +5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY +1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 +NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG +Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 +8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe +pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root G3" +# Serial: 7089244469030293291760083333884364146 +# MD5 Fingerprint: f5:5d:a4:50:a5:fb:28:7e:1e:0f:0d:cc:96:57:56:ca +# SHA1 Fingerprint: 7e:04:de:89:6a:3e:66:6d:00:e6:87:d3:3f:fa:d9:3b:e8:3d:34:9e +# SHA256 Fingerprint: 31:ad:66:48:f8:10:41:38:c7:38:f3:9e:a4:32:01:33:39:3e:3a:18:cc:02:29:6e:f9:7c:2a:c9:ef:67:31:d0 +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe +Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw +EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x +IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF +K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG +fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO +Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd +BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx +AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/ +oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8 +sycX +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Trusted Root G4" +# Serial: 7451500558977370777930084869016614236 +# MD5 Fingerprint: 78:f2:fc:aa:60:1f:2f:b4:eb:c9:37:ba:53:2e:75:49 +# SHA1 Fingerprint: dd:fb:16:cd:49:31:c9:73:a2:03:7d:3f:c8:3a:4d:7d:77:5d:05:e4 +# SHA256 Fingerprint: 55:2f:7b:dc:f1:a7:af:9e:6c:e6:72:01:7f:4f:12:ab:f7:72:40:c7:8e:76:1a:c2:03:d1:d9:d2:0a:c8:99:88 +-----BEGIN CERTIFICATE----- +MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg +RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y +ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1If +xp4VpX6+n6lXFllVcq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDV +ySAdYyktzuxeTsiT+CFhmzTrBcZe7FsavOvJz82sNEBfsXpm7nfISKhmV1efVFiO +DCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGYQJB5w3jHtrHEtWoYOAMQ +jdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6MUSaM0C/ +CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCi +EhtmmnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADM +fRyVw4/3IbKyEbe7f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QY +uKZ3AeEPlAwhHbJUKSWJbOUOUlFHdL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXK +chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t +9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD +ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2 +SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd ++SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc +fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa +sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N +cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N +0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie +4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI +r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1 +/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm +gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ +-----END CERTIFICATE----- + +# Issuer: CN=COMODO RSA Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO RSA Certification Authority O=COMODO CA Limited +# Label: "COMODO RSA Certification Authority" +# Serial: 101909084537582093308941363524873193117 +# MD5 Fingerprint: 1b:31:b0:71:40:36:cc:14:36:91:ad:c4:3e:fd:ec:18 +# SHA1 Fingerprint: af:e5:d2:44:a8:d1:19:42:30:ff:47:9f:e2:f8:97:bb:cd:7a:8c:b4 +# SHA256 Fingerprint: 52:f0:e1:c4:e5:8e:c6:29:29:1b:60:31:7f:07:46:71:b8:5d:7e:a8:0d:5b:07:27:34:63:53:4b:32:b4:02:34 +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB +hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV +BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 +MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT +EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR +6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X +pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC +9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV +/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf +Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z ++pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w +qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah +SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC +u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf +Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq +crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E +FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB +/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl +wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM +4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV +2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna +FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ +CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK +boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke +jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL +S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb +QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl +0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB +NVOFBkpdn627G190 +-----END CERTIFICATE----- + +# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Label: "USERTrust RSA Certification Authority" +# Serial: 2645093764781058787591871645665788717 +# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5 +# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e +# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2 +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB +iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl +cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV +BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw +MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV +BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B +3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY +tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/ +Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2 +VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT +79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6 +c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT +Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l +c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee +UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE +Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd +BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF +Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO +VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3 +ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs +8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR +iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze +Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ +XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/ +qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB +VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB +L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG +jjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +# Issuer: CN=USERTrust ECC Certification Authority O=The USERTRUST Network +# Subject: CN=USERTrust ECC Certification Authority O=The USERTRUST Network +# Label: "USERTrust ECC Certification Authority" +# Serial: 123013823720199481456569720443997572134 +# MD5 Fingerprint: fa:68:bc:d9:b5:7f:ad:fd:c9:1d:06:83:28:cc:24:c1 +# SHA1 Fingerprint: d1:cb:ca:5d:b2:d5:2a:7f:69:3b:67:4d:e5:f0:5a:1d:0c:95:7d:f0 +# SHA256 Fingerprint: 4f:f4:60:d5:4b:9c:86:da:bf:bc:fc:57:12:e0:40:0d:2b:ed:3f:bc:4d:4f:bd:aa:86:e0:6a:dc:d2:a9:ad:7a +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDEL +MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl +eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMT +JVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAx +MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT +Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUg +VVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqflo +I+d61SRvU8Za2EurxtW20eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinng +o4N+LZfQYcTxmdwlkWOrfzCjtHDix6EznPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0G +A1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMB +zzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbW +RNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4 +# Label: "GlobalSign ECC Root CA - R4" +# Serial: 14367148294922964480859022125800977897474 +# MD5 Fingerprint: 20:f0:27:68:d1:7e:a0:9d:0e:e6:2a:ca:df:5c:89:8e +# SHA1 Fingerprint: 69:69:56:2e:40:80:f4:24:a1:e7:19:9f:14:ba:f3:ee:58:ab:6a:bb +# SHA256 Fingerprint: be:c9:49:11:c2:95:56:76:db:6c:0a:55:09:86:d7:6e:3b:a0:05:66:7c:44:2c:97:62:b4:fb:b7:73:de:22:8c +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ +FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F +uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX +kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs +ewv4n4Q= +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5 +# Label: "GlobalSign ECC Root CA - R5" +# Serial: 32785792099990507226680698011560947931244 +# MD5 Fingerprint: 9f:ad:3b:1c:02:1e:8a:ba:17:74:38:81:0c:a2:bc:08 +# SHA1 Fingerprint: 1f:24:c6:30:cd:a4:18:ef:20:69:ff:ad:4f:dd:5f:46:3a:1b:69:aa +# SHA256 Fingerprint: 17:9f:bc:14:8a:3d:d0:0f:d2:4e:a1:34:58:cc:43:bf:a7:f5:9c:81:82:d7:83:a5:13:f6:eb:ec:10:0c:89:24 +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc +8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke +hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI +KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg +515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO +xwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +# Issuer: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden +# Subject: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden +# Label: "Staat der Nederlanden EV Root CA" +# Serial: 10000013 +# MD5 Fingerprint: fc:06:af:7b:e8:1a:f1:9a:b4:e8:d2:70:1f:c0:f5:ba +# SHA1 Fingerprint: 76:e2:7e:c1:4f:db:82:c1:c0:a6:75:b5:05:be:3d:29:b4:ed:db:bb +# SHA256 Fingerprint: 4d:24:91:41:4c:fe:95:67:46:ec:4c:ef:a6:cf:6f:72:e2:8a:13:29:43:2f:9d:8a:90:7a:c4:cb:5d:ad:c1:5a +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y +MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg +TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS +b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS +M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC +UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d +Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p +rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l +pJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gVXJrm0w912fxBmJc+qiXb +j5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr08C+eKxC +KFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS +/ZbV0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0X +cgOPvZuM5l5Tnrmd74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH +1vI4gnPah1vlPNOePqc7nvQDs/nxfRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrP +px9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwaivsnuL8wbqg7 +MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u +2dfOWBfoqSmuc0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHS +v4ilf0X8rLiltTMMgsT7B/Zq5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTC +wPTxGfARKbalGAKb12NMcIxHowNDXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy +CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e +vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6 +Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa +Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL +eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8 +FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc +7uzXLg== +-----END CERTIFICATE----- + +# Issuer: CN=IdenTrust Commercial Root CA 1 O=IdenTrust +# Subject: CN=IdenTrust Commercial Root CA 1 O=IdenTrust +# Label: "IdenTrust Commercial Root CA 1" +# Serial: 13298821034946342390520003877796839426 +# MD5 Fingerprint: b3:3e:77:73:75:ee:a0:d3:e3:7e:49:63:49:59:bb:c7 +# SHA1 Fingerprint: df:71:7e:aa:4a:d9:4e:c9:55:84:99:60:2d:48:de:5f:bc:f0:3a:25 +# SHA256 Fingerprint: 5d:56:49:9b:e4:d2:e0:8b:cf:ca:d0:8a:3e:38:72:3d:50:50:3b:de:70:69:48:e4:2f:55:60:30:19:e5:28:ae +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu +VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw +MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw +JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT +3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU ++ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp +S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1 +bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi +T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL +vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK +Vsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZK +dHzVWYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHT +c+XvvqDtMwt0viAgxGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hv +l7yTmvmcEpB4eoCHFddydJxVdHixuuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5N +iGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZIhvcNAQELBQAD +ggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH +6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwt +LRvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93 +nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3 ++wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK +W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT +AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq +l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG +4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ +mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A +7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +# Issuer: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust +# Subject: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust +# Label: "IdenTrust Public Sector Root CA 1" +# Serial: 13298821034946342390521976156843933698 +# MD5 Fingerprint: 37:06:a5:b0:fc:89:9d:ba:f4:6b:8c:1a:64:cd:d5:ba +# SHA1 Fingerprint: ba:29:41:60:77:98:3f:f4:f3:ef:f2:31:05:3b:2e:ea:6d:4d:45:fd +# SHA256 Fingerprint: 30:d0:89:5a:9a:44:8a:26:20:91:63:55:22:d1:f5:20:10:b5:86:7a:ca:e1:2c:78:ef:95:8f:d4:f4:38:9f:2f +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu +VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN +MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0 +MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7 +ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy +RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS +bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF +/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R +3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw +EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy +9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V +GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ +2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV +WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD +W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN +AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV +DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9 +TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G +lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW +mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df +WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5 ++bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ +tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA +GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv +8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only +# Subject: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only +# Label: "Entrust Root Certification Authority - G2" +# Serial: 1246989352 +# MD5 Fingerprint: 4b:e2:c9:91:96:65:0c:f4:0e:5a:93:92:a0:0a:fe:b2 +# SHA1 Fingerprint: 8c:f4:27:fd:79:0c:3a:d1:66:06:8d:e8:1e:57:ef:bb:93:22:72:d4 +# SHA256 Fingerprint: 43:df:57:74:b0:3e:7f:ef:5f:e4:0d:93:1a:7b:ed:f1:bb:2e:6b:42:73:8c:4e:6d:38:41:10:3d:3a:a7:f3:39 +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50 +cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs +IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz +dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy +NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu +dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt +dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0 +aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T +RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN +cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW +wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1 +U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0 +jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN +BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/ +jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v +1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R +nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH +VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g== +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only +# Subject: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only +# Label: "Entrust Root Certification Authority - EC1" +# Serial: 51543124481930649114116133369 +# MD5 Fingerprint: b6:7e:1d:f0:58:c5:49:6c:24:3b:3d:ed:98:18:ed:bc +# SHA1 Fingerprint: 20:d8:06:40:df:9b:25:f5:12:25:3a:11:ea:f7:59:8a:eb:14:b5:47 +# SHA256 Fingerprint: 02:ed:0e:b2:8c:14:da:45:16:5c:56:67:91:70:0d:64:51:d7:fb:56:f0:b2:ab:1d:3b:8e:b0:70:e5:6e:df:f5 +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG +A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3 +d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu +dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq +RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy +MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD +VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 +L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g +Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi +A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt +ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH +Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC +R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX +hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G +-----END CERTIFICATE----- + +# Issuer: CN=CFCA EV ROOT O=China Financial Certification Authority +# Subject: CN=CFCA EV ROOT O=China Financial Certification Authority +# Label: "CFCA EV ROOT" +# Serial: 407555286 +# MD5 Fingerprint: 74:e1:b6:ed:26:7a:7a:44:30:33:94:ab:7b:27:81:30 +# SHA1 Fingerprint: e2:b8:29:4b:55:84:ab:6b:58:c2:90:46:6c:ac:3f:b8:39:8f:84:83 +# SHA256 Fingerprint: 5c:c3:d7:8e:4e:1d:5e:45:54:7a:04:e6:87:3e:64:f9:0c:f9:53:6d:1c:cc:2e:f8:00:f3:55:c4:c5:fd:70:fd +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD +TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx +MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j +aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP +T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03 +sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL +TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5 +/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp +7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRz +EpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgt +hxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IGvP +a931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqot +aK8KgWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNg +TnYGmE69g60dWIolhdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfV +PKPtl8MeNPo4+QgO48BdK4PRVmrJtqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hv +cWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAfBgNVHSMEGDAWgBTj/i39KNAL +tbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAd +BgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB +ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObT +ej/tUxPQ4i9qecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdL +jOztUmCypAbqTuv0axn96/Ua4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBS +ESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sGE5uPhnEFtC+NiWYzKXZUmhH4J/qy +P5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfXBDrDMlI1Dlb4pd19 +xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjnaH9d +Ci77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN +5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe +/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z +AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ +5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +# Issuer: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed +# Subject: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed +# Label: "OISTE WISeKey Global Root GB CA" +# Serial: 157768595616588414422159278966750757568 +# MD5 Fingerprint: a4:eb:b9:61:28:2e:b7:2f:98:b0:35:26:90:99:51:1d +# SHA1 Fingerprint: 0f:f9:40:76:18:d3:d7:6a:4b:98:f0:a8:35:9e:0c:fd:27:ac:cc:ed +# SHA256 Fingerprint: 6b:9c:08:e8:6e:b0:f7:67:cf:ad:65:cd:98:b6:21:49:e5:49:4a:67:f5:84:5e:7b:d1:ed:01:9f:27:b8:6b:d6 +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBt +MQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUg +Rm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9i +YWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0x +CzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBG +b3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh +bCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3 +HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGx +WuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX +1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNk +u7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P +99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9r +M2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUB +BAMCAQAwDQYJKoZIhvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrgh +cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5 +gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO +ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf +aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- + +# Issuer: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A. +# Subject: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A. +# Label: "SZAFIR ROOT CA2" +# Serial: 357043034767186914217277344587386743377558296292 +# MD5 Fingerprint: 11:64:c1:89:b0:24:b1:8c:b1:07:7e:89:9e:51:9e:99 +# SHA1 Fingerprint: e2:52:fa:95:3f:ed:db:24:60:bd:6e:28:f3:9c:cc:cf:5e:b3:3f:de +# SHA256 Fingerprint: a1:33:9d:33:28:1a:0b:56:e5:57:d3:d3:2b:1c:e7:f9:36:7e:b0:94:bd:5f:a7:2a:7e:50:04:c8:de:d7:ca:fe +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQEL +BQAwUTELMAkGA1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6 +ZW5pb3dhIFMuQS4xGDAWBgNVBAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkw +NzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L +cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYDVQQDDA9TWkFGSVIg +Uk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5QqEvN +QLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT +3PSQ1hNKDJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw +3gAeqDRHu5rr/gsUvTaE2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr6 +3fE9biCloBK0TXC5ztdyO4mTp4CEHCdJckm1/zuVnsHMyAHs6A6KCpbns6aH5db5 +BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHN +XGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF +AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw +8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG +nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP +oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy +d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg +LvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +# Issuer: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Subject: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Label: "Certum Trusted Network CA 2" +# Serial: 44979900017204383099463764357512596969 +# MD5 Fingerprint: 6d:46:9e:d9:25:6d:08:23:5b:5e:74:7d:1e:27:db:f2 +# SHA1 Fingerprint: d3:dd:48:3e:2b:bf:4c:05:e8:af:10:f5:fa:76:26:cf:d3:dc:30:92 +# SHA256 Fingerprint: b6:76:f2:ed:da:e8:77:5c:d3:6c:b0:f6:3c:d1:d4:60:39:61:f4:9e:62:65:ba:01:3a:2f:03:07:b6:d0:b8:04 +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB +gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu +QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG +A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgz +OTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZ +VW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3 +b3JrIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWA +DGSdhhuWZGc/IjoedQF97/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn +0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+oCgCXhVqqndwpyeI1B+twTUrWwbNWuKFB +OJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40bRr5HMNUuctHFY9rnY3lE +fktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2puTRZCr+E +Sv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1m +o130GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02i +sx7QBlrd9pPPV3WZ9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOW +OZV7bIBaTxNyxtd9KXpEulKkKtVBRgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgez +Tv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pyehizKV/Ma5ciSixqClnrDvFAS +adgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vMBhBgu4M1t15n +3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQ +F/xlhMcQSZDe28cmk4gmb3DWAl45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTf +CVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuAL55MYIR4PSFk1vtBHxgP58l1cb29 +XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMoclm2q8KMZiYcdywm +djWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tMpkT/ +WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jb +AoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq +P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Ko +b7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj +XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P +5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi +DrW5viSP +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions RootCA 2015" +# Serial: 0 +# MD5 Fingerprint: ca:ff:e2:db:03:d9:cb:4b:e9:0f:ad:84:fd:7b:18:ce +# SHA1 Fingerprint: 01:0c:06:95:a6:98:19:14:ff:bf:5f:c6:b0:b6:95:ea:29:e9:12:a6 +# SHA256 Fingerprint: a0:40:92:9a:02:ce:53:b4:ac:f4:f2:ff:c6:98:1c:e4:49:6f:75:5e:6d:45:fe:0b:2a:69:2b:cd:52:52:3f:36 +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix +DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k +IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT +N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v +dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG +A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh +ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkx +QDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgUm9vdENBIDIwMTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDC+Kk/G4n8PDwEXT2QNrCROnk8ZlrvbTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA +4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+ehiGsxr/CL0BgzuNtFajT0 +AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+6PAQZe10 +4S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06C +ojXdFPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV +9Cz82XBST3i4vTwri5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrD +gfgXy5I2XdGj2HUb4Ysn6npIQf1FGQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6 +Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2fu/Z8VFRfS0myGlZYeCsargq +NhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9muiNX6hME6wGko +LfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc +Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVd +ctA4GGqd83EkVAswDQYJKoZIhvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0I +XtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMI +M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot +9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V +Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea +j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh +X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ +l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf +bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4 +pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK +e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0 +vm9qp/UsQu0yrbYhnr68 +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions ECC RootCA 2015" +# Serial: 0 +# MD5 Fingerprint: 81:e5:b4:17:eb:c2:f5:e1:4b:0d:41:7b:49:92:fe:ef +# SHA1 Fingerprint: 9f:f1:71:8d:92:d5:9a:f3:7d:74:97:b4:bc:6f:84:68:0b:ba:b6:66 +# SHA256 Fingerprint: 44:b5:45:aa:8a:25:e6:5a:73:ca:15:dc:27:fc:36:d2:4c:1c:b9:95:3a:06:65:39:b1:15:82:dc:48:7b:48:33 +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN +BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl +bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv +b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ +BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj +YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5 +MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0 +dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg +QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa +jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi +C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep +lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof +TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR +-----END CERTIFICATE----- + +# Issuer: CN=ISRG Root X1 O=Internet Security Research Group +# Subject: CN=ISRG Root X1 O=Internet Security Research Group +# Label: "ISRG Root X1" +# Serial: 172886928669790476064670243504169061120 +# MD5 Fingerprint: 0c:d2:f9:e0:da:17:73:e9:ed:86:4d:a5:e3:70:e7:4e +# SHA1 Fingerprint: ca:bd:2a:79:a1:07:6a:31:f2:1d:25:36:35:cb:03:9d:43:29:a5:e8 +# SHA256 Fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6 +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- + +# Issuer: O=FNMT-RCM OU=AC RAIZ FNMT-RCM +# Subject: O=FNMT-RCM OU=AC RAIZ FNMT-RCM +# Label: "AC RAIZ FNMT-RCM" +# Serial: 485876308206448804701554682760554759 +# MD5 Fingerprint: e2:09:04:b4:d3:bd:d1:a0:14:fd:1a:d2:47:c4:57:1d +# SHA1 Fingerprint: ec:50:35:07:b2:15:c4:95:62:19:e2:a8:9a:5b:42:99:2c:4c:2c:20 +# SHA256 Fingerprint: eb:c5:57:0c:29:01:8c:4d:67:b1:aa:12:7b:af:12:f7:03:b4:61:1e:bc:17:b7:da:b5:57:38:94:17:9b:93:fa +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx +CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ +WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ +BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG +Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/ +yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf +BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz +WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF +tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z +374jNUUeAlz+taibmSXaXvMiwzn15Cou08YfxGyqxRxqAQVKL9LFwag0Jl1mpdIC +IfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mwWsXmo8RZZUc1g16p6DUL +mbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnTtOmlcYF7 +wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peS +MKGJ47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2 +ZSysV4999AeU14ECll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMet +UqIJ5G+GR4of6ygnXYMgrwTJbFaai0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPd9xf3E6Jobd2Sn9R2gzL+H +YJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3 +LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD +nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1 +RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM +LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf +77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N +JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm +fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp +6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp +1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B +9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok +RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv +uu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 1 O=Amazon +# Subject: CN=Amazon Root CA 1 O=Amazon +# Label: "Amazon Root CA 1" +# Serial: 143266978916655856878034712317230054538369994 +# MD5 Fingerprint: 43:c6:bf:ae:ec:fe:ad:2f:18:c6:88:68:30:fc:c8:e6 +# SHA1 Fingerprint: 8d:a7:f9:65:ec:5e:fc:37:91:0f:1c:6e:59:fd:c1:cc:6a:6e:de:16 +# SHA256 Fingerprint: 8e:cd:e6:88:4f:3d:87:b1:12:5b:a3:1a:c3:fc:b1:3d:70:16:de:7f:57:cc:90:4f:e1:cb:97:c6:ae:98:19:6e +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj +ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM +9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw +IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 +VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L +93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm +jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA +A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI +U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs +N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv +o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU +5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy +rqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 2 O=Amazon +# Subject: CN=Amazon Root CA 2 O=Amazon +# Label: "Amazon Root CA 2" +# Serial: 143266982885963551818349160658925006970653239 +# MD5 Fingerprint: c8:e5:8d:ce:a8:42:e2:7a:c0:2a:5c:7c:9e:26:bf:66 +# SHA1 Fingerprint: 5a:8c:ef:45:d7:a6:98:59:76:7a:8c:8b:44:96:b5:78:cf:47:4b:1a +# SHA256 Fingerprint: 1b:a5:b2:aa:8c:65:40:1a:82:96:01:18:f8:0b:ec:4f:62:30:4d:83:ce:c4:71:3a:19:c3:9c:01:1e:a4:6d:b4 +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK +gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ +W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg +1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K +8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r +2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me +z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR +8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj +mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz +7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6 ++XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI +0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB +Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm +UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2 +LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY ++gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS +k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl +7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm +btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl +urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+ +fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63 +n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE +76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H +9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT +4PsJYGw= +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 3 O=Amazon +# Subject: CN=Amazon Root CA 3 O=Amazon +# Label: "Amazon Root CA 3" +# Serial: 143266986699090766294700635381230934788665930 +# MD5 Fingerprint: a0:d4:ef:0b:f7:b5:d8:49:95:2a:ec:f5:c4:fc:81:87 +# SHA1 Fingerprint: 0d:44:dd:8c:3c:8c:1a:1a:58:75:64:81:e9:0f:2e:2a:ff:b3:d2:6e +# SHA256 Fingerprint: 18:ce:6c:fe:7b:f1:4e:60:b2:e3:47:b8:df:e8:68:cb:31:d0:2e:bb:3a:da:27:15:69:f5:03:43:b4:6d:b3:a4 +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl +ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr +ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr +BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM +YyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 4 O=Amazon +# Subject: CN=Amazon Root CA 4 O=Amazon +# Label: "Amazon Root CA 4" +# Serial: 143266989758080763974105200630763877849284878 +# MD5 Fingerprint: 89:bc:27:d5:eb:17:8d:06:6a:69:d5:fd:89:47:b4:cd +# SHA1 Fingerprint: f6:10:84:07:d6:f8:bb:67:98:0c:c2:e2:44:c2:eb:ae:1c:ef:63:be +# SHA256 Fingerprint: e3:5d:28:41:9e:d0:20:25:cf:a6:90:38:cd:62:39:62:45:8d:a5:c6:95:fb:de:a3:c2:2b:0b:fb:25:89:70:92 +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi +9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk +M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB +MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw +CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW +1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +# Issuer: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM +# Subject: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM +# Label: "TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1" +# Serial: 1 +# MD5 Fingerprint: dc:00:81:dc:69:2f:3e:2f:b0:3b:f6:3d:5a:91:8e:49 +# SHA1 Fingerprint: 31:43:64:9b:ec:ce:27:ec:ed:3a:3f:0b:8f:0d:e4:e8:91:dd:ee:ca +# SHA256 Fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx +GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp +bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w +KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0 +BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy +dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG +EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll +IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU +QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT +TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg +LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7 +a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr +LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr +N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X +YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/ +iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f +AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH +V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh +AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf +IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4 +lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c +8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf +lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +# Issuer: CN=GDCA TrustAUTH R5 ROOT O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD. +# Subject: CN=GDCA TrustAUTH R5 ROOT O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD. +# Label: "GDCA TrustAUTH R5 ROOT" +# Serial: 9009899650740120186 +# MD5 Fingerprint: 63:cc:d9:3d:34:35:5c:6f:53:a3:e2:08:70:48:1f:b4 +# SHA1 Fingerprint: 0f:36:38:5b:81:1a:25:c3:9b:31:4e:83:ca:e9:34:66:70:cc:74:b4 +# SHA256 Fingerprint: bf:ff:8f:d0:44:33:48:7d:6a:8a:a6:0c:1a:29:76:7a:9f:c2:bb:b0:5e:42:0f:71:3a:13:b9:92:89:1d:38:93 +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UE +BhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ +IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0 +MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVowYjELMAkGA1UEBhMCQ04xMjAwBgNV +BAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8w +HQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJj +Dp6L3TQsAlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBj +TnnEt1u9ol2x8kECK62pOqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+u +KU49tm7srsHwJ5uu4/Ts765/94Y9cnrrpftZTqfrlYwiOXnhLQiPzLyRuEH3FMEj +qcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ9Cy5WmYqsBebnh52nUpm +MUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQxXABZG12 +ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloP +zgsMR6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3Gk +L30SgLdTMEZeS1SZD2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeC +jGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4oR24qoAATILnsn8JuLwwoC8N9VKejveSswoA +HQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx9hoh49pwBiFYFIeFd3mqgnkC +AwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlRMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg +p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZm +DRd9FBUb1Ov9H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5 +COmSdI31R9KrO9b7eGZONn356ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ry +L3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd+PwyvzeG5LuOmCd+uh8W4XAR8gPf +JWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQHtZa37dG/OaG+svg +IHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBDF8Io +2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV +09tL7ECQ8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQ +XR4EzzffHqhmsYzmIGrv/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrq +T8p+ck0LcIymSLumoRT2+1hEmRSuqguTaaApJUqlyyvdimYHFngVV3Eb7PVHhPOe +MTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor RootCert CA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor RootCert CA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor RootCert CA-1" +# Serial: 15752444095811006489 +# MD5 Fingerprint: 6e:85:f1:dc:1a:00:d3:22:d5:b2:b2:ac:6b:37:05:45 +# SHA1 Fingerprint: ff:bd:cd:e7:82:c8:43:5e:3c:6f:26:86:5c:ca:a8:3a:45:5b:c3:0a +# SHA256 Fingerprint: d4:0e:9c:86:cd:8f:e4:68:c1:77:69:59:f4:9e:a7:74:fa:54:86:84:b6:c4:06:f3:90:92:61:f4:dc:e2:57:5c +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29y +IFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkxMjMxMTcyMzE2WjCB +pDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFuYW1h +IENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUG +A1UECwweVHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZU +cnVzdENvciBSb290Q2VydCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAv463leLCJhJrMxnHQFgKq1mqjQCj/IDHUHuO1CAmujIS2CNUSSUQIpid +RtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4pQa81QBeCQryJ3pS/C3V +seq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0JEsq1pme +9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CV +EY4hgLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorW +hnAbJN7+KIor0Gqw/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/ +DeOxCbeKyKsZn3MzUOcwHwYDVR0jBBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQAD +ggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5mDo4Nvu7Zp5I +/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf +ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZ +yonnMlo2HD6CqFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djts +L1Ac59v2Z3kf9YKVmgenFK+P3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdN +zl/HHk484IkzlQsPpTLWPFp5LBk= +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor RootCert CA-2 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor RootCert CA-2 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor RootCert CA-2" +# Serial: 2711694510199101698 +# MD5 Fingerprint: a2:e1:f8:18:0b:ba:45:d5:c7:41:2a:bb:37:52:45:64 +# SHA1 Fingerprint: b8:be:6d:cb:56:f1:55:b9:63:d4:12:ca:4e:06:34:c7:94:b2:1c:c0 +# SHA256 Fingerprint: 07:53:e9:40:37:8c:1b:d5:e3:83:6e:39:5d:ae:a5:cb:83:9e:50:46:f1:bd:0e:ae:19:51:cf:10:fe:c7:c9:65 +-----BEGIN CERTIFICATE----- +MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEfMB0GA1UEAwwWVHJ1c3RDb3Ig +Um9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEyMzExNzI2MzlaMIGk +MQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEg +Q2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYD +VQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRy +dXN0Q29yIFJvb3RDZXJ0IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCnIG7CKqJiJJWQdsg4foDSq8GbZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+ +QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9NkRvRUqdw6VC0xK5mC8tkq +1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1oYxOdqHp +2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nK +DOObXUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hape +az6LMvYHL1cEksr1/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF +3wP+TfSvPd9cW436cOGlfifHhi5qjxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88 +oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQPeSghYA2FFn3XVDjxklb9tTNM +g9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+CtgrKAmrhQhJ8Z3 +mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh +8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAd +BgNVHQ4EFgQU2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6U +nrybPZx9mCAZ5YwwYrIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYw +DQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/hOsh80QA9z+LqBrWyOrsGS2h60COX +dKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnpkpfbsEZC89NiqpX+ +MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv2wnL +/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RX +CI/hOWB3S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYa +ZH9bDTMJBzN7Bj8RpFxwPIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW +2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dvDDqPys/cA8GiCcjl/YBeyGBCARsaU1q7 +N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYURpFHmygk71dSTlxCnKr3 +Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANExdqtvArB +As8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp +5KeXRKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu +1uwJ +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor ECA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor ECA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor ECA-1" +# Serial: 9548242946988625984 +# MD5 Fingerprint: 27:92:23:1d:0a:f5:40:7c:e9:e6:6b:9d:d8:f5:e7:6c +# SHA1 Fingerprint: 58:d1:df:95:95:67:6b:63:c0:f0:5b:1c:17:4d:8b:84:0b:c8:78:bd +# SHA256 Fingerprint: 5a:88:5d:b1:9c:01:d9:12:c5:75:93:88:93:8c:af:bb:df:03:1a:b2:d4:8e:91:ee:15:58:9b:42:97:1d:03:9c +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxFzAVBgNVBAMMDlRydXN0Q29y +IEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3MjgwN1owgZwxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3Ig +RUNBLTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb +3w9U73NjKYKtR8aja+3+XzP4Q1HpGjORMRegdMTUpwHmspI+ap3tDvl0mEDTPwOA +BoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23xFUfJ3zSCNV2HykVh0A5 +3ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmcp0yJF4Ou +owReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/ +wZ0+fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZF +ZtS6mFjBAgMBAAGjYzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAf +BgNVHSMEGDAWgBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEABT41XBVwm8nHc2Fv +civUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u/ukZMjgDfxT2 +AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F +hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50 +soIipX1TH0XsJ5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BI +WJZpTdwHjFGTot+fDz2LYLSCjaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1Wi +tJ/X5g== +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com Root Certification Authority RSA O=SSL Corporation +# Subject: CN=SSL.com Root Certification Authority RSA O=SSL Corporation +# Label: "SSL.com Root Certification Authority RSA" +# Serial: 8875640296558310041 +# MD5 Fingerprint: 86:69:12:c0:70:f1:ec:ac:ac:c2:d5:bc:a5:5b:a1:29 +# SHA1 Fingerprint: b7:ab:33:08:d1:ea:44:77:ba:14:80:12:5a:6f:bd:a9:36:49:0c:bb +# SHA256 Fingerprint: 85:66:6a:56:2e:e0:be:5c:e9:25:c1:d8:89:0a:6f:76:a8:7e:c1:6d:4d:7d:5f:29:ea:74:19:cf:20:12:3b:69 +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE +BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK +DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz +OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R +xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX +qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC +C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3 +6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh +/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF +YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E +JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc +US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8 +ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm ++Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi +M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G +A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV +cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc +Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs +PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/ +q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0 +cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr +a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I +H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y +K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu +nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf +oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY +Ic2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com Root Certification Authority ECC O=SSL Corporation +# Subject: CN=SSL.com Root Certification Authority ECC O=SSL Corporation +# Label: "SSL.com Root Certification Authority ECC" +# Serial: 8495723813297216424 +# MD5 Fingerprint: 2e:da:e4:39:7f:9c:8f:37:d1:70:9f:26:17:51:3a:8e +# SHA1 Fingerprint: c3:19:7c:39:24:e6:54:af:1b:c4:ab:20:95:7a:e2:c3:0e:13:02:6a +# SHA256 Fingerprint: 34:17:bb:06:cc:60:07:da:1b:96:1c:92:0b:8a:b4:ce:3f:ad:82:0e:4a:a3:0b:9a:cb:c4:a7:4e:bd:ce:bc:65 +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz +WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0 +b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS +b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI +7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg +CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud +EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD +VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T +kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+ +gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com EV Root Certification Authority RSA R2 O=SSL Corporation +# Subject: CN=SSL.com EV Root Certification Authority RSA R2 O=SSL Corporation +# Label: "SSL.com EV Root Certification Authority RSA R2" +# Serial: 6248227494352943350 +# MD5 Fingerprint: e1:1e:31:58:1a:ae:54:53:02:f6:17:6a:11:7b:4d:95 +# SHA1 Fingerprint: 74:3a:f0:52:9b:d0:32:a0:f4:4a:83:cd:d4:ba:a9:7b:7c:2e:c4:9a +# SHA256 Fingerprint: 2e:7b:f1:6c:c2:24:85:a7:bb:e2:aa:86:96:75:07:61:b0:ae:39:be:3b:2f:e9:d0:cc:6d:4e:f7:34:91:42:5c +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV +BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE +CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy +MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G +A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD +DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq +M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf +OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa +4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9 +HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR +aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA +b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ +Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV +PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO +pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu +UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY +MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV +HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4 +9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW +s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5 +Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg +cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM +79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz +/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt +ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm +Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK +QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ +w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi +S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07 +mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com EV Root Certification Authority ECC O=SSL Corporation +# Subject: CN=SSL.com EV Root Certification Authority ECC O=SSL Corporation +# Label: "SSL.com EV Root Certification Authority ECC" +# Serial: 3182246526754555285 +# MD5 Fingerprint: 59:53:22:65:83:42:01:54:c0:ce:42:b9:5a:7c:f2:90 +# SHA1 Fingerprint: 4c:dd:51:a3:d1:f5:20:32:14:b0:c6:c5:32:23:03:91:c7:46:42:6d +# SHA256 Fingerprint: 22:a2:c1:f7:bd:ed:70:4c:c1:e7:01:b5:f4:08:c3:10:88:0f:e9:56:b5:de:2a:4a:44:f9:9c:87:3a:25:a7:c8 +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xNDAyBgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNTIzWhcNNDEwMjEyMTgx +NTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NMLmNv +bSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMA +VIbc/R/fALhBYlzccBYy3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1Kthku +WnBaBu2+8KGwytAJKaNjMGEwHQYDVR0OBBYEFFvKXuXe0oGqzagtZFG22XKbl+ZP +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe5d7SgarNqC1kUbbZcpuX +5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJN+vp1RPZ +ytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZg +h5Mmm7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R6 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R6 +# Label: "GlobalSign Root CA - R6" +# Serial: 1417766617973444989252670301619537 +# MD5 Fingerprint: 4f:dd:07:e4:d4:22:64:39:1e:0c:37:42:ea:d1:c6:ae +# SHA1 Fingerprint: 80:94:64:0e:b5:a7:a1:ca:11:9c:1f:dd:d5:9f:81:02:63:a7:fb:d1 +# SHA256 Fingerprint: 2c:ab:ea:fe:37:d0:6c:a2:2a:ba:73:91:c0:03:3d:25:98:29:52:c4:53:64:73:49:76:3a:3a:b5:ad:6c:cf:69 +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEg +MB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2Jh +bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQx +MjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjET +MBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCAiIwDQYJ +KoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQssgrRI +xutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1k +ZguSgMpE3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxD +aNc9PIrFsmbVkJq3MQbFvuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJw +LnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqMPKq0pPbzlUoSB239jLKJz9CgYXfIWHSw +1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+azayOeSsJDa38O+2HBNX +k7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05OWgtH8wY2 +SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/h +bguyCLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4n +WUx2OVvq+aWh2IMP0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpY +rZxCRXluDocZXFSxZba/jJvcE+kNb7gu3GduyYsRtYQUigAZcIN5kZeR1Bonvzce +MgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNVHSMEGDAWgBSu +bAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN +nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGt +Ixg93eFyRJa0lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr61 +55wsTLxDKZmOMNOsIeDjHfrYBzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLj +vUYAGm0CuiVdjaExUd1URhxN25mW7xocBFymFe944Hn+Xds+qkxV/ZoVqW/hpvvf +cDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr3TsTjxKM4kEaSHpz +oHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB10jZp +nOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfs +pA9MRf/TuTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+v +JJUEeKgDu+6B5dpffItKoZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R +8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+tJDfLRVpOoERIyNiwmcUVhAn21klJwGW4 +5hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= +-----END CERTIFICATE----- + +# Issuer: CN=OISTE WISeKey Global Root GC CA O=WISeKey OU=OISTE Foundation Endorsed +# Subject: CN=OISTE WISeKey Global Root GC CA O=WISeKey OU=OISTE Foundation Endorsed +# Label: "OISTE WISeKey Global Root GC CA" +# Serial: 44084345621038548146064804565436152554 +# MD5 Fingerprint: a9:d6:b9:2d:2f:93:64:f8:a5:69:ca:91:e9:68:07:23 +# SHA1 Fingerprint: e0:11:84:5e:34:de:be:88:81:b9:9c:f6:16:26:d1:96:1f:c3:b9:31 +# SHA256 Fingerprint: 85:60:f9:1c:36:24:da:ba:95:70:b5:fe:a0:db:e3:6f:f1:1a:83:23:be:94:86:85:4f:b3:f3:4a:55:71:19:8d +-----BEGIN CERTIFICATE----- +MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQsw +CQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91 +bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwg +Um9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRaFw00MjA1MDkwOTU4MzNaMG0xCzAJ +BgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBGb3Vu +ZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2JhbCBS +b290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4ni +eUqjFqdrVCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4W +p2OQ0jnUsYd4XxiWD1AbNTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7T +rYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0EAwMDaAAwZQIwJsdpW9zV +57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtkAjEA2zQg +Mgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R1 O=Google Trust Services LLC +# Subject: CN=GTS Root R1 O=Google Trust Services LLC +# Label: "GTS Root R1" +# Serial: 146587175971765017618439757810265552097 +# MD5 Fingerprint: 82:1a:ef:d4:d2:4a:f2:9f:e2:3d:97:06:14:70:72:85 +# SHA1 Fingerprint: e1:c9:50:e6:ef:22:f8:4c:56:45:72:8b:92:20:60:d7:d5:a7:a3:e8 +# SHA256 Fingerprint: 2a:57:54:71:e3:13:40:bc:21:58:1c:bd:2c:f1:3e:15:84:63:20:3e:ce:94:bc:f9:d3:cc:19:6b:f0:9a:54:72 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaM +f/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vX +mX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7 +zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0P +fyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtc +vfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4 +Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUsp +zBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOO +Rc92wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYW +k70paDPvOmbsB4om3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+ +DVrNVjzRlwW5y0vtOUucxD/SVRNuJLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgF +lQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQADggIBADiW +Cu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1 +d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6Z +XPYfcX3v73svfuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZR +gyFmxhE+885H7pwoHyXa/6xmld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3 +d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9bgsiG1eGZbYwE8na6SfZu6W0eX6Dv +J4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq4BjFbkerQUIpm/Zg +DdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWErtXvM ++SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyy +F62ARPBopY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9 +SQ98POyDGCBDTtWTurQ0sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdws +E3PYJ/HQcu51OyLemGhmW/HGY0dVHLqlCFF1pkgl +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R2 O=Google Trust Services LLC +# Subject: CN=GTS Root R2 O=Google Trust Services LLC +# Label: "GTS Root R2" +# Serial: 146587176055767053814479386953112547951 +# MD5 Fingerprint: 44:ed:9a:0e:a4:09:3b:00:f2:ae:4c:a3:c6:61:b0:8b +# SHA1 Fingerprint: d2:73:96:2a:2a:5e:39:9f:73:3f:e1:c7:1e:64:3f:03:38:34:fc:4d +# SHA256 Fingerprint: c4:5d:7b:b0:8e:6d:67:e6:2e:42:35:11:0b:56:4e:5f:78:fd:92:ef:05:8c:84:0a:ea:4e:64:55:d7:58:5c:60 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3Lv +CvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3Kg +GjSY6Dlo7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9Bu +XvAuMC6C/Pq8tBcKSOWIm8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOd +re7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS+LFjKBC4swm4VndAoiaYecb+3yXu +PuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7MkogwTZq9TwtImoS1 +mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJGr61K +8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqj +x5RWIr9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsR +nTKaG73VululycslaVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0 +kzCqgc7dGtxRcw1PcOnlthYhGXmy5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9Ok +twIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQADggIBALZp +8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT +vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiT +z9D2PGcDFWEJ+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiA +pJiS4wGWAqoC7o87xdFtCjMwc3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvb +pxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3DaWsYDQvTtN6LwG1BUSw7YhN4ZKJmB +R64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5rn/WkhLx3+WuXrD5R +RaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56GtmwfuNmsk +0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC +5AwiWVIQ7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiF +izoHCBy69Y9Vmhh1fuXsgWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLn +yOd/xCxgXS/Dr55FBcOEArf9LAhST4Ldo/DUhgkC +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R3 O=Google Trust Services LLC +# Subject: CN=GTS Root R3 O=Google Trust Services LLC +# Label: "GTS Root R3" +# Serial: 146587176140553309517047991083707763997 +# MD5 Fingerprint: 1a:79:5b:6b:04:52:9c:5d:c7:74:33:1b:25:9a:f9:25 +# SHA1 Fingerprint: 30:d4:24:6f:07:ff:db:91:89:8a:0b:e9:49:66:11:eb:8c:5e:46:e5 +# SHA256 Fingerprint: 15:d5:b8:77:46:19:ea:7d:54:ce:1c:a6:d0:b0:c4:03:e0:37:a9:17:f1:31:e8:a0:4e:1e:6b:7a:71:ba:bc:e5 +-----BEGIN CERTIFICATE----- +MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUURout +736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2A +DDL24CejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBTB8Sa6oC2uhYHP0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFuk +fCPAlaUs3L6JbyO5o91lAFJekazInXJ0glMLfalAvWhgxeG4VDvBNhcl2MG9AjEA +njWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOaKaqW04MjyaR7YbPMAuhd +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R4 O=Google Trust Services LLC +# Subject: CN=GTS Root R4 O=Google Trust Services LLC +# Label: "GTS Root R4" +# Serial: 146587176229350439916519468929765261721 +# MD5 Fingerprint: 5d:b6:6a:c4:60:17:24:6a:1a:99:a8:4b:ee:5e:b4:26 +# SHA1 Fingerprint: 2a:1d:60:27:d9:4a:b1:0a:1c:4d:91:5c:cd:33:a0:cb:3e:2d:54:cb +# SHA256 Fingerprint: 71:cc:a5:39:1f:9e:79:4b:04:80:25:30:b3:63:e1:21:da:8a:30:43:bb:26:66:2f:ea:4d:ca:7f:c9:51:a4:bd +-----BEGIN CERTIFICATE----- +MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzu +hXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/l +xKvRHYqjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0 +CMRw3J5QdCHojXohw0+WbhXRIjVhLfoIN+4Zba3bssx9BzT1YBkstTTZbyACMANx +sbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11xzPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +# Issuer: CN=UCA Global G2 Root O=UniTrust +# Subject: CN=UCA Global G2 Root O=UniTrust +# Label: "UCA Global G2 Root" +# Serial: 124779693093741543919145257850076631279 +# MD5 Fingerprint: 80:fe:f0:c4:4a:f0:5c:62:32:9f:1c:ba:78:a9:50:f8 +# SHA1 Fingerprint: 28:f9:78:16:19:7a:ff:18:25:18:aa:44:fe:c1:a0:ce:5c:b6:4c:8a +# SHA256 Fingerprint: 9b:ea:11:c9:76:fe:01:47:64:c1:be:56:a6:f9:14:b5:a5:60:31:7a:bd:99:88:39:33:82:e5:16:1a:a0:49:3c +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9 +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBH +bG9iYWwgRzIgUm9vdDAeFw0xNjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0x +CzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlUcnVzdDEbMBkGA1UEAwwSVUNBIEds +b2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxeYr +b3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmToni9 +kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzm +VHqUwCoV8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/R +VogvGjqNO7uCEeBHANBSh6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDc +C/Vkw85DvG1xudLeJ1uK6NjGruFZfc8oLTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIj +tm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/R+zvWr9LesGtOxdQXGLY +D0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBeKW4bHAyv +j5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6Dl +NaBa4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6 +iIis7nCs+dwp4wwcOxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznP +O6Q0ibd5Ei9Hxeepl2n8pndntd978XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIHEjMz15DD/pQwIX4wV +ZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo5sOASD0Ee/oj +L3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 +1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl +1qnN3e92mI0ADs0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oU +b3n09tDh05S60FdRvScFDcH9yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LV +PtateJLbXDzz2K36uGt/xDYotgIVilQsnLAXc47QN6MUPJiVAAwpBVueSUmxX8fj +y88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHojhJi6IjMtX9Gl8Cb +EGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZkbxqg +DMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI ++Vg7RE+xygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGy +YiGqhkCyLmTTX8jjfhFnRR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bX +UB+K+wb1whnw0A== +-----END CERTIFICATE----- + +# Issuer: CN=UCA Extended Validation Root O=UniTrust +# Subject: CN=UCA Extended Validation Root O=UniTrust +# Label: "UCA Extended Validation Root" +# Serial: 106100277556486529736699587978573607008 +# MD5 Fingerprint: a1:f3:5f:43:c6:34:9b:da:bf:8c:7e:05:53:ad:96:e2 +# SHA1 Fingerprint: a3:a1:b0:6f:24:61:23:4a:e3:36:a5:c2:37:fc:a6:ff:dd:f0:d7:3a +# SHA256 Fingerprint: d4:3a:f9:b3:54:73:75:5c:96:84:fc:06:d7:d8:cb:70:ee:5c:28:e7:73:fb:29:4e:b4:1e:e7:17:22:92:4d:24 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBF +eHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMx +MDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNV +BAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrsiWog +D4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvS +sPGP2KxFRv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aop +O2z6+I9tTcg1367r3CTueUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dk +sHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR59mzLC52LqGj3n5qiAno8geK+LLNEOfi +c0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH0mK1lTnj8/FtDw5lhIpj +VMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KRel7sFsLz +KuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/ +TuDvB0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41G +sx2VYVdWf6/wFlthWG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs +1+lvK9JKBZP8nm9rZ/+I8U6laUpSNwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQD +fwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS3H5aBZ8eNJr34RQwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBADaN +l8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR +ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQ +VBcZEhrxH9cMaVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5 +c6sq1WnIeJEmMX3ixzDx/BR4dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp +4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb+7lsq+KePRXBOy5nAliRn+/4Qh8s +t2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOWF3sGPjLtx7dCvHaj +2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwiGpWO +vpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2C +xR9GUeOcGMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmx +cmtpzyKEC2IPrNkZAJSidjzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbM +fjKaiJUINlK73nZfdklJrX+9ZSCyycErdhh2n1ax +-----END CERTIFICATE----- + +# Issuer: CN=Certigna Root CA O=Dhimyotis OU=0002 48146308100036 +# Subject: CN=Certigna Root CA O=Dhimyotis OU=0002 48146308100036 +# Label: "Certigna Root CA" +# Serial: 269714418870597844693661054334862075617 +# MD5 Fingerprint: 0e:5c:30:62:27:eb:5b:bc:d7:ae:62:ba:e9:d5:df:77 +# SHA1 Fingerprint: 2d:0d:52:14:ff:9e:ad:99:24:01:74:20:47:6e:6c:85:27:27:f5:43 +# SHA256 Fingerprint: d4:8d:3d:23:ee:db:50:a4:59:e5:51:97:60:1c:27:77:4b:9d:7b:18:c9:4d:5a:05:95:11:a1:02:50:b9:31:68 +-----BEGIN CERTIFICATE----- +MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAw +WjELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAw +MiA0ODE0NjMwODEwMDAzNjEZMBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0x +MzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjdaMFoxCzAJBgNVBAYTAkZSMRIwEAYD +VQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgxMDAwMzYxGTAX +BgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sO +ty3tRQgXstmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9M +CiBtnyN6tMbaLOQdLNyzKNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPu +I9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8JXrJhFwLrN1CTivngqIkicuQstDuI7pm +TLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16XdG+RCYyKfHx9WzMfgIh +C59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq4NYKpkDf +ePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3Yz +IoejwpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWT +Co/1VTp2lc5ZmIoJlXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1k +JWumIWmbat10TWuXekG9qxf5kBdIjzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5 +hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp//TBt2dzhauH8XwIDAQABo4IB +GjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of +1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczov +L3d3d3cuY2VydGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilo +dHRwOi8vY3JsLmNlcnRpZ25hLmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYr +aHR0cDovL2NybC5kaGlteW90aXMuY29tL2NlcnRpZ25hcm9vdGNhLmNybDANBgkq +hkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOItOoldaDgvUSILSo3L +6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxPTGRG +HVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH6 +0BGM+RFq7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncB +lA2c5uk5jR+mUYyZDDl34bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdi +o2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1 +gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS6Cvu5zHbugRqh5jnxV/v +faci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaYtlu3zM63 +Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayh +jWZSaX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw +3kAP+HwV96LOPNdeE4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + +# Issuer: CN=emSign Root CA - G1 O=eMudhra Technologies Limited OU=emSign PKI +# Subject: CN=emSign Root CA - G1 O=eMudhra Technologies Limited OU=emSign PKI +# Label: "emSign Root CA - G1" +# Serial: 235931866688319308814040 +# MD5 Fingerprint: 9c:42:84:57:dd:cb:0b:a7:2e:95:ad:b6:f3:da:bc:ac +# SHA1 Fingerprint: 8a:c7:ad:8f:73:ac:4e:c1:b5:75:4d:a5:40:f4:fc:cf:7c:b5:8e:8c +# SHA256 Fingerprint: 40:f6:af:03:46:a9:9a:a1:cd:1d:55:5a:4e:9c:ce:62:c7:f9:63:46:03:ee:40:66:15:83:3d:c8:c8:d0:03:67 +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD +VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU +ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH +MTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgxODMwMDBaMGcxCzAJBgNVBAYTAklO +MRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRlY2hub2xv +Z2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQz +f2N4aLTNLnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO +8oG0x5ZOrRkVUkr+PHB1cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aq +d7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHWDV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhM +tTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ6DqS0hdW5TUaQBw+jSzt +Od9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrHhQIDAQAB +o0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31x +PaOfG1vR2vjTnGs2vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjM +wiI/aTvFthUvozXGaCocV685743QNcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6d +GNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q+Mri/Tm3R7nrft8EI6/6nAYH +6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby +RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- + +# Issuer: CN=emSign ECC Root CA - G3 O=eMudhra Technologies Limited OU=emSign PKI +# Subject: CN=emSign ECC Root CA - G3 O=eMudhra Technologies Limited OU=emSign PKI +# Label: "emSign ECC Root CA - G3" +# Serial: 287880440101571086945156 +# MD5 Fingerprint: ce:0b:72:d1:9f:88:8e:d0:50:03:e8:e3:b8:8b:67:40 +# SHA1 Fingerprint: 30:43:fa:4f:f2:57:dc:a0:c3:80:ee:2e:58:ea:78:b2:3f:e6:bb:c1 +# SHA256 Fingerprint: 86:a1:ec:ba:08:9c:4a:8d:3b:be:27:34:c6:12:ba:34:1d:81:3e:04:3c:f9:e8:a8:62:cd:5c:57:a3:6b:be:6b +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG +EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo +bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ +TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s +b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw +djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0 +WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS +fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB +zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq +hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB +CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD ++JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- + +# Issuer: CN=emSign Root CA - C1 O=eMudhra Inc OU=emSign PKI +# Subject: CN=emSign Root CA - C1 O=eMudhra Inc OU=emSign PKI +# Label: "emSign Root CA - C1" +# Serial: 825510296613316004955058 +# MD5 Fingerprint: d8:e3:5d:01:21:fa:78:5a:b0:df:ba:d2:ee:2a:5f:68 +# SHA1 Fingerprint: e7:2e:f1:df:fc:b2:09:28:cf:5d:d4:d5:67:37:b1:51:cb:86:4f:01 +# SHA256 Fingerprint: 12:56:09:aa:30:1d:a0:a2:49:b9:7a:82:39:cb:6a:34:21:6f:44:dc:ac:9f:39:54:b1:42:92:f2:e8:c8:60:8f +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkG +A1UEBhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEg +SW5jMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAw +MFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln +biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNpZ24gUm9v +dCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+upufGZ +BczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZ +HdPIWoU/Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH +3DspVpNqs8FqOp099cGXOFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvH +GPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4VI5b2P/AgNBbeCsbEBEV5f6f9vtKppa+c +xSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleoomslMuoaJuvimUnzYnu3Yy1 +aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+XJGFehiq +TbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87 +/kOXSTKZEhVb3xEp/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4 +kqNPEjE2NuLe/gDEo2APJ62gsIq1NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrG +YQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9wC68AivTxEDkigcxHpvOJpkT ++xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQBmIMMMAVSKeo +WXzhriKi4gp6D/piq1JM4fHfyr6DDUI= +-----END CERTIFICATE----- + +# Issuer: CN=emSign ECC Root CA - C3 O=eMudhra Inc OU=emSign PKI +# Subject: CN=emSign ECC Root CA - C3 O=eMudhra Inc OU=emSign PKI +# Label: "emSign ECC Root CA - C3" +# Serial: 582948710642506000014504 +# MD5 Fingerprint: 3e:53:b3:a3:81:ee:d7:10:f8:d3:b0:1d:17:92:f5:d5 +# SHA1 Fingerprint: b6:af:43:c2:9b:81:53:7d:f6:ef:6b:c3:1f:1f:60:15:0c:ee:48:66 +# SHA256 Fingerprint: bc:4d:80:9b:15:18:9d:78:db:3e:1d:8c:f4:f9:72:6a:79:5d:a1:64:3c:a5:f1:35:8e:1d:db:0e:dc:0d:7e:b3 +-----BEGIN CERTIFICATE----- +MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQG +EwJVUzETMBEGA1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMx +IDAeBgNVBAMTF2VtU2lnbiBFQ0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAw +MFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln +biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQDExdlbVNpZ24gRUND +IFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd6bci +MK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4Ojavti +sIGJAnB9SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0O +BBYEFPtaSNCAIEDyqOkAB2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB +Af8EBTADAQH/MAoGCCqGSM49BAMDA2gAMGUCMQC02C8Cif22TGK6Q04ThHK1rt0c +3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwUZOR8loMRnLDRWmFLpg9J +0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== +-----END CERTIFICATE----- + +# Issuer: CN=Hongkong Post Root CA 3 O=Hongkong Post +# Subject: CN=Hongkong Post Root CA 3 O=Hongkong Post +# Label: "Hongkong Post Root CA 3" +# Serial: 46170865288971385588281144162979347873371282084 +# MD5 Fingerprint: 11:fc:9f:bd:73:30:02:8a:fd:3f:f3:58:b9:cb:20:f0 +# SHA1 Fingerprint: 58:a2:d0:ec:20:52:81:5b:c1:f3:f8:64:02:24:4e:c2:8e:02:4b:02 +# SHA256 Fingerprint: 5a:2f:c0:3f:0c:83:b0:90:bb:fa:40:60:4b:09:88:44:6c:76:36:18:3d:f9:84:6e:17:10:1a:44:7f:b8:ef:d6 +-----BEGIN CERTIFICATE----- +MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQEL +BQAwbzELMAkGA1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJ +SG9uZyBLb25nMRYwFAYDVQQKEw1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25n +a29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2MDMwMjI5NDZaFw00MjA2MDMwMjI5 +NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtvbmcxEjAQBgNVBAcT +CUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMXSG9u +Z2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCziNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFO +dem1p+/l6TWZ5Mwc50tfjTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mI +VoBc+L0sPOFMV4i707mV78vH9toxdCim5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV +9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOesL4jpNrcyCse2m5FHomY +2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj0mRiikKY +vLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+Tt +bNe/JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZb +x39ri1UbSsUgYT2uy1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+ +l2oBlKN8W4UdKjk60FSh0Tlxnf0h+bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YK +TE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsGxVd7GYYKecsAyVKvQv83j+Gj +Hno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwIDAQABo2MwYTAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e +i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEw +DQYJKoZIhvcNAQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG +7BJ8dNVI0lkUmcDrudHr9EgwW62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCk +MpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWldy8joRTnU+kLBEUx3XZL7av9YROXr +gZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov+BS5gLNdTaqX4fnk +GMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDceqFS +3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJm +Ozj/2ZQw9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+ +l6mc1X5VTMbeRRAc6uk7nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6c +JfTzPV4e0hz5sy229zdcxsshTrD3mUcYhcErulWuBurQB7Lcq9CClnXO0lD+mefP +L5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB60PZ2Pierc+xYw5F9KBa +LJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fqdBb9HxEG +mpv0 +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority - G4 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2015 Entrust, Inc. - for authorized use only +# Subject: CN=Entrust Root Certification Authority - G4 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2015 Entrust, Inc. - for authorized use only +# Label: "Entrust Root Certification Authority - G4" +# Serial: 289383649854506086828220374796556676440 +# MD5 Fingerprint: 89:53:f1:83:23:b7:7c:8e:05:f1:8c:71:38:4e:1f:88 +# SHA1 Fingerprint: 14:88:4e:86:26:37:b0:26:af:59:62:5c:40:77:ec:35:29:ba:96:01 +# SHA256 Fingerprint: db:35:17:d1:f6:73:2a:2d:5a:b9:7c:53:3e:c7:07:79:ee:32:70:a6:2f:b4:ac:42:38:37:24:60:e6:f0:1e:88 +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAw +gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL +Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg +MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw +BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0 +MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1 +c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJ +bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3Qg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3DumSXbcr3DbVZwbPLqGgZ +2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV3imz/f3E +T+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j +5pds8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAM +C1rlLAHGVK/XqsEQe9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73T +DtTUXm6Hnmo9RR3RXRv06QqsYJn7ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNX +wbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5XxNMhIWNlUpEbsZmOeX7m640A +2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV7rtNOzK+mndm +nqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8 +dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwl +N4y6mACXi0mWHv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNj +c0kCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9nMA0GCSqGSIb3DQEBCwUAA4ICAQAS +5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4QjbRaZIxowLByQzTS +Gwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht7LGr +hFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/ +B7NTeLUKYvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uI +AeV8KEsD+UmDfLJ/fOPtjqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbw +H5Lk6rWS02FREAutp9lfx1/cH6NcjKF+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+ +b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKWRGhXxNUzzxkvFMSUHHuk +2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjAJOgc47Ol +IQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk +5F6G+TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuY +n/PIjhs4ViFqUZPTkcpG2om3PVODLAgfi49T3f+sHw== +-----END CERTIFICATE----- + +# Issuer: CN=Microsoft ECC Root Certificate Authority 2017 O=Microsoft Corporation +# Subject: CN=Microsoft ECC Root Certificate Authority 2017 O=Microsoft Corporation +# Label: "Microsoft ECC Root Certificate Authority 2017" +# Serial: 136839042543790627607696632466672567020 +# MD5 Fingerprint: dd:a1:03:e6:4a:93:10:d1:bf:f0:19:42:cb:fe:ed:67 +# SHA1 Fingerprint: 99:9a:64:c3:7f:f4:7d:9f:ab:95:f1:47:69:89:14:60:ee:c4:c3:c5 +# SHA256 Fingerprint: 35:8d:f3:9d:76:4a:f9:e1:b7:66:e9:c9:72:df:35:2e:e1:5c:fa:c2:27:af:6a:d1:d7:0e:8e:4a:6e:dc:ba:02 +-----BEGIN CERTIFICATE----- +MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQsw +CQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYD +VQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIw +MTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4MjMxNjA0WjBlMQswCQYDVQQGEwJV +UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNy +b3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZR +ogPZnZH6thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYb +hGBKia/teQ87zvH2RPUBeMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBTIy5lycFIM+Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3 +FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlfXu5gKcs68tvWMoQZP3zV +L8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaReNtUjGUB +iudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M= +-----END CERTIFICATE----- + +# Issuer: CN=Microsoft RSA Root Certificate Authority 2017 O=Microsoft Corporation +# Subject: CN=Microsoft RSA Root Certificate Authority 2017 O=Microsoft Corporation +# Label: "Microsoft RSA Root Certificate Authority 2017" +# Serial: 40975477897264996090493496164228220339 +# MD5 Fingerprint: 10:ff:00:ff:cf:c9:f8:c7:7a:c0:ee:35:8e:c9:0f:47 +# SHA1 Fingerprint: 73:a5:e6:4a:3b:ff:83:16:ff:0e:dc:cc:61:8a:90:6e:4e:ae:4d:74 +# SHA256 Fingerprint: c7:41:f7:0f:4b:2a:8d:88:bf:2e:71:c1:41:22:ef:53:ef:10:eb:a0:cf:a5:e6:4c:fa:20:f4:18:85:30:73:e0 +-----BEGIN CERTIFICATE----- +MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qvn9FszANBgkqhkiG9w0BAQwFADBl +MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw +NAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +IDIwMTcwHhcNMTkxMjE4MjI1MTIyWhcNNDIwNzE4MjMwMDIzWjBlMQswCQYDVQQG +EwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1N +aWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKW76UM4wplZEWCpW9R2LBifOZ +Nt9GkMml7Xhqb0eRaPgnZ1AzHaGm++DlQ6OEAlcBXZxIQIJTELy/xztokLaCLeX0 +ZdDMbRnMlfl7rEqUrQ7eS0MdhweSE5CAg2Q1OQT85elss7YfUJQ4ZVBcF0a5toW1 +HLUX6NZFndiyJrDKxHBKrmCk3bPZ7Pw71VdyvD/IybLeS2v4I2wDwAW9lcfNcztm +gGTjGqwu+UcF8ga2m3P1eDNbx6H7JyqhtJqRjJHTOoI+dkC0zVJhUXAoP8XFWvLJ +jEm7FFtNyP9nTUwSlq31/niol4fX/V4ggNyhSyL71Imtus5Hl0dVe49FyGcohJUc +aDDv70ngNXtk55iwlNpNhTs+VcQor1fznhPbRiefHqJeRIOkpcrVE7NLP8TjwuaG +YaRSMLl6IE9vDzhTyzMMEyuP1pq9KsgtsRx9S1HKR9FIJ3Jdh+vVReZIZZ2vUpC6 +W6IYZVcSn2i51BVrlMRpIpj0M+Dt+VGOQVDJNE92kKz8OMHY4Xu54+OU4UZpyw4K +UGsTuqwPN1q3ErWQgR5WrlcihtnJ0tHXUeOrO8ZV/R4O03QK0dqq6mm4lyiPSMQH ++FJDOvTKVTUssKZqwJz58oHhEmrARdlns87/I6KJClTUFLkqqNfs+avNJVgyeY+Q +W5g5xAgGwax/Dj0ApQIDAQABo1QwUjAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUCctZf4aycI8awznjwNnpv7tNsiMwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEMBQADggIBAKyvPl3CEZaJjqPnktaXFbgToqZC +LgLNFgVZJ8og6Lq46BrsTaiXVq5lQ7GPAJtSzVXNUzltYkyLDVt8LkS/gxCP81OC +gMNPOsduET/m4xaRhPtthH80dK2Jp86519efhGSSvpWhrQlTM93uCupKUY5vVau6 +tZRGrox/2KJQJWVggEbbMwSubLWYdFQl3JPk+ONVFT24bcMKpBLBaYVu32TxU5nh +SnUgnZUP5NbcA/FZGOhHibJXWpS2qdgXKxdJ5XbLwVaZOjex/2kskZGT4d9Mozd2 +TaGf+G0eHdP67Pv0RR0Tbc/3WeUiJ3IrhvNXuzDtJE3cfVa7o7P4NHmJweDyAmH3 +pvwPuxwXC65B2Xy9J6P9LjrRk5Sxcx0ki69bIImtt2dmefU6xqaWM/5TkshGsRGR +xpl/j8nWZjEgQRCHLQzWwa80mMpkg/sTV9HB8Dx6jKXB/ZUhoHHBk2dxEuqPiApp +GWSZI1b7rCoucL5mxAyE7+WL85MB+GqQk2dLsmijtWKP6T+MejteD+eMuMZ87zf9 +dOLITzNy4ZQ5bb0Sr74MTnB8G2+NszKTc0QWbej09+CVgI+WXTik9KveCjCHk9hN +AHFiRSdLOkKEW39lt2c0Ui2cFmuqqNh7o0JMcccMyj6D5KbvtwEwXlGjefVwaaZB +RA+GsCyRxj3qrg+E +-----END CERTIFICATE----- + +# Issuer: CN=e-Szigno Root CA 2017 O=Microsec Ltd. +# Subject: CN=e-Szigno Root CA 2017 O=Microsec Ltd. +# Label: "e-Szigno Root CA 2017" +# Serial: 411379200276854331539784714 +# MD5 Fingerprint: de:1f:f6:9e:84:ae:a7:b4:21:ce:1e:58:7d:d1:84:98 +# SHA1 Fingerprint: 89:d4:83:03:4f:9e:9a:48:80:5f:72:37:d4:a9:a6:ef:cb:7c:1f:d1 +# SHA256 Fingerprint: be:b0:0b:30:83:9b:9b:c3:2c:32:e4:44:79:05:95:06:41:f2:64:21:b1:5e:d0:89:19:8b:51:8a:e2:ea:1b:99 +-----BEGIN CERTIFICATE----- +MIICQDCCAeWgAwIBAgIMAVRI7yH9l1kN9QQKMAoGCCqGSM49BAMCMHExCzAJBgNV +BAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMgTHRk +LjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25vIFJv +b3QgQ0EgMjAxNzAeFw0xNzA4MjIxMjA3MDZaFw00MjA4MjIxMjA3MDZaMHExCzAJ +BgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMg +THRkLjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25v +IFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtv +xie+RJCxs1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+H +Wyx7xf58etqjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBSHERUI0arBeAyxr87GyZDvvzAEwDAfBgNVHSMEGDAWgBSHERUI0arB +eAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEAtVfd14pVCzbhhkT61Nlo +jbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxOsvxyqltZ ++efcMQ== +-----END CERTIFICATE----- + +# Issuer: O=CERTSIGN SA OU=certSIGN ROOT CA G2 +# Subject: O=CERTSIGN SA OU=certSIGN ROOT CA G2 +# Label: "certSIGN Root CA G2" +# Serial: 313609486401300475190 +# MD5 Fingerprint: 8c:f1:75:8a:c6:19:cf:94:b7:f7:65:20:87:c3:97:c7 +# SHA1 Fingerprint: 26:f9:93:b4:ed:3d:28:27:b0:b9:4b:a7:e9:15:1d:a3:8d:92:e5:32 +# SHA256 Fingerprint: 65:7c:fe:2f:a7:3f:aa:38:46:25:71:f3:32:a2:36:3a:46:fc:e7:02:09:51:71:07:02:cd:fb:b6:ee:da:33:05 +-----BEGIN CERTIFICATE----- +MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNV +BAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04g +Uk9PVCBDQSBHMjAeFw0xNzAyMDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJ +BgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJ +R04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDF +dRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+CjobXXo9X69MhWf05N0Iw +vlDqtg+piNguLWkh59E3GE59kdUWX2tbAMI5Qw02hVK5U2UPHULlj88F0+7cDBrZ +uIt4ImfkabBoxTzkbFpG583H+u/E7Eu9aqSs/cwoUe+StCmrqzWaTOTECMYmzPhp +n+Sc8CnTXPnGFiWeI8MgwT0PPzhAsP6CRDiqWhqKa2NYOLQV07YRaXseVO6MGiKs +cpc/I1mbySKEwQdPzH/iV8oScLumZfNpdWO9lfsbl83kqK/20U6o2YpxJM02PbyW +xPFsqa7lzw1uKA2wDrXKUXt4FMMgL3/7FFXhEZn91QqhngLjYl/rNUssuHLoPj1P +rCy7Lobio3aP5ZMqz6WryFyNSwb/EkaseMsUBzXgqd+L6a8VTxaJW732jcZZroiF +DsGJ6x9nxUWO/203Nit4ZoORUSs9/1F3dmKh7Gc+PoGD4FapUB8fepmrY7+EF3fx +DTvf95xhszWYijqy7DwaNz9+j5LP2RIUZNoQAhVB/0/E6xyjyfqZ90bp4RjZsbgy +LcsUDFDYg2WD7rlcz8sFWkz6GZdr1l0T08JcVLwyc6B49fFtHsufpaafItzRUZ6C +eWRgKRM+o/1Pcmqr4tTluCRVLERLiohEnMqE0yo7AgMBAAGjQjBAMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSCIS1mxteg4BXrzkwJ +d8RgnlRuAzANBgkqhkiG9w0BAQsFAAOCAgEAYN4auOfyYILVAzOBywaK8SJJ6ejq +kX/GM15oGQOGO0MBzwdw5AgeZYWR5hEit/UCI46uuR59H35s5r0l1ZUa8gWmr4UC +b6741jH/JclKyMeKqdmfS0mbEVeZkkMR3rYzpMzXjWR91M08KCy0mpbqTfXERMQl +qiCA2ClV9+BB/AYm/7k29UMUA2Z44RGx2iBfRgB4ACGlHgAoYXhvqAEBj500mv/0 +OJD7uNGzcgbJceaBxXntC6Z58hMLnPddDnskk7RI24Zf3lCGeOdA5jGokHZwYa+c +NywRtYK3qq4kNFtyDGkNzVmf9nGvnAvRCjj5BiKDUyUM/FHE5r7iOZULJK2v0ZXk +ltd0ZGtxTgI8qoXzIKNDOXZbbFD+mpwUHmUUihW9o4JFWklWatKcsWMy5WHgUyIO +pwpJ6st+H6jiYoD2EEVSmAYY3qXNL3+q1Ok+CHLsIwMCPKaq2LxndD0UF/tUSxfj +03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZk +PuXaTH4MNMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE +1LlSVHJ7liXMvGnjSG4N0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MX +QRBdJ3NghVdJIgc= +-----END CERTIFICATE----- + +# Issuer: CN=Trustwave Global Certification Authority O=Trustwave Holdings, Inc. +# Subject: CN=Trustwave Global Certification Authority O=Trustwave Holdings, Inc. +# Label: "Trustwave Global Certification Authority" +# Serial: 1846098327275375458322922162 +# MD5 Fingerprint: f8:1c:18:2d:2f:ba:5f:6d:a1:6c:bc:c7:ab:91:c7:0e +# SHA1 Fingerprint: 2f:8f:36:4f:e1:58:97:44:21:59:87:a5:2a:9a:d0:69:95:26:7f:b5 +# SHA256 Fingerprint: 97:55:20:15:f5:dd:fc:3c:87:88:c0:06:94:45:55:40:88:94:45:00:84:f1:00:86:70:86:bc:1a:2b:b5:8d:c8 +-----BEGIN CERTIFICATE----- +MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQsw +CQYDVQQGEwJVUzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28x +ITAfBgNVBAoMGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1 +c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMx +OTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJVUzERMA8GA1UECAwI +SWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +ALldUShLPDeS0YLOvR29zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0Xzn +swuvCAAJWX/NKSqIk4cXGIDtiLK0thAfLdZfVaITXdHG6wZWiYj+rDKd/VzDBcdu +7oaJuogDnXIhhpCujwOl3J+IKMujkkkP7NAP4m1ET4BqstTnoApTAbqOl5F2brz8 +1Ws25kCI1nsvXwXoLG0R8+eyvpJETNKXpP7ScoFDB5zpET71ixpZfR9oWN0EACyW +80OzfpgZdNmcc9kYvkHHNHnZ9GLCQ7mzJ7Aiy/k9UscwR7PJPrhq4ufogXBeQotP +JqX+OsIgbrv4Fo7NDKm0G2x2EOFYeUY+VM6AqFcJNykbmROPDMjWLBz7BegIlT1l +RtzuzWniTY+HKE40Cz7PFNm73bZQmq131BnW2hqIyE4bJ3XYsgjxroMwuREOzYfw +hI0Vcnyh78zyiGG69Gm7DIwLdVcEuE4qFC49DxweMqZiNu5m4iK4BUBjECLzMx10 +coos9TkpoNPnG4CELcU9402x/RpvumUHO1jsQkUm+9jaJXLE9gCxInm943xZYkqc +BW89zubWR2OZxiRvchLIrH+QtAuRcOi35hYQcRfO3gZPSEF9NUqjifLJS3tBEW1n +twiYTOURGa5CgNz7kAXU+FDKvuStx8KU1xad5hePrzb7AgMBAAGjQjBAMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFJngGWcNYtt2s9o9uFvo/ULSMQ6HMA4GA1Ud +DwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAmHNw4rDT7TnsTGDZqRKGFx6W +0OhUKDtkLSGm+J1WE2pIPU/HPinbbViDVD2HfSMF1OQc3Og4ZYbFdada2zUFvXfe +uyk3QAUHw5RSn8pk3fEbK9xGChACMf1KaA0HZJDmHvUqoai7PF35owgLEQzxPy0Q +lG/+4jSHg9bP5Rs1bdID4bANqKCqRieCNqcVtgimQlRXtpla4gt5kNdXElE1GYhB +aCXUNxeEFfsBctyV3lImIJgm4nb1J2/6ADtKYdkNy1GTKv0WBpanI5ojSP5RvbbE +sLFUzt5sQa0WZ37b/TjNuThOssFgy50X31ieemKyJo90lZvkWx3SD92YHJtZuSPT +MaCm/zjdzyBP6VhWOmfD0faZmZ26NraAL4hHT4a/RDqA5Dccprrql5gR0IRiR2Qe +qu5AvzSxnI9O4fKSTx+O856X3vOmeWqJcU9LJxdI/uz0UA9PSX3MReO9ekDFQdxh +VicGaeVyQYHTtgGJoC86cnn+OjC/QezHYj6RS8fZMXZC+fc8Y+wmjHMMfRod6qh8 +h6jCJ3zhM0EPz8/8AKAigJ5Kp28AsEFFtyLKaEjFQqKu3R3y4G5OBVixwJAWKqQ9 +EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP29FpHOTK +yeC2nOnOcXHebD8WpHk= +-----END CERTIFICATE----- + +# Issuer: CN=Trustwave Global ECC P256 Certification Authority O=Trustwave Holdings, Inc. +# Subject: CN=Trustwave Global ECC P256 Certification Authority O=Trustwave Holdings, Inc. +# Label: "Trustwave Global ECC P256 Certification Authority" +# Serial: 4151900041497450638097112925 +# MD5 Fingerprint: 5b:44:e3:8d:5d:36:86:26:e8:0d:05:d2:59:a7:83:54 +# SHA1 Fingerprint: b4:90:82:dd:45:0c:be:8b:5b:b1:66:d3:e2:a4:08:26:cd:ed:42:cf +# SHA256 Fingerprint: 94:5b:bc:82:5e:a5:54:f4:89:d1:fd:51:a7:3d:df:2e:a6:24:ac:70:19:a0:52:05:22:5c:22:a7:8c:cf:a8:b4 +-----BEGIN CERTIFICATE----- +MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAf +BgNVBAoTGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3 +YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0x +NzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYDVQQGEwJVUzERMA8G +A1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0 +d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBF +Q0MgUDI1NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqG +SM49AwEHA0IABH77bOYj43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoN +FWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqmP62jQzBBMA8GA1UdEwEB/wQFMAMBAf8w +DwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt0UrrdaVKEJmzsaGLSvcw +CgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjzRM4q3wgh +DDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7 +-----END CERTIFICATE----- + +# Issuer: CN=Trustwave Global ECC P384 Certification Authority O=Trustwave Holdings, Inc. +# Subject: CN=Trustwave Global ECC P384 Certification Authority O=Trustwave Holdings, Inc. +# Label: "Trustwave Global ECC P384 Certification Authority" +# Serial: 2704997926503831671788816187 +# MD5 Fingerprint: ea:cf:60:c4:3b:b9:15:29:40:a1:97:ed:78:27:93:d6 +# SHA1 Fingerprint: e7:f3:a3:c8:cf:6f:c3:04:2e:6d:0e:67:32:c5:9e:68:95:0d:5e:d2 +# SHA256 Fingerprint: 55:90:38:59:c8:c0:c3:eb:b8:75:9e:ce:4e:25:57:22:5f:f5:75:8b:bd:38:eb:d4:82:76:60:1e:1b:d5:80:97 +-----BEGIN CERTIFICATE----- +MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAf +BgNVBAoTGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3 +YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0x +NzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYDVQQGEwJVUzERMA8G +A1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0 +d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBF +Q0MgUDM4NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuB +BAAiA2IABGvaDXU1CDFHBa5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJ +j9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr/TklZvFe/oyujUF5nQlgziip04pt89ZF +1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNVHQ8BAf8EBQMDBwYAMB0G +A1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNnADBkAjA3 +AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC +MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu +Sw== +-----END CERTIFICATE----- + +# Issuer: CN=NAVER Global Root Certification Authority O=NAVER BUSINESS PLATFORM Corp. +# Subject: CN=NAVER Global Root Certification Authority O=NAVER BUSINESS PLATFORM Corp. +# Label: "NAVER Global Root Certification Authority" +# Serial: 9013692873798656336226253319739695165984492813 +# MD5 Fingerprint: c8:7e:41:f6:25:3b:f5:09:b3:17:e8:46:3d:bf:d0:9b +# SHA1 Fingerprint: 8f:6b:f2:a9:27:4a:da:14:a0:c4:f4:8e:61:27:f9:c0:1e:78:5d:d1 +# SHA256 Fingerprint: 88:f4:38:dc:f8:ff:d1:fa:8f:42:91:15:ff:e5:f8:2a:e1:e0:6e:0c:70:c3:75:fa:ad:71:7b:34:a4:9e:72:65 +-----BEGIN CERTIFICATE----- +MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEM +BQAwaTELMAkGA1UEBhMCS1IxJjAkBgNVBAoMHU5BVkVSIEJVU0lORVNTIFBMQVRG +T1JNIENvcnAuMTIwMAYDVQQDDClOQVZFUiBHbG9iYWwgUm9vdCBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eTAeFw0xNzA4MTgwODU4NDJaFw0zNzA4MTgyMzU5NTlaMGkx +CzAJBgNVBAYTAktSMSYwJAYDVQQKDB1OQVZFUiBCVVNJTkVTUyBQTEFURk9STSBD +b3JwLjEyMDAGA1UEAwwpTkFWRVIgR2xvYmFsIFJvb3QgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC21PGTXLVA +iQqrDZBbUGOukJR0F0Vy1ntlWilLp1agS7gvQnXp2XskWjFlqxcX0TM62RHcQDaH +38dq6SZeWYp34+hInDEW+j6RscrJo+KfziFTowI2MMtSAuXaMl3Dxeb57hHHi8lE +HoSTGEq0n+USZGnQJoViAbbJAh2+g1G7XNr4rRVqmfeSVPc0W+m/6imBEtRTkZaz +kVrd/pBzKPswRrXKCAfHcXLJZtM0l/aM9BhK4dA9WkW2aacp+yPOiNgSnABIqKYP +szuSjXEOdMWLyEz59JuOuDxp7W87UC9Y7cSw0BwbagzivESq2M0UXZR4Yb8Obtoq +vC8MC3GmsxY/nOb5zJ9TNeIDoKAYv7vxvvTWjIcNQvcGufFt7QSUqP620wbGQGHf +nZ3zVHbOUzoBppJB7ASjjw2i1QnK1sua8e9DXcCrpUHPXFNwcMmIpi3Ua2FzUCaG +YQ5fG8Ir4ozVu53BA0K6lNpfqbDKzE0K70dpAy8i+/Eozr9dUGWokG2zdLAIx6yo +0es+nPxdGoMuK8u180SdOqcXYZaicdNwlhVNt0xz7hlcxVs+Qf6sdWA7G2POAN3a +CJBitOUt7kinaxeZVL6HSuOpXgRM6xBtVNbv8ejyYhbLgGvtPe31HzClrkvJE+2K +AQHJuFFYwGY6sWZLxNUxAmLpdIQM201GLQIDAQABo0IwQDAdBgNVHQ4EFgQU0p+I +36HNLL3s9TsBAZMzJ7LrYEswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB +Af8wDQYJKoZIhvcNAQEMBQADggIBADLKgLOdPVQG3dLSLvCkASELZ0jKbY7gyKoN +qo0hV4/GPnrK21HUUrPUloSlWGB/5QuOH/XcChWB5Tu2tyIvCZwTFrFsDDUIbatj +cu3cvuzHV+YwIHHW1xDBE1UBjCpD5EHxzzp6U5LOogMFDTjfArsQLtk70pt6wKGm ++LUx5vR1yblTmXVHIloUFcd4G7ad6Qz4G3bxhYTeodoS76TiEJd6eN4MUZeoIUCL +hr0N8F5OSza7OyAfikJW4Qsav3vQIkMsRIz75Sq0bBwcupTgE34h5prCy8VCZLQe +lHsIJchxzIdFV4XTnyliIoNRlwAYl3dqmJLJfGBs32x9SuRwTMKeuB330DTHD8z7 +p/8Dvq1wkNoL3chtl1+afwkyQf3NosxabUzyqkn+Zvjp2DXrDige7kgvOtB5CTh8 +piKCk5XQA76+AqAF3SAi428diDRgxuYKuQl1C/AH6GmWNcf7I4GOODm4RStDeKLR +LBT/DShycpWbXgnbiUSYqqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX +5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oGI/hGoiLtk/bdmuYqh7GYVPEi92tF4+KO +dh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmgkpzNNIaRkPpkUZ3+/uul +9XXeifdy +-----END CERTIFICATE----- + +# Issuer: CN=AC RAIZ FNMT-RCM SERVIDORES SEGUROS O=FNMT-RCM OU=Ceres +# Subject: CN=AC RAIZ FNMT-RCM SERVIDORES SEGUROS O=FNMT-RCM OU=Ceres +# Label: "AC RAIZ FNMT-RCM SERVIDORES SEGUROS" +# Serial: 131542671362353147877283741781055151509 +# MD5 Fingerprint: 19:36:9c:52:03:2f:d2:d1:bb:23:cc:dd:1e:12:55:bb +# SHA1 Fingerprint: 62:ff:d9:9e:c0:65:0d:03:ce:75:93:d2:ed:3f:2d:32:c9:e3:e5:4a +# SHA256 Fingerprint: 55:41:53:b1:3d:2c:f9:dd:b7:53:bf:be:1a:4e:0a:e0:8d:0a:a4:18:70:58:fe:60:a2:b8:62:b2:e4:b8:7b:cb +-----BEGIN CERTIFICATE----- +MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQsw +CQYDVQQGEwJFUzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgw +FgYDVQRhDA9WQVRFUy1RMjgyNjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1S +Q00gU0VSVklET1JFUyBTRUdVUk9TMB4XDTE4MTIyMDA5MzczM1oXDTQzMTIyMDA5 +MzczM1oweDELMAkGA1UEBhMCRVMxETAPBgNVBAoMCEZOTVQtUkNNMQ4wDAYDVQQL +DAVDZXJlczEYMBYGA1UEYQwPVkFURVMtUTI4MjYwMDRKMSwwKgYDVQQDDCNBQyBS +QUlaIEZOTVQtUkNNIFNFUlZJRE9SRVMgU0VHVVJPUzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABPa6V1PIyqvfNkpSIeSX0oNnnvBlUdBeh8dHsVnyV0ebAAKTRBdp20LH +sbI6GA60XYyzZl2hNPk2LEnb80b8s0RpRBNm/dfF/a82Tc4DTQdxz69qBdKiQ1oK +Um8BA06Oi6NCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFAG5L++/EYZg8k/QQW6rcx/n0m5JMAoGCCqGSM49BAMDA2kAMGYCMQCu +SuMrQMN0EfKVrRYj3k4MGuZdpSRea0R7/DjiT8ucRRcRTBQnJlU5dUoDzBOQn5IC +MQD6SmxgiHPz7riYYqnOK8LZiqZwMR2vsJRM60/G49HzYqc8/5MuB1xJAWdpEgJy +v+c= +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign Root R46 O=GlobalSign nv-sa +# Subject: CN=GlobalSign Root R46 O=GlobalSign nv-sa +# Label: "GlobalSign Root R46" +# Serial: 1552617688466950547958867513931858518042577 +# MD5 Fingerprint: c4:14:30:e4:fa:66:43:94:2a:6a:1b:24:5f:19:d0:ef +# SHA1 Fingerprint: 53:a2:b0:4b:ca:6b:d6:45:e6:39:8a:8e:c4:0d:d2:bf:77:c3:a2:90 +# SHA256 Fingerprint: 4f:a3:12:6d:8d:3a:11:d1:c4:85:5a:4f:80:7c:ba:d6:cf:91:9d:3a:5a:88:b0:3b:ea:2c:63:72:d9:3c:40:c9 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUA +MEYxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYD +VQQDExNHbG9iYWxTaWduIFJvb3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMy +MDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYt +c2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBSNDYwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCsrHQy6LNl5brtQyYdpokNRbopiLKkHWPd08EsCVeJ +OaFV6Wc0dwxu5FUdUiXSE2te4R2pt32JMl8Nnp8semNgQB+msLZ4j5lUlghYruQG +vGIFAha/r6gjA7aUD7xubMLL1aa7DOn2wQL7Id5m3RerdELv8HQvJfTqa1VbkNud +316HCkD7rRlr+/fKYIje2sGP1q7Vf9Q8g+7XFkyDRTNrJ9CG0Bwta/OrffGFqfUo +0q3v84RLHIf8E6M6cqJaESvWJ3En7YEtbWaBkoe0G1h6zD8K+kZPTXhc+CtI4wSE +y132tGqzZfxCnlEmIyDLPRT5ge1lFgBPGmSXZgjPjHvjK8Cd+RTyG/FWaha/LIWF +zXg4mutCagI0GIMXTpRW+LaCtfOW3T3zvn8gdz57GSNrLNRyc0NXfeD412lPFzYE ++cCQYDdF3uYM2HSNrpyibXRdQr4G9dlkbgIQrImwTDsHTUB+JMWKmIJ5jqSngiCN +I/onccnfxkF0oE32kRbcRoxfKWMxWXEM2G/CtjJ9++ZdU6Z+Ffy7dXxd7Pj2Fxzs +x2sZy/N78CsHpdlseVR2bJ0cpm4O6XkMqCNqo98bMDGfsVR7/mrLZqrcZdCinkqa +ByFrgY/bxFn63iLABJzjqls2k+g9vXqhnQt2sQvHnf3PmKgGwvgqo6GDoLclcqUC +4wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUA1yrc4GHqMywptWU4jaWSf8FmSwwDQYJKoZIhvcNAQEMBQADggIBAHx4 +7PYCLLtbfpIrXTncvtgdokIzTfnvpCo7RGkerNlFo048p9gkUbJUHJNOxO97k4Vg +JuoJSOD1u8fpaNK7ajFxzHmuEajwmf3lH7wvqMxX63bEIaZHU1VNaL8FpO7XJqti +2kM3S+LGteWygxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIk +pnnpHs6i58FZFZ8d4kuaPp92CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRF +FRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZmOUdkLG5NrmJ7v2B0GbhWrJKsFjLt +rWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qqJZ4d16GLuc1CLgSk +ZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwyeqiv5 +u+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP +4vkYxboznxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6 +N3ec592kD3ZDZopD8p/7DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3 +vouXsXgxT7PntgMTzlSdriVZzH81Xwj3QEUxeCp6 +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign Root E46 O=GlobalSign nv-sa +# Subject: CN=GlobalSign Root E46 O=GlobalSign nv-sa +# Label: "GlobalSign Root E46" +# Serial: 1552617690338932563915843282459653771421763 +# MD5 Fingerprint: b5:b8:66:ed:de:08:83:e3:c9:e2:01:34:06:ac:51:6f +# SHA1 Fingerprint: 39:b4:6c:d5:fe:80:06:eb:e2:2f:4a:bb:08:33:a0:af:db:b9:dd:84 +# SHA256 Fingerprint: cb:b9:c4:4d:84:b8:04:3e:10:50:ea:31:a6:9f:51:49:55:d7:bf:d2:e2:c6:b4:93:01:01:9a:d6:1d:9f:50:58 +-----BEGIN CERTIFICATE----- +MIICCzCCAZGgAwIBAgISEdK7ujNu1LzmJGjFDYQdmOhDMAoGCCqGSM49BAMDMEYx +CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQD +ExNHbG9iYWxTaWduIFJvb3QgRTQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAw +MDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2Ex +HDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBFNDYwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkBjtjq +R+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGdd +yXqBPCCjQjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBQxCpCPtsad0kRLgLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ +7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZkvLtoURMMA/cVi4RguYv/Uo7njLwcAjA8 ++RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+CAezNIm8BZ/3Hobui3A= +-----END CERTIFICATE----- + +# Issuer: CN=GLOBALTRUST 2020 O=e-commerce monitoring GmbH +# Subject: CN=GLOBALTRUST 2020 O=e-commerce monitoring GmbH +# Label: "GLOBALTRUST 2020" +# Serial: 109160994242082918454945253 +# MD5 Fingerprint: 8a:c7:6f:cb:6d:e3:cc:a2:f1:7c:83:fa:0e:78:d7:e8 +# SHA1 Fingerprint: d0:67:c1:13:51:01:0c:aa:d0:c7:6a:65:37:31:16:26:4f:53:71:a2 +# SHA256 Fingerprint: 9a:29:6a:51:82:d1:d4:51:a2:e3:7f:43:9b:74:da:af:a2:67:52:33:29:f9:0f:9a:0d:20:07:c3:34:e2:3c:9a +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkG +A1UEBhMCQVQxIzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkw +FwYDVQQDExBHTE9CQUxUUlVTVCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYx +MDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAhBgNVBAoTGmUtY29tbWVyY2UgbW9u +aXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAyMDIwMIICIjANBgkq +hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWiD59b +RatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9Z +YybNpyrOVPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3 +QWPKzv9pj2gOlTblzLmMCcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPw +yJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCmfecqQjuCgGOlYx8ZzHyyZqjC0203b+J+ +BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKAA1GqtH6qRNdDYfOiaxaJ +SaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9ORJitHHmkH +r96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj0 +4KlGDfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9Me +dKZssCz3AwyIDMvUclOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIw +q7ejMZdnrY8XD2zHc+0klGvIg5rQmjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2 +nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1UdIwQYMBaAFNwu +H9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA +VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJC +XtzoRlgHNQIw4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd +6IwPS3BD0IL/qMy/pJTAvoe9iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf ++I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS8cE54+X1+NZK3TTN+2/BT+MAi1bi +kvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2HcqtbepBEX4tdJP7 +wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxSvTOB +TI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6C +MUO+1918oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn +4rnvyOL2NSl6dPrFf4IFYqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+I +aFvowdlxfv1k7/9nR4hYJS8+hge9+6jlgqispdNpQ80xiEmEU5LAsTkbOYMBMMTy +qfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg== +-----END CERTIFICATE----- + +# Issuer: CN=ANF Secure Server Root CA O=ANF Autoridad de Certificacion OU=ANF CA Raiz +# Subject: CN=ANF Secure Server Root CA O=ANF Autoridad de Certificacion OU=ANF CA Raiz +# Label: "ANF Secure Server Root CA" +# Serial: 996390341000653745 +# MD5 Fingerprint: 26:a6:44:5a:d9:af:4e:2f:b2:1d:b6:65:b0:4e:e8:96 +# SHA1 Fingerprint: 5b:6e:68:d0:cc:15:b6:a0:5f:1e:c1:5f:ae:02:fc:6b:2f:5d:6f:74 +# SHA256 Fingerprint: fb:8f:ec:75:91:69:b9:10:6b:1e:51:16:44:c6:18:c5:13:04:37:3f:6c:06:43:08:8d:8b:ef:fd:1b:99:75:99 +-----BEGIN CERTIFICATE----- +MIIF7zCCA9egAwIBAgIIDdPjvGz5a7EwDQYJKoZIhvcNAQELBQAwgYQxEjAQBgNV +BAUTCUc2MzI4NzUxMDELMAkGA1UEBhMCRVMxJzAlBgNVBAoTHkFORiBBdXRvcmlk +YWQgZGUgQ2VydGlmaWNhY2lvbjEUMBIGA1UECxMLQU5GIENBIFJhaXoxIjAgBgNV +BAMTGUFORiBTZWN1cmUgU2VydmVyIFJvb3QgQ0EwHhcNMTkwOTA0MTAwMDM4WhcN +MzkwODMwMTAwMDM4WjCBhDESMBAGA1UEBRMJRzYzMjg3NTEwMQswCQYDVQQGEwJF +UzEnMCUGA1UEChMeQU5GIEF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uMRQwEgYD +VQQLEwtBTkYgQ0EgUmFpejEiMCAGA1UEAxMZQU5GIFNlY3VyZSBTZXJ2ZXIgUm9v +dCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANvrayvmZFSVgpCj +cqQZAZ2cC4Ffc0m6p6zzBE57lgvsEeBbphzOG9INgxwruJ4dfkUyYA8H6XdYfp9q +yGFOtibBTI3/TO80sh9l2Ll49a2pcbnvT1gdpd50IJeh7WhM3pIXS7yr/2WanvtH +2Vdy8wmhrnZEE26cLUQ5vPnHO6RYPUG9tMJJo8gN0pcvB2VSAKduyK9o7PQUlrZX +H1bDOZ8rbeTzPvY1ZNoMHKGESy9LS+IsJJ1tk0DrtSOOMspvRdOoiXsezx76W0OL +zc2oD2rKDF65nkeP8Nm2CgtYZRczuSPkdxl9y0oukntPLxB3sY0vaJxizOBQ+OyR +p1RMVwnVdmPF6GUe7m1qzwmd+nxPrWAI/VaZDxUse6mAq4xhj0oHdkLePfTdsiQz +W7i1o0TJrH93PB0j7IKppuLIBkwC/qxcmZkLLxCKpvR/1Yd0DVlJRfbwcVw5Kda/ +SiOL9V8BY9KHcyi1Swr1+KuCLH5zJTIdC2MKF4EA/7Z2Xue0sUDKIbvVgFHlSFJn +LNJhiQcND85Cd8BEc5xEUKDbEAotlRyBr+Qc5RQe8TZBAQIvfXOn3kLMTOmJDVb3 +n5HUA8ZsyY/b2BzgQJhdZpmYgG4t/wHFzstGH6wCxkPmrqKEPMVOHj1tyRRM4y5B +u8o5vzY8KhmqQYdOpc5LMnndkEl/AgMBAAGjYzBhMB8GA1UdIwQYMBaAFJxf0Gxj +o1+TypOYCK2Mh6UsXME3MB0GA1UdDgQWBBScX9BsY6Nfk8qTmAitjIelLFzBNzAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC +AgEATh65isagmD9uw2nAalxJUqzLK114OMHVVISfk/CHGT0sZonrDUL8zPB1hT+L +9IBdeeUXZ701guLyPI59WzbLWoAAKfLOKyzxj6ptBZNscsdW699QIyjlRRA96Gej +rw5VD5AJYu9LWaL2U/HANeQvwSS9eS9OICI7/RogsKQOLHDtdD+4E5UGUcjohybK +pFtqFiGS3XNgnhAY3jyB6ugYw3yJ8otQPr0R4hUDqDZ9MwFsSBXXiJCZBMXM5gf0 +vPSQ7RPi6ovDj6MzD8EpTBNO2hVWcXNyglD2mjN8orGoGjR0ZVzO0eurU+AagNjq +OknkJjCb5RyKqKkVMoaZkgoQI1YS4PbOTOK7vtuNknMBZi9iPrJyJ0U27U1W45eZ +/zo1PqVUSlJZS2Db7v54EX9K3BR5YLZrZAPbFYPhor72I5dQ8AkzNqdxliXzuUJ9 +2zg/LFis6ELhDtjTO0wugumDLmsx2d1Hhk9tl5EuT+IocTUW0fJz/iUrB0ckYyfI ++PbZa/wSMVYIwFNCr5zQM378BvAxRAMU8Vjq8moNqRGyg77FGr8H6lnco4g175x2 +MjxNBiLOFeXdntiP2t7SxDnlF4HPOEfrf4htWRvfn0IUrn7PqLBmZdo3r5+qPeoo +tt7VMVgWglvquxl1AnMaykgaIZOQCo6ThKd9OyMYkomgjaw= +-----END CERTIFICATE----- + +# Issuer: CN=Certum EC-384 CA O=Asseco Data Systems S.A. OU=Certum Certification Authority +# Subject: CN=Certum EC-384 CA O=Asseco Data Systems S.A. OU=Certum Certification Authority +# Label: "Certum EC-384 CA" +# Serial: 160250656287871593594747141429395092468 +# MD5 Fingerprint: b6:65:b3:96:60:97:12:a1:ec:4e:e1:3d:a3:c6:c9:f1 +# SHA1 Fingerprint: f3:3e:78:3c:ac:df:f4:a2:cc:ac:67:55:69:56:d7:e5:16:3c:e1:ed +# SHA256 Fingerprint: 6b:32:80:85:62:53:18:aa:50:d1:73:c9:8d:8b:da:09:d5:7e:27:41:3d:11:4c:f7:87:a0:f5:d0:6c:03:0c:f6 +-----BEGIN CERTIFICATE----- +MIICZTCCAeugAwIBAgIQeI8nXIESUiClBNAt3bpz9DAKBggqhkjOPQQDAzB0MQsw +CQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScw +JQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxGTAXBgNVBAMT +EENlcnR1bSBFQy0zODQgQ0EwHhcNMTgwMzI2MDcyNDU0WhcNNDMwMzI2MDcyNDU0 +WjB0MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBT +LkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxGTAX +BgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATE +KI6rGFtqvm5kN2PkzeyrOvfMobgOgknXhimfoZTy42B4mIF4Bk3y7JoOV2CDn7Tm +Fy8as10CW4kjPMIRBSqniBMY81CE1700LCeJVf/OTOffph8oxPBUw7l8t1Ot68Kj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI0GZnQkdjrzife81r1HfS+8 +EF9LMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNoADBlAjADVS2m5hjEfO/J +UG7BJw+ch69u1RsIGL2SKcHvlJF40jocVYli5RsJHrpka/F2tNQCMQC0QoSZ/6vn +nvuRlydd3LBbMHHOXjgaatkl5+r3YZJW+OraNsKHZZYuciUvf9/DE8k= +-----END CERTIFICATE----- + +# Issuer: CN=Certum Trusted Root CA O=Asseco Data Systems S.A. OU=Certum Certification Authority +# Subject: CN=Certum Trusted Root CA O=Asseco Data Systems S.A. OU=Certum Certification Authority +# Label: "Certum Trusted Root CA" +# Serial: 40870380103424195783807378461123655149 +# MD5 Fingerprint: 51:e1:c2:e7:fe:4c:84:af:59:0e:2f:f4:54:6f:ea:29 +# SHA1 Fingerprint: c8:83:44:c0:18:ae:9f:cc:f1:87:b7:8f:22:d1:c5:d7:45:84:ba:e5 +# SHA256 Fingerprint: fe:76:96:57:38:55:77:3e:37:a9:5e:7a:d4:d9:cc:96:c3:01:57:c1:5d:31:76:5b:a9:b1:57:04:e1:ae:78:fd +-----BEGIN CERTIFICATE----- +MIIFwDCCA6igAwIBAgIQHr9ZULjJgDdMBvfrVU+17TANBgkqhkiG9w0BAQ0FADB6 +MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEu +MScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHzAdBgNV +BAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0EwHhcNMTgwMzE2MTIxMDEzWhcNNDMw +MzE2MTIxMDEzWjB6MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEg +U3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDRLY67tzbqbTeRn06TpwXkKQMlzhyC93yZ +n0EGze2jusDbCSzBfN8pfktlL5On1AFrAygYo9idBcEq2EXxkd7fO9CAAozPOA/q +p1x4EaTByIVcJdPTsuclzxFUl6s1wB52HO8AU5853BSlLCIls3Jy/I2z5T4IHhQq +NwuIPMqw9MjCoa68wb4pZ1Xi/K1ZXP69VyywkI3C7Te2fJmItdUDmj0VDT06qKhF +8JVOJVkdzZhpu9PMMsmN74H+rX2Ju7pgE8pllWeg8xn2A1bUatMn4qGtg/BKEiJ3 +HAVz4hlxQsDsdUaakFjgao4rpUYwBI4Zshfjvqm6f1bxJAPXsiEodg42MEx51UGa +mqi4NboMOvJEGyCI98Ul1z3G4z5D3Yf+xOr1Uz5MZf87Sst4WmsXXw3Hw09Omiqi +7VdNIuJGmj8PkTQkfVXjjJU30xrwCSss0smNtA0Aq2cpKNgB9RkEth2+dv5yXMSF +ytKAQd8FqKPVhJBPC/PgP5sZ0jeJP/J7UhyM9uH3PAeXjA6iWYEMspA90+NZRu0P +qafegGtaqge2Gcu8V/OXIXoMsSt0Puvap2ctTMSYnjYJdmZm/Bo/6khUHL4wvYBQ +v3y1zgD2DGHZ5yQD4OMBgQ692IU0iL2yNqh7XAjlRICMb/gv1SHKHRzQ+8S1h9E6 +Tsd2tTVItQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSM+xx1 +vALTn04uSNn5YFSqxLNP+jAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQAD +ggIBAEii1QALLtA/vBzVtVRJHlpr9OTy4EA34MwUe7nJ+jW1dReTagVphZzNTxl4 +WxmB82M+w85bj/UvXgF2Ez8sALnNllI5SW0ETsXpD4YN4fqzX4IS8TrOZgYkNCvo +zMrnadyHncI013nR03e4qllY/p0m+jiGPp2Kh2RX5Rc64vmNueMzeMGQ2Ljdt4NR +5MTMI9UGfOZR0800McD2RrsLrfw9EAUqO0qRJe6M1ISHgCq8CYyqOhNf6DR5UMEQ +GfnTKB7U0VEwKbOukGfWHwpjscWpxkIxYxeU72nLL/qMFH3EQxiJ2fAyQOaA4kZf +5ePBAFmo+eggvIksDkc0C+pXwlM2/KfUrzHN/gLldfq5Jwn58/U7yn2fqSLLiMmq +0Uc9NneoWWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7D +P78v3DSk+yshzWePS/Tj6tQ/50+6uaWTRRxmHyH6ZF5v4HaUMst19W7l9o/HuKTM +qJZ9ZPskWkoDbGs4xugDQ5r3V7mzKWmTOPQD8rv7gmsHINFSH5pkAnuYZttcTVoP +0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZckbxJF0WddCajJFdr60qZf +E2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb +-----END CERTIFICATE----- + +# Issuer: CN=TunTrust Root CA O=Agence Nationale de Certification Electronique +# Subject: CN=TunTrust Root CA O=Agence Nationale de Certification Electronique +# Label: "TunTrust Root CA" +# Serial: 108534058042236574382096126452369648152337120275 +# MD5 Fingerprint: 85:13:b9:90:5b:36:5c:b6:5e:b8:5a:f8:e0:31:57:b4 +# SHA1 Fingerprint: cf:e9:70:84:0f:e0:73:0f:9d:f6:0c:7f:2c:4b:ee:20:46:34:9c:bb +# SHA256 Fingerprint: 2e:44:10:2a:b5:8c:b8:54:19:45:1c:8e:19:d9:ac:f3:66:2c:af:bc:61:4b:6a:53:96:0a:30:f7:d0:e2:eb:41 +-----BEGIN CERTIFICATE----- +MIIFszCCA5ugAwIBAgIUEwLV4kBMkkaGFmddtLu7sms+/BMwDQYJKoZIhvcNAQEL +BQAwYTELMAkGA1UEBhMCVE4xNzA1BgNVBAoMLkFnZW5jZSBOYXRpb25hbGUgZGUg +Q2VydGlmaWNhdGlvbiBFbGVjdHJvbmlxdWUxGTAXBgNVBAMMEFR1blRydXN0IFJv +b3QgQ0EwHhcNMTkwNDI2MDg1NzU2WhcNNDQwNDI2MDg1NzU2WjBhMQswCQYDVQQG +EwJUTjE3MDUGA1UECgwuQWdlbmNlIE5hdGlvbmFsZSBkZSBDZXJ0aWZpY2F0aW9u +IEVsZWN0cm9uaXF1ZTEZMBcGA1UEAwwQVHVuVHJ1c3QgUm9vdCBDQTCCAiIwDQYJ +KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMPN0/y9BFPdDCA61YguBUtB9YOCfvdZ +n56eY+hz2vYGqU8ftPkLHzmMmiDQfgbU7DTZhrx1W4eI8NLZ1KMKsmwb60ksPqxd +2JQDoOw05TDENX37Jk0bbjBU2PWARZw5rZzJJQRNmpA+TkBuimvNKWfGzC3gdOgF +VwpIUPp6Q9p+7FuaDmJ2/uqdHYVy7BG7NegfJ7/Boce7SBbdVtfMTqDhuazb1YMZ +GoXRlJfXyqNlC/M4+QKu3fZnz8k/9YosRxqZbwUN/dAdgjH8KcwAWJeRTIAAHDOF +li/LQcKLEITDCSSJH7UP2dl3RxiSlGBcx5kDPP73lad9UKGAwqmDrViWVSHbhlnU +r8a83YFuB9tgYv7sEG7aaAH0gxupPqJbI9dkxt/con3YS7qC0lH4Zr8GRuR5KiY2 +eY8fTpkdso8MDhz/yV3A/ZAQprE38806JG60hZC/gLkMjNWb1sjxVj8agIl6qeIb +MlEsPvLfe/ZdeikZjuXIvTZxi11Mwh0/rViizz1wTaZQmCXcI/m4WEEIcb9PuISg +jwBUFfyRbVinljvrS5YnzWuioYasDXxU5mZMZl+QviGaAkYt5IPCgLnPSz7ofzwB +7I9ezX/SKEIBlYrilz0QIX32nRzFNKHsLA4KUiwSVXAkPcvCFDVDXSdOvsC9qnyW +5/yeYa1E0wCXAgMBAAGjYzBhMB0GA1UdDgQWBBQGmpsfU33x9aTI04Y+oXNZtPdE +ITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFAaamx9TffH1pMjThj6hc1m0 +90QhMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAqgVutt0Vyb+z +xiD2BkewhpMl0425yAA/l/VSJ4hxyXT968pk21vvHl26v9Hr7lxpuhbI87mP0zYu +QEkHDVneixCwSQXi/5E/S7fdAo74gShczNxtr18UnH1YeA32gAm56Q6XKRm4t+v4 +FstVEuTGfbvE7Pi1HE4+Z7/FXxttbUcoqgRYYdZ2vyJ/0Adqp2RT8JeNnYA/u8EH +22Wv5psymsNUk8QcCMNE+3tjEUPRahphanltkE8pjkcFwRJpadbGNjHh/PqAulxP +xOu3Mqz4dWEX1xAZufHSCe96Qp1bWgvUxpVOKs7/B9dPfhgGiPEZtdmYu65xxBzn +dFlY7wyJz4sfdZMaBBSSSFCp61cpABbjNhzI+L/wM9VBD8TMPN3pM0MBkRArHtG5 +Xc0yGYuPjCB31yLEQtyEFpslbei0VXF/sHyz03FJuc9SpAQ/3D2gu68zngowYI7b +nV2UqL1g52KAdoGDDIzMMEZJ4gzSqK/rYXHv5yJiqfdcZGyfFoxnNidF9Ql7v/YQ +CvGwjVRDjAS6oz/v4jXH+XTgbzRB0L9zZVcg+ZtnemZoJE6AZb0QmQZZ8mWvuMZH +u/2QeItBcy6vVR/cO5JyboTT0GFMDcx2V+IthSIVNg3rAZ3r2OvEhJn7wAzMMujj +d9qDRIueVSjAi1jTkD5OGwDxFa2DK5o= +-----END CERTIFICATE----- + +# Issuer: CN=HARICA TLS RSA Root CA 2021 O=Hellenic Academic and Research Institutions CA +# Subject: CN=HARICA TLS RSA Root CA 2021 O=Hellenic Academic and Research Institutions CA +# Label: "HARICA TLS RSA Root CA 2021" +# Serial: 76817823531813593706434026085292783742 +# MD5 Fingerprint: 65:47:9b:58:86:dd:2c:f0:fc:a2:84:1f:1e:96:c4:91 +# SHA1 Fingerprint: 02:2d:05:82:fa:88:ce:14:0c:06:79:de:7f:14:10:e9:45:d7:a5:6d +# SHA256 Fingerprint: d9:5d:0e:8e:da:79:52:5b:f9:be:b1:1b:14:d2:10:0d:32:94:98:5f:0c:62:d9:fa:bd:9c:d9:99:ec:cb:7b:1d +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIQOcqTHO9D88aOk8f0ZIk4fjANBgkqhkiG9w0BAQsFADBs +MQswCQYDVQQGEwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBSU0Eg +Um9vdCBDQSAyMDIxMB4XDTIxMDIxOTEwNTUzOFoXDTQ1MDIxMzEwNTUzN1owbDEL +MAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl +YXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgUlNBIFJv +b3QgQ0EgMjAyMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIvC569l +mwVnlskNJLnQDmT8zuIkGCyEf3dRywQRNrhe7Wlxp57kJQmXZ8FHws+RFjZiPTgE +4VGC/6zStGndLuwRo0Xua2s7TL+MjaQenRG56Tj5eg4MmOIjHdFOY9TnuEFE+2uv +a9of08WRiFukiZLRgeaMOVig1mlDqa2YUlhu2wr7a89o+uOkXjpFc5gH6l8Cct4M +pbOfrqkdtx2z/IpZ525yZa31MJQjB/OCFks1mJxTuy/K5FrZx40d/JiZ+yykgmvw +Kh+OC19xXFyuQnspiYHLA6OZyoieC0AJQTPb5lh6/a6ZcMBaD9YThnEvdmn8kN3b +LW7R8pv1GmuebxWMevBLKKAiOIAkbDakO/IwkfN4E8/BPzWr8R0RI7VDIp4BkrcY +AuUR0YLbFQDMYTfBKnya4dC6s1BG7oKsnTH4+yPiAwBIcKMJJnkVU2DzOFytOOqB +AGMUuTNe3QvboEUHGjMJ+E20pwKmafTCWQWIZYVWrkvL4N48fS0ayOn7H6NhStYq +E613TBoYm5EPWNgGVMWX+Ko/IIqmhaZ39qb8HOLubpQzKoNQhArlT4b4UEV4AIHr +W2jjJo3Me1xR9BQsQL4aYB16cmEdH2MtiKrOokWQCPxrvrNQKlr9qEgYRtaQQJKQ +CoReaDH46+0N0x3GfZkYVVYnZS6NRcUk7M7jAgMBAAGjQjBAMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFApII6ZgpJIKM+qTW8VX6iVNvRLuMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAPpBIqm5iFSVmewzVjIuJndftTgfvnNAU +X15QvWiWkKQUEapobQk1OUAJ2vQJLDSle1mESSmXdMgHHkdt8s4cUCbjnj1AUz/3 +f5Z2EMVGpdAgS1D0NTsY9FVqQRtHBmg8uwkIYtlfVUKqrFOFrJVWNlar5AWMxaja +H6NpvVMPxP/cyuN+8kyIhkdGGvMA9YCRotxDQpSbIPDRzbLrLFPCU3hKTwSUQZqP +JzLB5UkZv/HywouoCjkxKLR9YjYsTewfM7Z+d21+UPCfDtcRj88YxeMn/ibvBZ3P +zzfF0HvaO7AWhAw6k9a+F9sPPg4ZeAnHqQJyIkv3N3a6dcSFA1pj1bF1BcK5vZSt +jBWZp5N99sXzqnTPBIWUmAD04vnKJGW/4GKvyMX6ssmeVkjaef2WdhW+o45WxLM0 +/L5H9MG0qPzVMIho7suuyWPEdr6sOBjhXlzPrjoiUevRi7PzKzMHVIf6tLITe7pT +BGIBnfHAT+7hOtSLIBD6Alfm78ELt5BGnBkpjNxvoEppaZS3JGWg/6w/zgH7IS79 +aPib8qXPMThcFarmlwDB31qlpzmq6YR/PFGoOtmUW4y/Twhx5duoXNTSpv4Ao8YW +xw/ogM4cKGR0GQjTQuPOAF1/sdwTsOEFy9EgqoZ0njnnkf3/W9b3raYvAwtt41dU +63ZTGI0RmLo= +-----END CERTIFICATE----- + +# Issuer: CN=HARICA TLS ECC Root CA 2021 O=Hellenic Academic and Research Institutions CA +# Subject: CN=HARICA TLS ECC Root CA 2021 O=Hellenic Academic and Research Institutions CA +# Label: "HARICA TLS ECC Root CA 2021" +# Serial: 137515985548005187474074462014555733966 +# MD5 Fingerprint: ae:f7:4c:e5:66:35:d1:b7:9b:8c:22:93:74:d3:4b:b0 +# SHA1 Fingerprint: bc:b0:c1:9d:e9:98:92:70:19:38:57:e9:8d:a7:b4:5d:6e:ee:01:48 +# SHA256 Fingerprint: 3f:99:cc:47:4a:cf:ce:4d:fe:d5:87:94:66:5e:47:8d:15:47:73:9f:2e:78:0f:1b:b4:ca:9b:13:30:97:d4:01 +-----BEGIN CERTIFICATE----- +MIICVDCCAdugAwIBAgIQZ3SdjXfYO2rbIvT/WeK/zjAKBggqhkjOPQQDAzBsMQsw +CQYDVQQGEwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2Vh +cmNoIEluc3RpdHV0aW9ucyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBFQ0MgUm9v +dCBDQSAyMDIxMB4XDTIxMDIxOTExMDExMFoXDTQ1MDIxMzExMDEwOVowbDELMAkG +A1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj +aCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgRUNDIFJvb3Qg +Q0EgMjAyMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABDgI/rGgltJ6rK9JOtDA4MM7 +KKrxcm1lAEeIhPyaJmuqS7psBAqIXhfyVYf8MLA04jRYVxqEU+kw2anylnTDUR9Y +STHMmE5gEYd103KUkE+bECUqqHgtvpBBWJAVcqeht6NCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUyRtTgRL+BNUW0aq8mm+3oJUZbsowDgYDVR0PAQH/BAQD +AgGGMAoGCCqGSM49BAMDA2cAMGQCMBHervjcToiwqfAircJRQO9gcS3ujwLEXQNw +SaSS6sUUiHCm0w2wqsosQJz76YJumgIwK0eaB8bRwoF8yguWGEEbo/QwCZ61IygN +nxS2PFOiTAZpffpskcYqSUXm7LcT4Tps +-----END CERTIFICATE----- diff --git a/vendor/grpc/grpc/src/lib/AbstractCall.php b/vendor/grpc/grpc/src/lib/AbstractCall.php new file mode 100644 index 0000000..d1a186a --- /dev/null +++ b/vendor/grpc/grpc/src/lib/AbstractCall.php @@ -0,0 +1,147 @@ +add($delta); + } else { + $deadline = Timeval::infFuture(); + } + $this->call = new Call($channel, $method, $deadline); + $this->deserialize = $deserialize; + $this->metadata = null; + $this->trailing_metadata = null; + if (array_key_exists('call_credentials_callback', $options) && + is_callable($call_credentials_callback = + $options['call_credentials_callback']) + ) { + $call_credentials = CallCredentials::createFromPlugin( + $call_credentials_callback + ); + $this->call->setCredentials($call_credentials); + } + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * @return mixed The trailing metadata sent by the server + */ + public function getTrailingMetadata() + { + return $this->trailing_metadata; + } + + /** + * @return string The URI of the endpoint + */ + public function getPeer() + { + return $this->call->getPeer(); + } + + /** + * Cancels the call. + */ + public function cancel() + { + $this->call->cancel(); + } + + /** + * Serialize a message to the protobuf binary format. + * + * @param mixed $data The Protobuf message + * + * @return string The protobuf binary format + */ + protected function _serializeMessage($data) + { + // Proto3 implementation + return $data->serializeToString(); + } + + /** + * Deserialize a response value to an object. + * + * @param string $value The binary value to deserialize + * + * @return mixed The deserialized value + */ + protected function _deserializeResponse($value) + { + if ($value === null) { + return; + } + list($className, $deserializeFunc) = $this->deserialize; + $obj = new $className(); + $obj->mergeFromString($value); + return $obj; + } + + /** + * Set the CallCredentials for the underlying Call. + * + * @param CallCredentials $call_credentials The CallCredentials object + */ + public function setCallCredentials($call_credentials) + { + $this->call->setCredentials($call_credentials); + } +} diff --git a/vendor/grpc/grpc/src/lib/BaseStub.php b/vendor/grpc/grpc/src/lib/BaseStub.php new file mode 100644 index 0000000..97d0b24 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/BaseStub.php @@ -0,0 +1,618 @@ +hostname = $hostname; + $this->update_metadata = null; + if (isset($opts['update_metadata'])) { + if (is_callable($opts['update_metadata'])) { + $this->update_metadata = $opts['update_metadata']; + } + unset($opts['update_metadata']); + } + if (!empty($opts['grpc.ssl_target_name_override'])) { + $this->hostname_override = $opts['grpc.ssl_target_name_override']; + } + if (isset($opts['grpc_call_invoker'])) { + $this->call_invoker = $opts['grpc_call_invoker']; + unset($opts['grpc_call_invoker']); + $channel_opts = $this->updateOpts($opts); + // If the grpc_call_invoker is defined, use the channel created by the call invoker. + $this->channel = $this->call_invoker->createChannelFactory($hostname, $channel_opts); + return; + } + $this->call_invoker = new DefaultCallInvoker(); + if ($channel) { + if (!is_a($channel, 'Grpc\Channel') && + !is_a($channel, 'Grpc\Internal\InterceptorChannel')) { + throw new \Exception('The channel argument is not a Channel object '. + 'or an InterceptorChannel object created by '. + 'Interceptor::intercept($channel, Interceptor|Interceptor[] $interceptors)'); + } + $this->channel = $channel; + return; + } + + $this->channel = static::getDefaultChannel($hostname, $opts); + } + + private static function updateOpts($opts) { + if (!empty($opts['grpc.primary_user_agent'])) { + $opts['grpc.primary_user_agent'] .= ' '; + } else { + $opts['grpc.primary_user_agent'] = ''; + } + if (defined('\Grpc\VERSION')) { + $version_str = \Grpc\VERSION; + } else { + if (!file_exists($composerFile = __DIR__.'/../../composer.json')) { + // for grpc/grpc-php subpackage + $composerFile = __DIR__.'/../composer.json'; + } + $package_config = json_decode(file_get_contents($composerFile), true); + $version_str = $package_config['version']; + } + $opts['grpc.primary_user_agent'] .= 'grpc-php/'.$version_str; + if (!array_key_exists('credentials', $opts)) { + throw new \Exception("The opts['credentials'] key is now ". + 'required. Please see one of the '. + 'ChannelCredentials::create methods'); + } + return $opts; + } + + /** + * Creates and returns the default Channel + * + * @param array $opts Channel constructor options + * + * @return Channel The channel + */ + public static function getDefaultChannel($hostname, array $opts) + { + $channel_opts = self::updateOpts($opts); + return new Channel($hostname, $channel_opts); + } + + /** + * @return string The URI of the endpoint + */ + public function getTarget() + { + return $this->channel->getTarget(); + } + + /** + * @param bool $try_to_connect (optional) + * + * @return int The grpc connectivity state + */ + public function getConnectivityState($try_to_connect = false) + { + return $this->channel->getConnectivityState($try_to_connect); + } + + /** + * @param int $timeout in microseconds + * + * @return bool true if channel is ready + * @throws Exception if channel is in FATAL_ERROR state + */ + public function waitForReady($timeout) + { + $new_state = $this->getConnectivityState(true); + if ($this->_checkConnectivityState($new_state)) { + return true; + } + + $now = Timeval::now(); + $delta = new Timeval($timeout); + $deadline = $now->add($delta); + + while ($this->channel->watchConnectivityState($new_state, $deadline)) { + // state has changed before deadline + $new_state = $this->getConnectivityState(); + if ($this->_checkConnectivityState($new_state)) { + return true; + } + } + // deadline has passed + $new_state = $this->getConnectivityState(); + + return $this->_checkConnectivityState($new_state); + } + + /** + * Close the communication channel associated with this stub. + */ + public function close() + { + $this->channel->close(); + } + + /** + * @param $new_state Connect state + * + * @return bool true if state is CHANNEL_READY + * @throws Exception if state is CHANNEL_FATAL_FAILURE + */ + private function _checkConnectivityState($new_state) + { + if ($new_state == \Grpc\CHANNEL_READY) { + return true; + } + if ($new_state == \Grpc\CHANNEL_FATAL_FAILURE) { + throw new \Exception('Failed to connect to server'); + } + + return false; + } + + /** + * constructs the auth uri for the jwt. + * + * @param string $method The method string + * + * @return string The URL string + */ + private function _get_jwt_aud_uri($method) + { + // TODO(jtattermusch): This is not the correct implementation + // of extracting JWT "aud" claim. We should rely on + // grpc_metadata_credentials_plugin which + // also provides the correct value of "aud" claim + // in the grpc_auth_metadata_context.service_url field. + // Trying to do the construction of "aud" field ourselves + // is bad. + $last_slash_idx = strrpos($method, '/'); + if ($last_slash_idx === false) { + throw new \InvalidArgumentException( + 'service name must have a slash' + ); + } + $service_name = substr($method, 0, $last_slash_idx); + + if ($this->hostname_override) { + $hostname = $this->hostname_override; + } else { + $hostname = $this->hostname; + } + + // Remove the port if it is 443 + // See https://github.com/grpc/grpc/blob/07c9f7a36b2a0d34fcffebc85649cf3b8c339b5d/src/core/filter/auth/client_auth_filter.cc#L205 + if ((strlen($hostname) > 4) && (substr($hostname, -4) === ":443")) { + $hostname = substr($hostname, 0, -4); + } + + return 'https://'.$hostname.$service_name; + } + + /** + * validate and normalize the metadata array. + * + * @param array $metadata The metadata map + * + * @return array $metadata Validated and key-normalized metadata map + * @throws InvalidArgumentException if key contains invalid characters + */ + private function _validate_and_normalize_metadata($metadata) + { + $metadata_copy = []; + foreach ($metadata as $key => $value) { + if (!preg_match('/^[.A-Za-z\d_-]+$/', $key)) { + throw new \InvalidArgumentException( + 'Metadata keys must be nonempty strings containing only '. + 'alphanumeric characters, hyphens, underscores and dots' + ); + } + $metadata_copy[strtolower($key)] = $value; + } + + return $metadata_copy; + } + + /** + * Create a function which can be used to create UnaryCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcUnaryUnary($channel) + { + return function ($method, + $argument, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + $call = $this->call_invoker->UnaryCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($argument, $metadata, $options); + return $call; + }; + } + + /** + * Create a function which can be used to create ServerStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcStreamUnary($channel) + { + return function ($method, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + $call = $this->call_invoker->ClientStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($metadata); + return $call; + }; + } + + /** + * Create a function which can be used to create ClientStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcUnaryStream($channel) + { + return function ($method, + $argument, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + $call = $this->call_invoker->ServerStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($argument, $metadata, $options); + return $call; + }; + } + + /** + * Create a function which can be used to create BidiStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcStreamStream($channel) + { + return function ($method, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + $call = $this->call_invoker->BidiStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($metadata); + + return $call; + }; + } + + /** + * Create a function which can be used to create UnaryCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _UnaryUnaryCallFactory($channel) + { + if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) { + return function ($method, + $argument, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + return $channel->getInterceptor()->interceptUnaryUnary( + $method, + $argument, + $deserialize, + $this->_UnaryUnaryCallFactory($channel->getNext()), + $metadata, + $options + ); + }; + } + return $this->_GrpcUnaryUnary($channel); + } + + /** + * Create a function which can be used to create ServerStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _UnaryStreamCallFactory($channel) + { + if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) { + return function ($method, + $argument, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + return $channel->getInterceptor()->interceptUnaryStream( + $method, + $argument, + $deserialize, + $this->_UnaryStreamCallFactory($channel->getNext()), + $metadata, + $options + ); + }; + } + return $this->_GrpcUnaryStream($channel); + } + + /** + * Create a function which can be used to create ClientStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _StreamUnaryCallFactory($channel) + { + if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) { + return function ($method, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + return $channel->getInterceptor()->interceptStreamUnary( + $method, + $deserialize, + $this->_StreamUnaryCallFactory($channel->getNext()), + $metadata, + $options + ); + }; + } + return $this->_GrpcStreamUnary($channel); + } + + /** + * Create a function which can be used to create BidiStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _StreamStreamCallFactory($channel) + { + if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) { + return function ($method, + $deserialize, + array $metadata = [], + array $options = []) use ($channel) { + return $channel->getInterceptor()->interceptStreamStream( + $method, + $deserialize, + $this->_StreamStreamCallFactory($channel->getNext()), + $metadata, + $options + ); + }; + } + return $this->_GrpcStreamStream($channel); + } + + /* This class is intended to be subclassed by generated code, so + * all functions begin with "_" to avoid name collisions. */ + /** + * Call a remote method that takes a single argument and has a + * single output. + * + * @param string $method The name of the method to call + * @param mixed $argument The argument to the method + * @param callable $deserialize A function that deserializes the response + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return UnaryCall The active call object + */ + protected function _simpleRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_UnaryUnaryCallFactory($this->channel); + $call = $call_factory($method, $argument, $deserialize, $metadata, $options); + return $call; + } + + /** + * Call a remote method that takes a stream of arguments and has a single + * output. + * + * @param string $method The name of the method to call + * @param callable $deserialize A function that deserializes the response + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return ClientStreamingCall The active call object + */ + protected function _clientStreamRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_StreamUnaryCallFactory($this->channel); + $call = $call_factory($method, $deserialize, $metadata, $options); + return $call; + } + + /** + * Call a remote method that takes a single argument and returns a stream + * of responses. + * + * @param string $method The name of the method to call + * @param mixed $argument The argument to the method + * @param callable $deserialize A function that deserializes the responses + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return ServerStreamingCall The active call object + */ + protected function _serverStreamRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_UnaryStreamCallFactory($this->channel); + $call = $call_factory($method, $argument, $deserialize, $metadata, $options); + return $call; + } + + /** + * Call a remote method with messages streaming in both directions. + * + * @param string $method The name of the method to call + * @param callable $deserialize A function that deserializes the responses + * @param array $metadata A metadata map to send to the server + * (optional) + * @param array $options An array of options (optional) + * + * @return BidiStreamingCall The active call object + */ + protected function _bidiRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_StreamStreamCallFactory($this->channel); + $call = $call_factory($method, $deserialize, $metadata, $options); + return $call; + } +} diff --git a/vendor/grpc/grpc/src/lib/BidiStreamingCall.php b/vendor/grpc/grpc/src/lib/BidiStreamingCall.php new file mode 100644 index 0000000..be79c5d --- /dev/null +++ b/vendor/grpc/grpc/src/lib/BidiStreamingCall.php @@ -0,0 +1,105 @@ +call->startBatch([ + OP_SEND_INITIAL_METADATA => $metadata, + ]); + } + + /** + * Reads the next value from the server. + * + * @return mixed The next value from the server, or null if there is none + */ + public function read() + { + $batch = [OP_RECV_MESSAGE => true]; + if ($this->metadata === null) { + $batch[OP_RECV_INITIAL_METADATA] = true; + } + $read_event = $this->call->startBatch($batch); + if ($this->metadata === null) { + $this->metadata = $read_event->metadata; + } + + return $this->_deserializeResponse($read_event->message); + } + + /** + * Write a single message to the server. This cannot be called after + * writesDone is called. + * + * @param ByteBuffer $data The data to write + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function write($data, array $options = []) + { + $message_array = ['message' => $this->_serializeMessage($data)]; + if (array_key_exists('flags', $options)) { + $message_array['flags'] = $options['flags']; + } + $this->call->startBatch([ + OP_SEND_MESSAGE => $message_array, + ]); + } + + /** + * Indicate that no more writes will be sent. + */ + public function writesDone() + { + $this->call->startBatch([ + OP_SEND_CLOSE_FROM_CLIENT => true, + ]); + } + + /** + * Wait for the server to send the status, and return it. + * + * @return \stdClass The status object, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + $status_event = $this->call->startBatch([ + OP_RECV_STATUS_ON_CLIENT => true, + ]); + + $this->trailing_metadata = $status_event->status->metadata; + + return $status_event->status; + } +} diff --git a/vendor/grpc/grpc/src/lib/CallInvoker.php b/vendor/grpc/grpc/src/lib/CallInvoker.php new file mode 100644 index 0000000..aacd54e --- /dev/null +++ b/vendor/grpc/grpc/src/lib/CallInvoker.php @@ -0,0 +1,32 @@ +call->startBatch([ + OP_SEND_INITIAL_METADATA => $metadata, + ]); + } + + /** + * Write a single message to the server. This cannot be called after + * wait is called. + * + * @param ByteBuffer $data The data to write + * @param array $options An array of options, possible keys: + * 'flags' => a number (optional) + */ + public function write($data, array $options = []) + { + $message_array = ['message' => $this->_serializeMessage($data)]; + if (array_key_exists('flags', $options)) { + $message_array['flags'] = $options['flags']; + } + $this->call->startBatch([ + OP_SEND_MESSAGE => $message_array, + ]); + } + + /** + * Wait for the server to respond with data and a status. + * + * @return array [response data, status] + */ + public function wait() + { + $event = $this->call->startBatch([ + OP_SEND_CLOSE_FROM_CLIENT => true, + OP_RECV_INITIAL_METADATA => true, + OP_RECV_MESSAGE => true, + OP_RECV_STATUS_ON_CLIENT => true, + ]); + $this->metadata = $event->metadata; + + $status = $event->status; + $this->trailing_metadata = $status->metadata; + + return [$this->_deserializeResponse($event->message), $status]; + } +} diff --git a/vendor/grpc/grpc/src/lib/DefaultCallInvoker.php b/vendor/grpc/grpc/src/lib/DefaultCallInvoker.php new file mode 100644 index 0000000..217dafa --- /dev/null +++ b/vendor/grpc/grpc/src/lib/DefaultCallInvoker.php @@ -0,0 +1,46 @@ += 0; $i--) { + $channel = new Internal\InterceptorChannel($channel, $interceptors[$i]); + } + } else { + $channel = new Internal\InterceptorChannel($channel, $interceptors); + } + return $channel; + } +} + diff --git a/vendor/grpc/grpc/src/lib/Internal/InterceptorChannel.php b/vendor/grpc/grpc/src/lib/Internal/InterceptorChannel.php new file mode 100644 index 0000000..2f85c35 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/Internal/InterceptorChannel.php @@ -0,0 +1,76 @@ +interceptor = $interceptor; + $this->next = $channel; + } + + public function getNext() + { + return $this->next; + } + + public function getInterceptor() + { + return $this->interceptor; + } + + public function getTarget() + { + return $this->getNext()->getTarget(); + } + + public function watchConnectivityState($new_state, $deadline) + { + return $this->getNext()->watchConnectivityState($new_state, $deadline); + } + + public function getConnectivityState($try_to_connect = false) + { + return $this->getNext()->getConnectivityState($try_to_connect); + } + + public function close() + { + return $this->getNext()->close(); + } +} diff --git a/vendor/grpc/grpc/src/lib/MethodDescriptor.php b/vendor/grpc/grpc/src/lib/MethodDescriptor.php new file mode 100644 index 0000000..c0faf75 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/MethodDescriptor.php @@ -0,0 +1,52 @@ +service = $service; + $this->method_name = $method_name; + $this->request_type = $request_type; + $this->call_type = $call_type; + } + + public const UNARY_CALL = 0; + public const SERVER_STREAMING_CALL = 1; + public const CLIENT_STREAMING_CALL = 2; + public const BIDI_STREAMING_CALL = 3; + + public $service; + public $method_name; + public $request_type; + public $call_type; +} diff --git a/vendor/grpc/grpc/src/lib/RpcServer.php b/vendor/grpc/grpc/src/lib/RpcServer.php new file mode 100644 index 0000000..c631e58 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/RpcServer.php @@ -0,0 +1,151 @@ + => MethodDescriptor ] + private $paths_map = []; + + private function waitForNextEvent() + { + return $this->requestCall(); + } + + /** + * Add a service to this server + * + * @param Object $service The service to be added + */ + public function handle($service) + { + $methodDescriptors = $service->getMethodDescriptors(); + $exist_methods = array_intersect_key($this->paths_map, $methodDescriptors); + if (!empty($exist_methods)) { + fwrite(STDERR, "WARNING: " . 'override already registered methods: ' . + implode(', ', array_keys($exist_methods)) . PHP_EOL); + } + + $this->paths_map = array_merge($this->paths_map, $methodDescriptors); + return $this->paths_map; + } + + public function run() + { + $this->start(); + while (true) try { + // This blocks until the server receives a request + $event = $this->waitForNextEvent(); + + $full_path = $event->method; + $context = new ServerContext($event); + $server_writer = new ServerCallWriter($event->call, $context); + + if (!array_key_exists($full_path, $this->paths_map)) { + $context->setStatus(Status::unimplemented()); + $server_writer->finish(); + continue; + }; + + $method_desc = $this->paths_map[$full_path]; + $server_reader = new ServerCallReader( + $event->call, + $method_desc->request_type + ); + + try { + $this->processCall( + $method_desc, + $server_reader, + $server_writer, + $context + ); + } catch (\Exception $e) { + $context->setStatus(Status::status( + STATUS_INTERNAL, + $e->getMessage() + )); + $server_writer->finish(); + } + } catch (\Exception $e) { + fwrite(STDERR, "ERROR: " . $e->getMessage() . PHP_EOL); + exit(1); + } + } + + private function processCall( + MethodDescriptor $method_desc, + ServerCallReader $server_reader, + ServerCallWriter $server_writer, + ServerContext $context + ) { + // Dispatch to actual server logic + switch ($method_desc->call_type) { + case MethodDescriptor::UNARY_CALL: + $request = $server_reader->read(); + $response = + call_user_func( + array($method_desc->service, $method_desc->method_name), + $request ?? new $method_desc->request_type, + $context + ); + $server_writer->finish($response); + break; + case MethodDescriptor::SERVER_STREAMING_CALL: + $request = $server_reader->read(); + call_user_func( + array($method_desc->service, $method_desc->method_name), + $request ?? new $method_desc->request_type, + $server_writer, + $context + ); + break; + case MethodDescriptor::CLIENT_STREAMING_CALL: + $response = call_user_func( + array($method_desc->service, $method_desc->method_name), + $server_reader, + $context + ); + $server_writer->finish($response); + break; + case MethodDescriptor::BIDI_STREAMING_CALL: + call_user_func( + array($method_desc->service, $method_desc->method_name), + $server_reader, + $server_writer, + $context + ); + break; + default: + throw new \Exception(); + } + } +} diff --git a/vendor/grpc/grpc/src/lib/ServerCallReader.php b/vendor/grpc/grpc/src/lib/ServerCallReader.php new file mode 100644 index 0000000..a886448 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/ServerCallReader.php @@ -0,0 +1,52 @@ +call_ = $call; + $this->request_type_ = $request_type; + } + + public function read() + { + $event = $this->call_->startBatch([ + OP_RECV_MESSAGE => true, + ]); + if ($event->message === null) { + return null; + } + $data = new $this->request_type_; + $data->mergeFromString($event->message); + return $data; + } + + private $call_; + private $request_type_; +} diff --git a/vendor/grpc/grpc/src/lib/ServerCallWriter.php b/vendor/grpc/grpc/src/lib/ServerCallWriter.php new file mode 100644 index 0000000..40fbe99 --- /dev/null +++ b/vendor/grpc/grpc/src/lib/ServerCallWriter.php @@ -0,0 +1,109 @@ +call_ = $call; + $this->serverContext_ = $serverContext; + } + + public function start( + $data = null, + array $options = [] + ) { + $batch = []; + $this->addSendInitialMetadataOpIfNotSent( + $batch, + $this->serverContext_->initialMetadata() + ); + $this->addSendMessageOpIfHasData($batch, $data, $options); + $this->call_->startBatch($batch); + } + + public function write( + $data, + array $options = [] + ) { + $batch = []; + $this->addSendInitialMetadataOpIfNotSent( + $batch, + $this->serverContext_->initialMetadata() + ); + $this->addSendMessageOpIfHasData($batch, $data, $options); + $this->call_->startBatch($batch); + } + + public function finish( + $data = null, + array $options = [] + ) { + $batch = [ + OP_SEND_STATUS_FROM_SERVER => + $this->serverContext_->status() ?? Status::ok(), + OP_RECV_CLOSE_ON_SERVER => true, + ]; + $this->addSendInitialMetadataOpIfNotSent( + $batch, + $this->serverContext_->initialMetadata() + ); + $this->addSendMessageOpIfHasData($batch, $data, $options); + $this->call_->startBatch($batch); + } + + //////////////////////////// + + private function addSendInitialMetadataOpIfNotSent( + array &$batch, + ?array $initialMetadata = null + ) { + if (!$this->initialMetadataSent_) { + $batch[OP_SEND_INITIAL_METADATA] = $initialMetadata ?? []; + $this->initialMetadataSent_ = true; + } + } + + private function addSendMessageOpIfHasData( + array &$batch, + $data = null, + array $options = [] + ) { + if ($data) { + $message_array = ['message' => $data->serializeToString()]; + if (array_key_exists('flags', $options)) { + $message_array['flags'] = $options['flags']; + } + $batch[OP_SEND_MESSAGE] = $message_array; + } + } + + private $call_; + private $initialMetadataSent_ = false; + private $serverContext_; +} diff --git a/vendor/grpc/grpc/src/lib/ServerContext.php b/vendor/grpc/grpc/src/lib/ServerContext.php new file mode 100644 index 0000000..104250e --- /dev/null +++ b/vendor/grpc/grpc/src/lib/ServerContext.php @@ -0,0 +1,76 @@ +event = $event; + } + + public function clientMetadata() + { + return $this->event->metadata; + } + public function deadline() + { + return $this->event->absolute_deadline; + } + public function host() + { + return $this->event->host; + } + public function method() + { + return $this->event->method; + } + + public function setInitialMetadata($initialMetadata) + { + $this->initialMetadata_ = $initialMetadata; + } + + public function initialMetadata() + { + return $this->initialMetadata_; + } + + public function setStatus($status) + { + $this->status_ = $status; + } + + public function status() + { + return $this->status_; + } + + private $event; + private $initialMetadata_; + private $status_; +} diff --git a/vendor/grpc/grpc/src/lib/ServerStreamingCall.php b/vendor/grpc/grpc/src/lib/ServerStreamingCall.php new file mode 100644 index 0000000..f8fddfe --- /dev/null +++ b/vendor/grpc/grpc/src/lib/ServerStreamingCall.php @@ -0,0 +1,100 @@ + a number (optional) + */ + public function start($data, array $metadata = [], array $options = []) + { + $message_array = ['message' => $this->_serializeMessage($data)]; + if (array_key_exists('flags', $options)) { + $message_array['flags'] = $options['flags']; + } + $this->call->startBatch([ + OP_SEND_INITIAL_METADATA => $metadata, + OP_SEND_MESSAGE => $message_array, + OP_SEND_CLOSE_FROM_CLIENT => true, + ]); + } + + /** + * @return mixed An iterator of response values + */ + public function responses() + { + $batch = [OP_RECV_MESSAGE => true]; + if ($this->metadata === null) { + $batch[OP_RECV_INITIAL_METADATA] = true; + } + $read_event = $this->call->startBatch($batch); + if ($this->metadata === null) { + $this->metadata = $read_event->metadata; + } + $response = $read_event->message; + while ($response !== null) { + yield $this->_deserializeResponse($response); + $response = $this->call->startBatch([ + OP_RECV_MESSAGE => true, + ])->message; + } + } + + /** + * Wait for the server to send the status, and return it. + * + * @return \stdClass The status object, with integer $code, string + * $details, and array $metadata members + */ + public function getStatus() + { + $status_event = $this->call->startBatch([ + OP_RECV_STATUS_ON_CLIENT => true, + ]); + + $this->trailing_metadata = $status_event->status->metadata; + + return $status_event->status; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + if ($this->metadata === null) { + $event = $this->call->startBatch([OP_RECV_INITIAL_METADATA => true]); + $this->metadata = $event->metadata; + } + return $this->metadata; + } +} diff --git a/vendor/grpc/grpc/src/lib/Status.php b/vendor/grpc/grpc/src/lib/Status.php new file mode 100644 index 0000000..d47480f --- /dev/null +++ b/vendor/grpc/grpc/src/lib/Status.php @@ -0,0 +1,55 @@ + $code, + 'details' => $details, + ]; + if ($metadata) { + $status['metadata'] = $metadata; + } + return $status; + } + + public static function ok(?array $metadata = null): array + { + return Status::status(STATUS_OK, 'OK', $metadata); + } + public static function unimplemented(): array + { + return Status::status(STATUS_UNIMPLEMENTED, 'UNIMPLEMENTED'); + } +} diff --git a/vendor/grpc/grpc/src/lib/UnaryCall.php b/vendor/grpc/grpc/src/lib/UnaryCall.php new file mode 100644 index 0000000..4b7180f --- /dev/null +++ b/vendor/grpc/grpc/src/lib/UnaryCall.php @@ -0,0 +1,87 @@ + a number (optional) + */ + public function start($data, array $metadata = [], array $options = []) + { + $message_array = ['message' => $this->_serializeMessage($data)]; + if (isset($options['flags'])) { + $message_array['flags'] = $options['flags']; + } + $this->call->startBatch([ + OP_SEND_INITIAL_METADATA => $metadata, + OP_SEND_MESSAGE => $message_array, + OP_SEND_CLOSE_FROM_CLIENT => true, + ]); + } + + /** + * Wait for the server to respond with data and a status. + * + * @return array{0: T|null, 1: \stdClass} [response data, status] + */ + public function wait() + { + $batch = [ + OP_RECV_MESSAGE => true, + OP_RECV_STATUS_ON_CLIENT => true, + ]; + if ($this->metadata === null) { + $batch[OP_RECV_INITIAL_METADATA] = true; + } + $event = $this->call->startBatch($batch); + if ($this->metadata === null) { + $this->metadata = $event->metadata; + } + $status = $event->status; + $this->trailing_metadata = $status->metadata; + + return [$this->_deserializeResponse($event->message), $status]; + } + + /** + * @return mixed The metadata sent by the server + */ + public function getMetadata() + { + if ($this->metadata === null) { + $event = $this->call->startBatch([OP_RECV_INITIAL_METADATA => true]); + $this->metadata = $event->metadata; + } + return $this->metadata; + } +} diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md new file mode 100644 index 0000000..5fe721e --- /dev/null +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -0,0 +1,1683 @@ +# Change Log + +Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. + +## 7.10.0 - 2025-08-23 + +### Added + +- Support for PHP 8.5 + +### Changed + +- Adjusted `guzzlehttp/promises` version constraint to `^2.3` +- Adjusted `guzzlehttp/psr7` version constraint to `^2.8` + + +## 7.9.3 - 2025-03-27 + +### Changed + +- Remove explicit content-length header for GET requests +- Improve compatibility with bad servers for boolean cookie values + + +## 7.9.2 - 2024-07-24 + +### Fixed + +- Adjusted handler selection to use cURL if its version is 7.21.2 or higher, rather than 7.34.0 + + +## 7.9.1 - 2024-07-19 + +### Fixed + +- Fix TLS 1.3 check for HTTP/2 requests + + +## 7.9.0 - 2024-07-18 + +### Changed + +- Improve protocol version checks to provide feedback around unsupported protocols +- Only select the cURL handler by default if 7.34.0 or higher is linked +- Improved `CurlMultiHandler` to avoid busy wait if possible +- Dropped support for EOL `guzzlehttp/psr7` v1 +- Improved URI user info redaction in errors + +## 7.8.2 - 2024-07-18 + +### Added + +- Support for PHP 8.4 + + +## 7.8.1 - 2023-12-03 + +### Changed + +- Updated links in docs to their canonical versions +- Replaced `call_user_func*` with native calls + + +## 7.8.0 - 2023-08-27 + +### Added + +- Support for PHP 8.3 +- Added automatic closing of handles on `CurlFactory` object destruction + + +## 7.7.1 - 2023-08-27 + +### Changed + +- Remove the need for `AllowDynamicProperties` in `CurlMultiHandler` + + +## 7.7.0 - 2023-05-21 + +### Added + +- Support `guzzlehttp/promises` v2 + + +## 7.6.1 - 2023-05-15 + +### Fixed + +- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values + + +## 7.6.0 - 2023-05-14 + +### Added + +- Support for setting the minimum TLS version in a unified way +- Apply on request the version set in options parameters + + +## 7.5.2 - 2023-05-14 + +### Fixed + +- Fixed set cookie constructor validation +- Fixed handling of files with `'0'` body + +### Changed + +- Corrected docs and default connect timeout value to 300 seconds + + +## 7.5.1 - 2023-04-17 + +### Fixed + +- Fixed `NO_PROXY` settings so that setting the `proxy` option to `no` overrides the env variable + +### Changed + +- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5` + + +## 7.5.0 - 2022-08-28 + +### Added + +- Support PHP 8.2 +- Add request to delay closure params + + +## 7.4.5 - 2022-06-20 + +### Fixed + +* Fix change in port should be considered a change in origin +* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin + + +## 7.4.4 - 2022-06-09 + +### Fixed + +* Fix failure to strip Authorization header on HTTP downgrade +* Fix failure to strip the Cookie header on change in host or HTTP downgrade + + +## 7.4.3 - 2022-05-25 + +### Fixed + +* Fix cross-domain cookie leakage + + +## 7.4.2 - 2022-03-20 + +### Fixed + +- Remove curl auth on cross-domain redirects to align with the Authorization HTTP header +- Reject non-HTTP schemes in StreamHandler +- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve` + + +## 7.4.1 - 2021-12-06 + +### Changed + +- Replaced implicit URI to string coercion [#2946](https://github.com/guzzle/guzzle/pull/2946) +- Allow `symfony/deprecation-contracts` version 3 [#2961](https://github.com/guzzle/guzzle/pull/2961) + +### Fixed + +- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950) + + +## 7.4.0 - 2021-10-18 + +### Added + +- Support PHP 8.1 [#2929](https://github.com/guzzle/guzzle/pull/2929), [#2939](https://github.com/guzzle/guzzle/pull/2939) +- Support `psr/log` version 2 and 3 [#2943](https://github.com/guzzle/guzzle/pull/2943) + +### Fixed + +- Make sure we always call `restore_error_handler()` [#2915](https://github.com/guzzle/guzzle/pull/2915) +- Fix progress parameter type compatibility between the cURL and stream handlers [#2936](https://github.com/guzzle/guzzle/pull/2936) +- Throw `InvalidArgumentException` when an incorrect `headers` array is provided [#2916](https://github.com/guzzle/guzzle/pull/2916), [#2942](https://github.com/guzzle/guzzle/pull/2942) + +### Changed + +- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945) + + +## 7.3.0 - 2021-03-23 + +### Added + +- Support for DER and P12 certificates [#2413](https://github.com/guzzle/guzzle/pull/2413) +- Support the cURL (http://) scheme for StreamHandler proxies [#2850](https://github.com/guzzle/guzzle/pull/2850) +- Support for `guzzlehttp/psr7:^2.0` [#2878](https://github.com/guzzle/guzzle/pull/2878) + +### Fixed + +- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872) + + +## 7.2.0 - 2020-10-10 + +### Added + +- Support for PHP 8 [#2712](https://github.com/guzzle/guzzle/pull/2712), [#2715](https://github.com/guzzle/guzzle/pull/2715), [#2789](https://github.com/guzzle/guzzle/pull/2789) +- Support passing a body summarizer to the http errors middleware [#2795](https://github.com/guzzle/guzzle/pull/2795) + +### Fixed + +- Handle exceptions during response creation [#2591](https://github.com/guzzle/guzzle/pull/2591) +- Fix CURLOPT_ENCODING not to be overwritten [#2595](https://github.com/guzzle/guzzle/pull/2595) +- Make sure the Request always has a body object [#2804](https://github.com/guzzle/guzzle/pull/2804) + +### Changed + +- The `TooManyRedirectsException` has a response [#2660](https://github.com/guzzle/guzzle/pull/2660) +- Avoid "functions" from dependencies [#2712](https://github.com/guzzle/guzzle/pull/2712) + +### Deprecated + +- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786) + + +## 7.1.1 - 2020-09-30 + +### Fixed + +- Incorrect EOF detection for response body streams on Windows. + +### Changed + +- We dont connect curl `sink` on HEAD requests. +- Removed some PHP 5 workarounds + + +## 7.1.0 - 2020-09-22 + +### Added + +- `GuzzleHttp\MessageFormatterInterface` + +### Fixed + +- Fixed issue that caused cookies with no value not to be stored. +- On redirects, we allow all safe methods like GET, HEAD and OPTIONS. +- Fixed logging on empty responses. +- Make sure MessageFormatter::format returns string + +### Deprecated + +- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead. +- `ClientInterface::getConfig()` +- `Client::getConfig()` +- `Client::__call()` +- `Utils::defaultCaBundle()` +- `CurlFactory::LOW_CURL_VERSION_NUMBER` + + +## 7.0.1 - 2020-06-27 + +* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699) + + +## 7.0.0 - 2020-06-27 + +No changes since 7.0.0-rc1. + + +## 7.0.0-rc1 - 2020-06-15 + +### Changed + +* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629) +* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675) + + +## 7.0.0-beta2 - 2020-05-25 + +### Added + +* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546) +* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583) + +### Changed + +* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531) +* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529) +* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546) +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529) +* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541) +* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654) + +### Fixed + +* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +### Removed + +* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528) + + +## 7.0.0-beta1 - 2019-12-30 + +The diff might look very big but 95% of Guzzle users will be able to upgrade without modification. +Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes. + +### Added + +* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474) +* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499) +* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424) + +### Changed + +* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427) +* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450) +* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444) +* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454) +* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462) +* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461) +* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495) + +### Fixed + +* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311) + +### Removed + +* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162) +* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425) +* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433) +* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440) +* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464) + + +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + + +## 6.5.0 - 2019-12-07 + +* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) +* Deprecated `ClientInterface::VERSION` + + +## 6.4.1 - 2019-10-23 + +* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that +* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + + +## 6.4.0 - 2019-10-23 + +* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) +* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + + +## 6.3.3 - 2018-04-22 + +* Fix: Default headers when decode_content is specified + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) +* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.2.3 - 2017-02-28 + +* Fix deprecations with guzzle/psr7 version 1.4 + + +## 6.2.2 - 2016-10-08 + +* Allow to pass nullable Response to delay callable +* Only add scheme when host is present +* Fix drain case where content-length is the literal string zero +* Obfuscate in-URL credentials in exceptions + + +## 6.2.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + a server does not honor `Connection: close`. +* Ignore URI fragment when sending requests. + + +## 6.2.0 - 2016-03-21 + +* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. + https://github.com/guzzle/guzzle/pull/1367 + + +## 6.1.1 - 2015-11-22 + +* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* Bug fix: fixed regression where MockHandler was not using `sink`. + https://github.com/guzzle/guzzle/pull/1292 + + +## 6.1.0 - 2015-09-08 + +* Feature: Added the `on_stats` request option to provide access to transfer + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. + https://github.com/guzzle/guzzle/pull/1189 + + +## 6.0.2 - 2015-07-04 + +* Fixed a memory leak in the curl handlers in which references to callbacks + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* Functions are now conditionally required using an additional level of + indirection to help with global Composer installations. + + +## 6.0.1 - 2015-05-27 + +* Fixed a bug with serializing the `query` request option where the `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$maxHandles` has been removed from CurlMultiHandler. +* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + + +## 5.3.0 - 2015-05-19 + +* Mock now supports `save_to` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See + https://datatracker.ietf.org/doc/html/rfc3986#appendix-A + + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on https://datatracker.ietf.org/doc/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 0000000..fd2375d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,27 @@ +The MIT License (MIT) + +Copyright (c) 2011 Michael Dowling +Copyright (c) 2012 Jeremy Lindblom +Copyright (c) 2014 Graham Campbell +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Tobias Schultze +Copyright (c) 2016 Tobias Nyholm +Copyright (c) 2016 George Mponos + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 0000000..cdaebee --- /dev/null +++ b/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,94 @@ +![Guzzle](.github/logo.png?raw=true) + +# Guzzle, PHP HTTP client + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/github/actions/workflow/status/guzzle/guzzle/ci.yml?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); // 200 +echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' +echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' + +// Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +We use GitHub issues only to discuss bugs and new features. For support please refer to: + +- [Documentation](https://docs.guzzlephp.org) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle) +- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](https://getcomposer.org/). + +```bash +composer require guzzlehttp/guzzle +``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------| +| 3.x | EOL (2016-10-31) | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 | +| 4.x | EOL (2016-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | +| 5.x | EOL (2019-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | +| 6.x | EOL (2023-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.5 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 +[guzzle-7-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: https://guzzle3.readthedocs.io/ +[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/ +[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/ +[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/ + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 0000000..4efbb59 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1253 @@ +Guzzle Upgrade Guide +==================== + +6.0 to 7.0 +---------- + +In order to take advantage of the new features of PHP, Guzzle dropped the support +of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return +types for functions and methods have been added wherever possible. + +Please make sure: +- You are calling a function or a method with the correct type. +- If you extend a class of Guzzle; update all signatures on methods you override. + +#### Other backwards compatibility breaking changes + +- Class `GuzzleHttp\UriTemplate` is removed. +- Class `GuzzleHttp\Exception\SeekException` is removed. +- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, + `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty + Response as argument. +- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException` + instead of `GuzzleHttp\Exception\RequestException`. +- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed. +- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed. +- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead. +- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. + Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. +- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. +- Request option `exceptions` is removed. Please use `http_errors`. +- Request option `save_to` is removed. Please use `sink`. +- Pool option `pool_size` is removed. Please use `concurrency`. +- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. +- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation. +- The `log` middleware will log the errors with level `error` instead of `notice` +- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher). + +#### Native functions calls + +All internal native functions calls of Guzzle are now prefixed with a slash. This +change makes it impossible for method overloading by other libraries or applications. +Example: + +```php +// Before: +curl_version(); + +// After: +\curl_version(); +``` + +For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master). + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](https://docs.guzzlephp.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](https://docs.guzzlephp.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](https://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: https://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- https://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- https://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 0000000..0db75a9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,131 @@ +{ + "name": "guzzlehttp/guzzle", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client", + "PSR-7", + "PSR-18" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "repositories": [ + { + "type": "package", + "package": { + "name": "guzzle/client-integration-tests", + "version": "v3.0.2", + "dist": { + "url": "https://codeload.github.com/guzzle/client-integration-tests/zip/2c025848417c1135031fdf9c728ee53d0a7ceaee", + "type": "zip" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.11", + "php-http/message": "^1.0 || ^2.0", + "guzzlehttp/psr7": "^1.7 || ^2.0", + "th3n3rd/cartesian-product": "^0.3" + }, + "autoload": { + "psr-4": { + "Http\\Client\\Tests\\": "src/" + } + }, + "bin": [ + "bin/http_test_server" + ] + } + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "bamarni/composer-bin-plugin": "^1.8.2", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/package-lock.json b/vendor/guzzlehttp/guzzle/package-lock.json new file mode 100644 index 0000000..0e14dc1 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "guzzle", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php new file mode 100644 index 0000000..761506d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php @@ -0,0 +1,28 @@ +truncateAt = $truncateAt; + } + + /** + * Returns a summarized message body. + */ + public function summarize(MessageInterface $message): ?string + { + return $this->truncateAt === null + ? Psr7\Message::bodySummary($message) + : Psr7\Message::bodySummary($message, $this->truncateAt); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php new file mode 100644 index 0000000..3e02e03 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php @@ -0,0 +1,13 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!\is_callable($config['handler'])) { + throw new InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return PromiseInterface|ResponseInterface + * + * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0. + */ + public function __call($method, $args) + { + if (\count($args) < 1) { + throw new InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = $args[1] ?? []; + + return \substr($method, -5) === 'Async' + ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + */ + public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + + return $this->sendAsync($request, $options)->wait(); + } + + /** + * The HttpClient PSR (PSR-18) specify this method. + * + * {@inheritDoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + $options[RequestOptions::ALLOW_REDIRECTS] = false; + $options[RequestOptions::HTTP_ERRORS] = false; + + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + */ + public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = $options['headers'] ?? []; + $body = $options['body'] ?? null; + $version = $options['version'] ?? '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options); + if (\is_array($body)) { + throw $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function request(string $method, $uri = '', array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + * + * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. + */ + public function getConfig(?string $option = null) + { + return $option === null + ? $this->config + : ($this->config[$option] ?? null); + } + + private function buildUri(UriInterface $uri, array $config): UriInterface + { + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + */ + private function configureDefaults(array $config): void + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => false, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) { + $defaults['proxy']['http'] = $proxy; + } + + if ($proxy = Utils::getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = Utils::getenv('NO_PROXY')) { + $cleanedNoProxy = \str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (\array_keys($this->config['headers']) as $name) { + if (\strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = Utils::defaultUserAgent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + */ + private function prepareDefaults(array $options): array + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (\array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!\is_array($options['headers'])) { + throw new InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + */ + private function transfer(RequestInterface $request, array $options): PromiseInterface + { + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return P\Create::promiseFor($handler($request, $options)); + } catch (\Exception $e) { + return P\Create::rejectionFor($e); + } + } + + /** + * Applies the array of request options to a request. + */ + private function applyOptions(RequestInterface $request, array &$options): RequestInterface + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) { + throw new InvalidArgumentException('The headers array must have header name as keys.'); + } + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new InvalidArgumentException('You cannot use ' + .'form_params and multipart at the same time. Use the ' + .'form_params option if you want to send application/' + .'x-www-form-urlencoded requests, and the multipart ' + .'option to send multipart/form-data requests.'); + } + $options['body'] = \http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = Utils::jsonEncode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (\is_array($options['body'])) { + throw $this->invalidBody(); + } + $modify['body'] = Psr7\Utils::streamFor($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && \is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? \strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + .\base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (\is_array($value)) { + $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986); + } + if (!\is_string($value)) { + throw new InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (\is_bool($options['sink'])) { + throw new InvalidArgumentException('sink must not be a boolean'); + } + } + + if (isset($options['version'])) { + $modify['version'] = $options['version']; + } + + $request = Psr7\Utils::modifyRequest($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + .$request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\Utils::modifyRequest($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Return an InvalidArgumentException with pre-set message. + */ + private function invalidBody(): InvalidArgumentException + { + return new InvalidArgumentException('Passing in the "body" request ' + .'option as an array to send a request is not supported. ' + .'Please use the "form_params" request option to send a ' + .'application/x-www-form-urlencoded request, or the "multipart" ' + .'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 0000000..6aaee61 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,84 @@ +request('GET', $uri, $options); + } + + /** + * Create and send an HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function head($uri, array $options = []): ResponseInterface + { + return $this->request('HEAD', $uri, $options); + } + + /** + * Create and send an HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function put($uri, array $options = []): ResponseInterface + { + return $this->request('PUT', $uri, $options); + } + + /** + * Create and send an HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function post($uri, array $options = []): ResponseInterface + { + return $this->request('POST', $uri, $options); + } + + /** + * Create and send an HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function patch($uri, array $options = []): ResponseInterface + { + return $this->request('PATCH', $uri, $options); + } + + /** + * Create and send an HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function delete($uri, array $options = []): ResponseInterface + { + return $this->request('DELETE', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface; + + /** + * Create and send an asynchronous HTTP GET request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function getAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('GET', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function headAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('HEAD', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function putAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PUT', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function postAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('POST', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function patchAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PATCH', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function deleteAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('DELETE', $uri, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php new file mode 100644 index 0000000..b616cf2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -0,0 +1,307 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + */ + public static function fromArray(array $cookies, string $domain): self + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true, + ])); + } + + return $cookieJar; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + */ + public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool + { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName(string $name): ?SetCookie + { + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + public function toArray(): array + { + return \array_map(static function (SetCookie $cookie): array { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void + { + if (!$domain) { + $this->cookies = []; + + return; + } elseif (!$path) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($domain): bool { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain): bool { + return !($cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name + && $cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies(): void + { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie): bool { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie): bool + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: '.$result); + } + $this->removeCookieIfEmpty($cookie); + + return false; + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() + || $c->getDomain() != $cookie->getDomain() + || $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count(): int + { + return \count($this->cookies); + } + + /** + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator(\array_values($this->cookies)); + } + + public function extractCookies(RequestInterface $request, ResponseInterface $response): void + { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== \strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + if (!$sc->matchesDomain($request->getUri()->getHost())) { + continue; + } + // Note: At this point `$sc->getDomain()` being a public suffix should + // be rejected, but we don't want to pull in the full PSL dependency. + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @see https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.4 + */ + private function getCookiePathFromRequest(RequestInterface $request): string + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== \strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + $lastSlashPos = \strrpos($uriPath, '/'); + if (0 === $lastSlashPos || false === $lastSlashPos) { + return '/'; + } + + return \substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request): RequestInterface + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) + && $cookie->matchesDomain($host) + && !$cookie->isExpired() + && (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName().'=' + .$cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', \implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + */ + private function removeCookieIfEmpty(SetCookie $cookie): void + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 0000000..93ada58 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,80 @@ + + */ +interface CookieJarInterface extends \Countable, \IteratorAggregate +{ + /** + * Create a request with added cookie headers. + * + * If no matching cookies are found in the cookie jar, then no Cookie + * header is added to the request and the same request is returned. + * + * @param RequestInterface $request Request object to modify. + * + * @return RequestInterface returns the modified request. + */ + public function withCookieHeader(RequestInterface $request): RequestInterface; + + /** + * Extract cookies from an HTTP response and store them in the CookieJar. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + */ + public function extractCookies(RequestInterface $request, ResponseInterface $response): void; + + /** + * Sets a cookie in the cookie jar. + * + * @param SetCookie $cookie Cookie to set. + * + * @return bool Returns true on success or false on failure + */ + public function setCookie(SetCookie $cookie): bool; + + /** + * Remove cookies currently held in the cookie jar. + * + * Invoking this method without arguments will empty the whole cookie jar. + * If given a $domain argument only cookies belonging to that domain will + * be removed. If given a $domain and $path argument, cookies belonging to + * the specified path within that domain are removed. If given all three + * arguments, then the cookie with the specified name, path and domain is + * removed. + * + * @param string|null $domain Clears cookies matching a domain + * @param string|null $path Clears cookies matching a domain and path + * @param string|null $name Clears cookies matching a domain, path, and name + */ + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; + + /** + * Discard all sessions cookies. + * + * Removes cookies that don't have an expire field or a have a discard + * field set to true. To be called when the user agent shuts down according + * to RFC 2965. + */ + public function clearSessionCookies(): void; + + /** + * Converts the cookie jar to an array. + */ + public function toArray(): array; +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php new file mode 100644 index 0000000..290236d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php @@ -0,0 +1,101 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (\file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * + * @throws \RuntimeException if the file cannot be found or created + */ + public function save(string $filename): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = Utils::jsonEncode($json); + if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load(string $filename): void + { + $json = \file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } + if ($json === '') { + return; + } + + $data = Utils::jsonDecode($json, true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\is_scalar($data) && !empty($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 0000000..cb3e67c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,77 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save(): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = \json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load(): void + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = \json_decode($_SESSION[$this->sessionKey], true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\strlen($data)) { + throw new \RuntimeException('Invalid cookie data'); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 0000000..47c4d10 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,492 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false, + ]; + + /** + * @var array Cookie data + */ + private $data; + + /** + * Create a new SetCookie object from a string. + * + * @param string $cookie Set-Cookie header string + */ + public static function fromString(string $cookie): self + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = \array_filter(\array_map('trim', \explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = \explode('=', $part, 2); + $key = \trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? \trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (!isset($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (\array_keys(self::$defaults) as $search) { + if (!\strcasecmp($search, $key)) { + if ($search === 'Max-Age') { + if (is_numeric($value)) { + $data[$search] = (int) $value; + } + } elseif ($search === 'Secure' || $search === 'Discard' || $search === 'HttpOnly') { + if ($value) { + $data[$search] = true; + } + } else { + $data[$search] = $value; + } + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = self::$defaults; + + if (isset($data['Name'])) { + $this->setName($data['Name']); + } + + if (isset($data['Value'])) { + $this->setValue($data['Value']); + } + + if (isset($data['Domain'])) { + $this->setDomain($data['Domain']); + } + + if (isset($data['Path'])) { + $this->setPath($data['Path']); + } + + if (isset($data['Max-Age'])) { + $this->setMaxAge($data['Max-Age']); + } + + if (isset($data['Expires'])) { + $this->setExpires($data['Expires']); + } + + if (isset($data['Secure'])) { + $this->setSecure($data['Secure']); + } + + if (isset($data['Discard'])) { + $this->setDiscard($data['Discard']); + } + + if (isset($data['HttpOnly'])) { + $this->setHttpOnly($data['HttpOnly']); + } + + // Set the remaining values that don't have extra validation logic + foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) { + $this->data[$key] = $data[$key]; + } + + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(\time() + $this->getMaxAge()); + } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) { + $this->setExpires($expires); + } + } + + public function __toString() + { + $str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}").'; '; + } + } + } + + return \rtrim($str, '; '); + } + + public function toArray(): array + { + return $this->data; + } + + /** + * Get the cookie name. + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name. + * + * @param string $name Cookie name + */ + public function setName($name): void + { + if (!is_string($name)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Name'] = (string) $name; + } + + /** + * Get the cookie value. + * + * @return string|null + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value. + * + * @param string $value Cookie value + */ + public function setValue($value): void + { + if (!is_string($value)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Value'] = (string) $value; + } + + /** + * Get the domain. + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie. + * + * @param string|null $domain + */ + public function setDomain($domain): void + { + if (!is_string($domain) && null !== $domain) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Domain'] = null === $domain ? null : (string) $domain; + } + + /** + * Get the path. + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie. + * + * @param string $path Path of the cookie + */ + public function setPath($path): void + { + if (!is_string($path)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Path'] = (string) $path; + } + + /** + * Maximum lifetime of the cookie in seconds. + * + * @return int|null + */ + public function getMaxAge() + { + return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie. + * + * @param int|null $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge): void + { + if (!is_int($maxAge) && null !== $maxAge) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires. + * + * @return string|int|null + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire. + * + * @param int|string|null $timestamp Unix timestamp or any English textual datetime description. + */ + public function setExpires($timestamp): void + { + if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp)); + } + + /** + * Get whether or not this is a secure cookie. + * + * @return bool + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure. + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure): void + { + if (!is_bool($secure)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Secure'] = (bool) $secure; + } + + /** + * Get whether or not this is a session cookie. + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie. + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard): void + { + if (!is_bool($discard)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Discard'] = (bool) $discard; + } + + /** + * Get whether or not this is an HTTP only cookie. + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie. + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly): void + { + if (!is_bool($httpOnly)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['HttpOnly'] = (bool) $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + */ + public function matchesPath(string $requestPath): bool + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== \strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (\substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return \substr($requestPath, \strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value. + * + * @param string $domain Domain to check against + */ + public function matchesDomain(string $domain): bool + { + $cookieDomain = $this->getDomain(); + if (null === $cookieDomain) { + return true; + } + + // Remove the leading '.' as per spec in RFC 6265. + // https://datatracker.ietf.org/doc/html/rfc6265#section-5.2.3 + $cookieDomain = \ltrim(\strtolower($cookieDomain), '.'); + + $domain = \strtolower($domain); + + // Domain not set or exact match. + if ('' === $cookieDomain || $domain === $cookieDomain) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.3 + if (\filter_var($domain, \FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain); + } + + /** + * Check if the cookie is expired. + */ + public function isExpired(): bool + { + return $this->getExpires() !== null && \time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265. + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + $name = $this->getName(); + if ($name === '') { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (\preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + .'Control characters (0-31;127), space, tab and the ' + .'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be null. 0 and empty string are valid. Empty strings + // are technically against RFC 6265, but known to happen in the wild. + $value = $this->getValue(); + if ($value === null) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0. "0" is not a valid internet + // domain, but may be used as server name in a private network. + $domain = $this->getDomain(); + if ($domain === null || $domain === '') { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 0000000..ba67ad4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,39 @@ +request = $request; + $this->handlerContext = $handlerContext; + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php new file mode 100644 index 0000000..fa3ed69 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php @@ -0,0 +1,9 @@ +getStatusCode() : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + */ + public static function wrapException(RequestInterface $request, \Throwable $e): RequestException + { + return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request sent + * @param ResponseInterface $response Response received + * @param \Throwable|null $previous Previous exception + * @param array $handlerContext Optional handler context + * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer + */ + public static function create( + RequestInterface $request, + ?ResponseInterface $response = null, + ?\Throwable $previous = null, + array $handlerContext = [], + ?BodySummarizerInterface $bodySummarizer = null + ): self { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $handlerContext + ); + } + + $level = (int) \floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = \GuzzleHttp\Psr7\Utils::redactUserInfo($request->getUri()); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = \sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri->__toString(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $handlerContext); + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get the associated response + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Check if a response was received + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 0000000..8055e06 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,10 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options): EasyHandle + { + $protocolVersion = $request->getProtocolVersion(); + + if ('2' === $protocolVersion || '2.0' === $protocolVersion) { + if (!self::supportsHttp2()) { + throw new ConnectException('HTTP/2 is supported by the cURL handler, however libcurl is built without HTTP/2 support.', $request); + } + } elseif ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) { + throw new ConnectException(sprintf('HTTP/%s is not supported by the cURL handler.', $protocolVersion), $request); + } + + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle(); + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = \array_replace($conf, $options['curl']); + } + + $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + private static function supportsHttp2(): bool + { + static $supportsHttp2 = null; + + if (null === $supportsHttp2) { + $supportsHttp2 = self::supportsTls12() + && defined('CURL_VERSION_HTTP2') + && (\CURL_VERSION_HTTP2 & \curl_version()['features']); + } + + return $supportsHttp2; + } + + private static function supportsTls12(): bool + { + static $supportsTls12 = null; + + if (null === $supportsTls12) { + $supportsTls12 = \CURL_SSLVERSION_TLSv1_2 & \curl_version()['features']; + } + + return $supportsTls12; + } + + private static function supportsTls13(): bool + { + static $supportsTls13 = null; + + if (null === $supportsTls13) { + $supportsTls13 = defined('CURL_SSLVERSION_TLSv1_3') + && (\CURL_SSLVERSION_TLSv1_3 & \curl_version()['features']); + } + + return $supportsTls13; + } + + public function release(EasyHandle $easy): void + { + $resource = $easy->handle; + unset($easy->handle); + + if (\count($this->handles) >= $this->maxHandles) { + if (PHP_VERSION_ID < 80000) { + \curl_close($resource); + } + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null); + \curl_setopt($resource, \CURLOPT_READFUNCTION, null); + \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null); + \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null); + \curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + * @param CurlFactoryInterface $factory Dictates how the handle is released + */ + public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy): void + { + $curlStats = \curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + ($easy->options['on_stats'])($stats); + } + + /** + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => \curl_error($easy->handle), + 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME), + ] + \curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = self::getCurlVersion(); + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function getCurlVersion(): string + { + static $curlVersion = null; + + if (null === $curlVersion) { + $curlVersion = \curl_version()['version']; + } + + return $curlVersion; + } + + private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface + { + static $connectionErrors = [ + \CURLE_OPERATION_TIMEOUTED => true, + \CURLE_COULDNT_RESOLVE_HOST => true, + \CURLE_COULDNT_CONNECT => true, + \CURLE_SSL_CONNECT_ERROR => true, + \CURLE_GOT_NOTHING => true, + ]; + + if ($easy->createResponseException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered while creating the response', + $easy->request, + $easy->response, + $easy->createResponseException, + $ctx + ) + ); + } + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + + $uri = $easy->request->getUri(); + + $sanitizedError = self::sanitizeCurlError($ctx['error'] ?? '', $uri); + + $message = \sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $sanitizedError, + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + + if ('' !== $sanitizedError) { + $redactedUriString = \GuzzleHttp\Psr7\Utils::redactUserInfo($uri)->__toString(); + if ($redactedUriString !== '' && false === \strpos($sanitizedError, $redactedUriString)) { + $message .= \sprintf(' for %s', $redactedUriString); + } + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return P\Create::rejectionFor($error); + } + + private static function sanitizeCurlError(string $error, UriInterface $uri): string + { + if ('' === $error) { + return $error; + } + + $baseUri = $uri->withQuery('')->withFragment(''); + $baseUriString = $baseUri->__toString(); + + if ('' === $baseUriString) { + return $error; + } + + $redactedUriString = \GuzzleHttp\Psr7\Utils::redactUserInfo($baseUri)->__toString(); + + return str_replace($baseUriString, $redactedUriString, $error); + } + + /** + * @return array + */ + private function getDefaultConf(EasyHandle $easy): array + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + \CURLOPT_RETURNTRANSFER => false, + \CURLOPT_HEADER => false, + \CURLOPT_CONNECTTIMEOUT => 300, + ]; + + if (\defined('CURLOPT_PROTOCOLS')) { + $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + + if ('2' === $version || '2.0' === $version) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0; + } elseif ('1.1' === $version) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; + } else { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf): void + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[\CURLOPT_NOBODY] = true; + unset( + $conf[\CURLOPT_WRITEFUNCTION], + $conf[\CURLOPT_READFUNCTION], + $conf[\CURLOPT_FILE], + $conf[\CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf): void + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) { + $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[\CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[\CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf): void + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[\CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[\CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader(string $name, array &$options): void + { + foreach (\array_keys($options['_headers']) as $key) { + if (!\strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf): void + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[\CURLOPT_CAINFO]); + $conf[\CURLOPT_SSL_VERIFYHOST] = 0; + $conf[\CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[\CURLOPT_SSL_VERIFYHOST] = 2; + $conf[\CURLOPT_SSL_VERIFYPEER] = true; + if (\is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!\file_exists($options['verify'])) { + throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}"); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if ( + \is_dir($options['verify']) + || ( + \is_link($options['verify']) === true + && ($verifyLink = \readlink($options['verify'])) !== false + && \is_dir($verifyLink) + ) + ) { + $conf[\CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[\CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[\CURLOPT_ENCODING] = $accept; + } else { + // The empty string enables all available decoders and implicitly + // sets a matching 'Accept-Encoding' header. + $conf[\CURLOPT_ENCODING] = ''; + // But as the user did not specify any encoding preference, + // let's leave it up to server by preventing curl from sending + // the header, which will be interpreted as 'Accept-Encoding: *'. + // https://www.rfc-editor.org/rfc/rfc9110#field.accept-encoding + $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (!isset($options['sink'])) { + // Use a default temp stream if no sink was set. + $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+'); + } + $sink = $options['sink']; + if (!\is_string($sink)) { + $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink); + } elseif (!\is_dir(\dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink)); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int { + return $sink->write($write); + }; + + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') { + $conf[\CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!\is_array($options['proxy'])) { + $conf[\CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) { + unset($conf[\CURLOPT_PROXY]); + } else { + $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['crypto_method'])) { + $protocolVersion = $easy->request->getProtocolVersion(); + + // If HTTP/2, upgrade TLS 1.0 and 1.1 to 1.2 + if ('2' === $protocolVersion || '2.0' === $protocolVersion) { + if ( + \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method'] + || \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method'] + || \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method'] + ) { + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { + if (!self::supportsTls13()) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; + } else { + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) { + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) { + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) { + if (!self::supportsTls12()) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { + if (!self::supportsTls13()) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; + } else { + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (\is_array($cert)) { + $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!\file_exists($cert)) { + throw new \InvalidArgumentException("SSL certificate not found: {$cert}"); + } + // OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. + // see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html + $ext = pathinfo($cert, \PATHINFO_EXTENSION); + if (preg_match('#^(der|p12)$#i', $ext)) { + $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext); + } + $conf[\CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (\is_array($options['ssl_key'])) { + if (\count($options['ssl_key']) === 2) { + [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key']; + } else { + [$sslKey] = $options['ssl_key']; + } + } + + $sslKey = $sslKey ?? $options['ssl_key']; + + if (!\file_exists($sslKey)) { + throw new \InvalidArgumentException("SSL private key not found: {$sslKey}"); + } + $conf[\CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!\is_callable($progress)) { + throw new \InvalidArgumentException('progress client option must be callable'); + } + $conf[\CURLOPT_NOPROGRESS] = false; + $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) { + $progress($downloadSize, $downloaded, $uploadSize, $uploaded); + }; + } + + if (!empty($options['debug'])) { + $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']); + $conf[\CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface + { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + .'providing an error. The request would have been retried, ' + .'but attempting to rewind the request body failed. ' + .'Exception: '.$e; + + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + .'and did not succeed. The most likely reason for the failure ' + .'is that cURL was unable to rewind the body of the request ' + .'and subsequent retries resulted in the same error. Turn on ' + .'the debug option to see what went wrong. See ' + .'https://bugs.php.net/bug.php?id=47204 for more information.'; + + return self::createRejection($easy, $ctx); + } else { + ++$easy->options['_curl_retries']; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy): callable + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!\is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return static function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = \trim($h); + if ($value === '') { + $startingResponse = true; + try { + $easy->createResponse(); + } catch (\Exception $e) { + $easy->createResponseException = $e; + + return -1; + } + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + + return \strlen($h); + }; + } + + public function __destruct() + { + foreach ($this->handles as $id => $handle) { + if (PHP_VERSION_ID < 80000) { + \curl_close($handle); + } + + unset($this->handles[$id]); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 0000000..fe57ed5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,25 @@ +factory = $options['handle_factory'] + ?? new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (isset($options['delay'])) { + \usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + \curl_exec($easy->handle); + $easy->errno = \curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 0000000..21abbed --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,287 @@ + An array of delay times, indexed by handle id in `addRequest`. + * + * @see CurlMultiHandler::addRequest + */ + private $delays = []; + + /** + * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt() + */ + private $options = []; + + /** @var resource|\CurlMultiHandle */ + private $_mh; + + /** + * This handler accepts the following options: + * + * - handle_factory: An optional factory used to create curl handles + * - select_timeout: Optional timeout (in seconds) to block before timing + * out while selecting curl handles. Defaults to 1 second. + * - options: An associative array of CURLMOPT_* options and + * corresponding values for curl_multi_setopt() + */ + public function __construct(array $options = []) + { + $this->factory = $options['handle_factory'] ?? new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED); + $this->selectTimeout = (int) $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = $options['options'] ?? []; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->_mh); + } + + /** + * @param string $name + * + * @return resource|\CurlMultiHandle + * + * @throws \BadMethodCallException when another field as `_mh` will be gotten + * @throws \RuntimeException when curl can not initialize a multi handle + */ + public function __get($name) + { + if ($name !== '_mh') { + throw new \BadMethodCallException("Can not get other property as '_mh'."); + } + + $multiHandle = \curl_multi_init(); + + if (false === $multiHandle) { + throw new \RuntimeException('Can not initialize curl multi handle.'); + } + + $this->_mh = $multiHandle; + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + return $this->_mh; + } + + public function __destruct() + { + if (isset($this->_mh)) { + \curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick(): void + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + \curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Run curl_multi_exec in the queue to enable other async tasks to run + P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue'])); + + // Step through the task queue which may add additional requests. + P\Utils::queue()->run(); + + if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + \usleep(250); + } + + while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + // Prevent busy looping for slow HTTP requests. + \curl_multi_select($this->_mh, $this->selectTimeout); + } + + $this->processMessages(); + } + + /** + * Runs \curl_multi_exec() inside the event loop, to prevent busy looping + */ + private function tickInQueue(): void + { + if (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + \curl_multi_select($this->_mh, 0); + P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue'])); + } + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute(): void + { + $queue = P\Utils::queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + \usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry): void + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + \curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id): bool + { + if (!is_int($id)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + \curl_multi_remove_handle($this->_mh, $handle); + + if (PHP_VERSION_ID < 80000) { + \curl_close($handle); + } + + return true; + } + + private function processMessages(): void + { + while ($done = \curl_multi_info_read($this->_mh)) { + if ($done['msg'] !== \CURLMSG_DONE) { + // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216 + continue; + } + $id = (int) $done['handle']; + \curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish($this, $entry['easy'], $this->factory) + ); + } + } + + private function timeToNext(): int + { + $currentTime = Utils::currentTime(); + $nextTime = \PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return ((int) \max(0, $nextTime - $currentTime)) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 0000000..1bc39f4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,112 @@ +headers); + + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + + if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) { + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $status, + $headers, + $this->sink, + $ver, + $reason + ); + } + + /** + * @param string $name + * + * @return void + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php new file mode 100644 index 0000000..5554b8f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php @@ -0,0 +1,42 @@ +|null $queue The parameters to be passed to the append function, as an indexed array. + * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. + * @param callable|null $onRejected Callback to invoke when the return value is rejected. + */ + public function __construct(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null) + { + $this->onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + // array_values included for BC + $this->append(...array_values($queue)); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && \is_numeric($options['delay'])) { + \usleep((int) $options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = \array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (\is_callable($response)) { + $response = $response($request, $options); + } + + $response = $response instanceof \Throwable + ? P\Create::rejectionFor($response) + : P\Create::promiseFor($response); + + return $response->then( + function (?ResponseInterface $value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + ($this->onFulfilled)($value); + } + + if ($value !== null && isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (\is_resource($sink)) { + \fwrite($sink, $contents); + } elseif (\is_string($sink)) { + \file_put_contents($sink, $contents); + } elseif ($sink instanceof StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + ($this->onRejected)($reason); + } + + return P\Create::rejectionFor($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + * + * @param mixed ...$values + */ + public function append(...$values): void + { + foreach ($values as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Throwable + || $value instanceof PromiseInterface + || \is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value)); + } + } + } + + /** + * Get the last received request. + */ + public function getLastRequest(): ?RequestInterface + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + */ + public function getLastOptions(): array + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + */ + public function count(): int + { + return \count($this->queue); + } + + public function reset(): void + { + $this->queue = []; + } + + /** + * @param mixed $reason Promise or reason. + */ + private function invokeStats( + RequestInterface $request, + array $options, + ?ResponseInterface $response = null, + $reason = null + ): void { + if (isset($options['on_stats'])) { + $transferTime = $options['transfer_time'] ?? 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + ($options['on_stats'])($stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 0000000..9df70cf --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,51 @@ +getProtocolVersion(); + + if ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) { + throw new ConnectException(sprintf('HTTP/%s is not supported by the stream handler.', $protocolVersion), $request); + } + + $startTime = isset($options['on_stats']) ? Utils::currentTime() : null; + + try { + // Does not support the expect header. + $request = $request->withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // the behavior of `CurlHandler` + if ( + ( + 0 === \strcasecmp('PUT', $request->getMethod()) + || 0 === \strcasecmp('POST', $request->getMethod()) + ) + && 0 === $request->getBody()->getSize() + ) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed + || false !== \strpos($message, 'Connection refused') + || false !== \strpos($message, "couldn't connect to host") // error on HHVM + || false !== \strpos($message, 'connection attempt failed') + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } else { + $e = RequestException::wrapException($request, $e); + } + $this->invokeStats($options, $request, $startTime, null, $e); + + return P\Create::rejectionFor($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + ?float $startTime, + ?ResponseInterface $response = null, + ?\Throwable $error = null + ): void { + if (isset($options['on_stats'])) { + $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []); + ($options['on_stats'])($stats); + } + } + + /** + * @param resource $stream + */ + private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface + { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + + try { + [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + [$stream, $headers] = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\Utils::streamFor($stream); + $sink = $stream; + + if (\strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + try { + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered during the on_headers event', $request, $response, $e) + ); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain($stream, $sink, $response->getHeaderLine('Content-Length')); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options): StreamInterface + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+'); + + return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink); + } + + /** + * @param resource $stream + */ + private function checkDecode(array $options, array $headers, $stream): array + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream)); + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface + { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\Utils::copyToStream( + $source, + $sink, + (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = []; + \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line, + ]; + + return true; + }); + + try { + $resource = $callback(); + } finally { + \restore_error_handler(); + } + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value".\PHP_EOL; + } + } + throw new \RuntimeException(\trim($message)); + } + + return $resource; + } + + /** + * @return resource + */ + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = \array_flip(\get_class_methods(__CLASS__)); + } + + if (!\in_array($request->getUri()->getScheme(), ['http', 'https'])) { + throw new RequestException(\sprintf("The scheme '%s' is not supported.", $request->getUri()->getScheme()), $request); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() === '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!\is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = \array_replace_recursive($context, $options['stream_context']); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $contextResource = $this->createResource( + static function () use ($context, $params) { + return \stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, $contextResource, $context, $options, $request) { + $resource = @\fopen((string) $uri, 'r', false, $contextResource); + + // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable + if (function_exists('http_get_last_response_headers')) { + /** @var array|null */ + $http_response_header = \http_get_last_response_headers(); + } + + $this->lastHeaders = $http_response_header ?? []; + + if (false === $resource) { + throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context); + } + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + \stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options): UriInterface + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_A); + if (false === $records || !isset($records[0]['ip'])) { + throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request); + } + + return $uri->withHost($records[0]['ip']); + } + if ('v6' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_AAAA); + if (false === $records || !isset($records[0]['ipv6'])) { + throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request); + } + + return $uri->withHost('['.$records[0]['ipv6'].']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request): array + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + 'ssl' => [ + 'peer_name' => $request->getUri()->getHost(), + ], + ]; + + $body = (string) $request->getBody(); + + if ('' !== $body) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = \rtrim($context['http']['header']); + + return $context; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void + { + $uri = null; + + if (!\is_array($value)) { + $uri = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) { + $uri = $value[$scheme]; + } + } + } + + if (!$uri) { + return; + } + + $parsed = $this->parse_proxy($uri); + $options['http']['proxy'] = $parsed['proxy']; + + if ($parsed['auth']) { + if (!isset($options['http']['header'])) { + $options['http']['header'] = []; + } + $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}"; + } + } + + /** + * Parses the given proxy URL to make it compatible with the format PHP's stream context expects. + */ + private function parse_proxy(string $url): array + { + $parsed = \parse_url($url); + + if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') { + if (isset($parsed['host']) && isset($parsed['port'])) { + $auth = null; + if (isset($parsed['user']) && isset($parsed['pass'])) { + $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}"); + } + + return [ + 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}", + 'auth' => $auth ? "Basic {$auth}" : null, + ]; + } + } + + // Return proxy as-is. + return [ + 'proxy' => $url, + 'auth' => null, + ]; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void + { + if ( + $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT) + ) { + $options['http']['crypto_method'] = $value; + + return; + } + + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + + return; + } + + if (\is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!\file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value !== true) { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void + { + if (\is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!\file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void + { + self::addNotification( + $params, + static function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == \STREAM_NOTIFY_PROGRESS) { + // The upload progress cannot be determined. Use 0 for cURL compatibility: + // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html + $value($total, $transferred, 0, 0); + } + } + ); + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + return; + } + + static $map = [ + \STREAM_NOTIFY_CONNECT => 'CONNECT', + \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + \STREAM_NOTIFY_PROGRESS => 'PROGRESS', + \STREAM_NOTIFY_FAILURE => 'FAILURE', + \STREAM_NOTIFY_COMPLETED => 'COMPLETED', + \STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max']; + + $value = Utils::debugResource($value); + $ident = $request->getMethod().' '.$request->getUri()->withFragment(''); + self::addNotification( + $params, + static function (int $code, ...$passed) use ($ident, $value, $map, $args): void { + \fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (\array_filter($passed) as $i => $v) { + \fwrite($value, $args[$i].': "'.$v.'" '); + } + \fwrite($value, "\n"); + } + ); + } + + private static function addNotification(array &$params, callable $notify): void + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = self::callArray([ + $params['notification'], + $notify, + ]); + } + } + + private static function callArray(array $functions): callable + { + return static function (...$args) use ($functions) { + foreach ($functions as $fn) { + $fn(...$args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 0000000..03f9a18 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,275 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. + */ + public function __construct(?callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + + if ($this->handler !== null) { + $stack[] = '0) Handler: '.$this->debugCallable($this->handler); + } + + $result = ''; + foreach (\array_reverse($this->stack) as $tuple) { + ++$depth; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= 'Function: '.$this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (\array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler): void + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + */ + public function hasHandler(): bool + { + return $this->handler !== null; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, ?string $name = null): void + { + \array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, string $name = ''): void + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove): void + { + if (!is_string($remove) && !is_callable($remove)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->cached = null; + $idx = \is_callable($remove) ? 0 : 1; + $this->stack = \array_values(\array_filter( + $this->stack, + static function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable(RequestInterface, array): PromiseInterface + */ + public function resolve(): callable + { + if ($this->cached === null) { + if (($prev = $this->handler) === null) { + throw new \LogicException('No handler has been specified'); + } + + foreach (\array_reverse($this->stack) as $fn) { + /** @var callable(RequestInterface, array): PromiseInterface $prev */ + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + private function findByName(string $name): int + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + */ + private function splice(string $findName, string $withName, callable $middleware, bool $before): void + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + \array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === \count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param callable|string $fn Function to write as a string. + */ + private function debugCallable($fn): string + { + if (\is_string($fn)) { + return "callable({$fn})"; + } + + if (\is_array($fn)) { + return \is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['".\get_class($fn[0])."', '{$fn[1]}'])"; + } + + /** @var object $fn */ + return 'callable('.\spl_object_hash($fn).')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 0000000..9b77eee --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,199 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** + * @var string Template used to format log messages + */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct(?string $template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface|null $response Response that was received + * @param \Throwable|null $error Exception that was received + */ + public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string + { + $cache = []; + + /** @var string */ + return \preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\Message::toString($request); + break; + case 'response': + $result = $response ? Psr7\Message::toString($response) : ''; + break; + case 'req_headers': + $result = \trim($request->getMethod() + .' '.$request->getRequestTarget()) + .' HTTP/'.$request->getProtocolVersion()."\r\n" + .$this->headers($request); + break; + case 'res_headers': + $result = $response ? + \sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + )."\r\n".$this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody()->__toString(); + break; + case 'res_body': + if (!$response instanceof ResponseInterface) { + $result = 'NULL'; + break; + } + + $body = $response->getBody(); + + if (!$body->isSeekable()) { + $result = 'RESPONSE_NOT_LOGGEABLE'; + break; + } + + $result = $response->getBody()->__toString(); + break; + case 'ts': + case 'date_iso_8601': + $result = \gmdate('c'); + break; + case 'date_common_log': + $result = \date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri()->__toString(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = \gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (\strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(\substr($matches[1], 11)); + } elseif (\strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(\substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + */ + private function headers(MessageInterface $message): string + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name.': '.\implode(', ', $values)."\r\n"; + } + + return \trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php new file mode 100644 index 0000000..a39ac24 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -0,0 +1,18 @@ +withCookieHeader($request); + + return $handler($request, $options) + ->then( + static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface { + $cookieJar->extractCookies($request, $response); + + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_errors" request option is set to true. + * + * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages. + * + * @return callable(callable): callable Returns a function that accepts the next handler. + */ + public static function httpErrors(?BodySummarizerInterface $bodySummarizer = null): callable + { + return static function (callable $handler) use ($bodySummarizer): callable { + return static function ($request, array $options) use ($handler, $bodySummarizer) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + + return $handler($request, $options)->then( + static function (ResponseInterface $response) use ($request, $bodySummarizer) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response, null, [], $bodySummarizer); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable(callable): callable Returns a function that accepts the next handler. + * + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container): callable + { + if (!\is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return static function (callable $handler) use (&$container): callable { + return static function (RequestInterface $request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + static function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options, + ]; + + return $value; + }, + static function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options, + ]; + + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(?callable $before = null, ?callable $after = null): callable + { + return static function (callable $handler) use ($before, $after): callable { + return static function (RequestInterface $request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect(): callable + { + return static function (callable $handler): RedirectMiddleware { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, ?callable $delay = null): callable + { + return static function (callable $handler) use ($decider, $delay): RetryMiddleware { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable + { + // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter + if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) { + throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class)); + } + + return static function (callable $handler) use ($logger, $formatter, $logLevel): callable { + return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + + return $response; + }, + static function ($reason) use ($logger, $request, $formatter): PromiseInterface { + $response = $reason instanceof RequestException ? $reason->getResponse() : null; + $message = $formatter->format($request, $response, P\Create::exceptionFor($reason)); + $logger->error($message); + + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + */ + public static function prepareBody(): callable + { + return static function (callable $handler): PrepareBodyMiddleware { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + */ + public static function mapRequest(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + */ + public static function mapResponse(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 0000000..ddc304b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,125 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (\is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + */ + public function promise(): PromiseInterface + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch(ClientInterface $client, $requests, array $options = []): array + { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + \ksort($res); + + return $res; + } + + /** + * Execute callback(s) + */ + private static function cmpCallback(array &$options, string $name, array &$results): void + { + if (!isset($options[$name])) { + $options[$name] = static function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = static function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 0000000..7dde6c5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,105 @@ +nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\Utils::modifyRequest($request, $modify), $options); + } + + /** + * Add expect header + */ + private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void + { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = $options['expect'] ?? null; + + // Return if disabled or using HTTP/1.0 + if ($expect === false || $request->getProtocolVersion() === '1.0') { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 0000000..7aa21a6 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,228 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** + * @var callable(RequestInterface, array): PromiseInterface + */ + private $nextHandler; + + /** + * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!\is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response) + { + if (\strpos((string) $response->getStatusCode(), '3') !== 0 + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $response, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + // If authorization is handled by curl, unset it if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) { + unset( + $options['curl'][\CURLOPT_HTTPAUTH], + $options['curl'][\CURLOPT_USERPWD] + ); + } + + if (isset($options['allow_redirects']['on_redirect'])) { + ($options['allow_redirects']['on_redirect'])( + $request, + $response, + $nextRequest->getUri() + ); + } + + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + */ + private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface + { + return $promise->then( + static function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + \array_unshift($historyHeader, $uri); + \array_unshift($statusHeader, (string) $statusCode); + + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects. + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void + { + $current = $options['__redirect_count'] + ?? 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response); + } + } + + public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface + { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 + || ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $safeMethods = ['GET', 'HEAD', 'OPTIONS']; + $requestMethod = $request->getMethod(); + + $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET'; + $modify['body'] = ''; + } + + $uri = self::redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + $modify['uri'] = $uri; + Psr7\Message::rewindBody($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization and Cookie headers if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) { + $modify['remove_headers'][] = 'Authorization'; + $modify['remove_headers'][] = 'Cookie'; + } + + return Psr7\Utils::modifyRequest($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header. + */ + private static function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ): UriInterface { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!\in_array($location->getScheme(), $protocols)) { + throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 0000000..84a3500 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,274 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__.'::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @return int milliseconds. + */ + public static function exponentialDelay(int $retries): int + { + return (int) 2 ** ($retries - 1) * 1000; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + */ + private function onFulfilled(RequestInterface $request, array $options): callable + { + return function ($value) use ($request, $options) { + if (!($this->decider)( + $options['retries'], + $request, + $value, + null + )) { + return $value; + } + + return $this->doRetry($request, $options, $value); + }; + } + + /** + * Execute rejected closure + */ + private function onRejected(RequestInterface $req, array $options): callable + { + return function ($reason) use ($req, $options) { + if (!($this->decider)( + $options['retries'], + $req, + null, + $reason + )) { + return P\Create::rejectionFor($reason); + } + + return $this->doRetry($req, $options); + }; + } + + private function doRetry(RequestInterface $request, array $options, ?ResponseInterface $response = null): PromiseInterface + { + $options['delay'] = ($this->delay)(++$options['retries'], $response, $request); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 0000000..93fa334 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,133 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Returns true if a response was received. + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + */ + public function getEffectiveUri(): UriInterface + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime(): ?float + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + */ + public function getHandlerStats(): array + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat(string $stat) + { + return $this->handlerStats[$stat] ?? null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php new file mode 100644 index 0000000..c6a5893 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -0,0 +1,384 @@ += 0) { + if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (\function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (\function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } + } + + if (\ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; + } + + /** + * Get the default User-Agent string to use with Guzzle. + */ + public static function defaultUserAgent(): string + { + return sprintf('GuzzleHttp/%d', ClientInterface::MAJOR_VERSION); + } + + /** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @throws \RuntimeException if no bundle can be found. + * + * @deprecated Utils::defaultCaBundle will be removed in guzzlehttp/guzzle:8.0. This method is not needed in PHP 5.6+. + */ + public static function defaultCaBundle(): string + { + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = \ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = \ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (\file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException( + <<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: https://docs.guzzlephp.org/en/latest/request-options.html#verify. If +you do not need a specific certificate bundle, then Mozilla provides a commonly +used CA bundle which can be downloaded here (provided by the maintainer of +cURL): https://curl.haxx.se/ca/cacert.pem. Once you have a CA bundle available +on disk, you can set the 'openssl.cafile' PHP ini setting to point to the path +to the file, allowing you to omit the 'verify' request option. See +https://curl.haxx.se/docs/sslcerts.html for more information. +EOT + ); + } + + /** + * Creates an associative array of lowercase header names to the actual + * header casing. + */ + public static function normalizeHeaderKeys(array $headers): array + { + $result = []; + foreach (\array_keys($headers) as $key) { + $result[\strtolower($key)] = $key; + } + + return $result; + } + + /** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param string[] $noProxyArray An array of host patterns. + * + * @throws InvalidArgumentException + */ + public static function isHostInNoProxy(string $host, array $noProxyArray): bool + { + if (\strlen($host) === 0) { + throw new InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + [$host] = \explode(':', $host, 2); + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } + + if (empty($area)) { + // Don't match on empty values. + continue; + } + + if ($area === $host) { + // Exact matches. + return true; + } + // Special match if the area when prefixed with ".". Remove any + // existing leading "." and add a new leading ".". + $area = '.'.\ltrim($area, '.'); + if (\substr($host, -\strlen($area)) === $area) { + return true; + } + } + + return false; + } + + /** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return object|array|string|int|float|bool|null + * + * @throws InvalidArgumentException if the JSON cannot be decoded. + * + * @see https://www.php.net/manual/en/function.json-decode.php + */ + public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0) + { + $data = \json_decode($json, $assoc, $depth, $options); + if (\JSON_ERROR_NONE !== \json_last_error()) { + throw new InvalidArgumentException('json_decode error: '.\json_last_error_msg()); + } + + return $data; + } + + /** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @throws InvalidArgumentException if the JSON cannot be encoded. + * + * @see https://www.php.net/manual/en/function.json-encode.php + */ + public static function jsonEncode($value, int $options = 0, int $depth = 512): string + { + $json = \json_encode($value, $options, $depth); + if (\JSON_ERROR_NONE !== \json_last_error()) { + throw new InvalidArgumentException('json_encode error: '.\json_last_error_msg()); + } + + /** @var string */ + return $json; + } + + /** + * Wrapper for the hrtime() or microtime() functions + * (depending on the PHP version, one of the two is used) + * + * @return float UNIX timestamp + * + * @internal + */ + public static function currentTime(): float + { + return (float) \function_exists('hrtime') ? \hrtime(true) / 1e9 : \microtime(true); + } + + /** + * @throws InvalidArgumentException + * + * @internal + */ + public static function idnUriConvert(UriInterface $uri, int $options = 0): UriInterface + { + if ($uri->getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = $info['errors'] ?? 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: '.implode(', ', $errors).')'; + } + + throw new InvalidArgumentException($errorMessage); + } + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + + return $uri; + } + + /** + * @internal + */ + public static function getenv(string $name): ?string + { + if (isset($_SERVER[$name])) { + return (string) $_SERVER[$name]; + } + + if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) { + return (string) $value; + } + + return null; + } + + /** + * @return string|false + */ + private static function idnToAsci(string $domain, int $options, ?array &$info = []) + { + if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 0000000..9ab4b96 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,167 @@ + +Copyright (c) 2015 Graham Campbell +Copyright (c) 2017 Tobias Schultze +Copyright (c) 2020 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md new file mode 100644 index 0000000..493a931 --- /dev/null +++ b/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,559 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +## Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\Coroutine::of()`. + + +## Installation + +```shell +composer require guzzlehttp/promises +``` + + +## Version Guidance + +| Version | Status | PHP Version | +|---------|---------------------|--------------| +| 1.x | Security fixes only | >=5.5,<8.3 | +| 2.x | Latest | >=7.2.5,<8.6 | + + +## Quick Start + +A *promise* represents the eventual result of an asynchronous operation. The +primary way of interacting with a promise is through its `then` method, which +registers callbacks to receive either a promise's eventual value or the reason +why the promise cannot be fulfilled. + +### Callbacks + +Callbacks are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*Resolving* a promise means that you either fulfill a promise with a *value* or +reject a promise with a *reason*. Resolving a promise triggers callbacks +registered with the promise's `then` method. These callbacks are triggered +only once and in the order in which they were added. + +### Resolving a Promise + +Promises are fulfilled using the `resolve($value)` method. Resolving a promise +with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + +### Promise Forwarding + +Promises can be chained one after the other. Each then in the chain is a new +promise. The return value of a promise is what's forwarded to the next +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +### Promise Rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +### Rejection Forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + + +## Synchronous Wait + +You can synchronously force promises to complete using a promise's `wait` +method. When creating a promise, you can provide a wait function that is used +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + +### Unwrapping a Promise + +When synchronously waiting on a promise, you are joining the state of the +promise into the current state of execution (i.e., return the value of the +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +## Cancellation + +You can cancel a promise that has not yet been fulfilled using the `cancel()` +method of a promise. When creating a promise you can provide an optional +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +## API + +### Promise + +When creating a promise object, you can provide an optional `$waitFn` and +`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +### FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +### RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +## Promise Interoperability + +This library works with foreign promises that have a `then` method. This means +you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +a foreign promise. You will need to wrap a third-party promise with a Guzzle +promise in order to utilize wait and cancel functions with foreign promises. + + +### Event Loop Integration + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = GuzzleHttp\Promise\Utils::queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + + +## Implementation Notes + +### Promise Resolution and Chaining is Handled Iteratively + +By shuffling pending handlers from one owner to another, promises are +resolved iteratively, allowing for "infinite" then chaining. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +all of its pending handlers to the new promise. When the new promise is +eventually resolved, all of the pending handlers are delivered the forwarded +value. + +### A Promise is the Deferred + +Some promise libraries implement promises using a deferred object to represent +a computation and a promise object to represent the delivery of the result of +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "foo" +``` + + +## Upgrading from Function API + +A static API was first introduced in 1.4.0, in order to mitigate problems with +functions conflicting between global and local copies of the package. The +function API was removed in 2.0.0. A migration table has been provided here for +your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 0000000..9d6e856 --- /dev/null +++ b/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,58 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 0000000..40ffdbc --- /dev/null +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,19 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * + * @see https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function (): void { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + try { + $this->nextCoroutine($this->generator->current()); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * Create a new coroutine. + */ + public static function of(callable $generatorFn): self + { + return new self($generatorFn); + } + + public function then( + ?callable $onFulfilled = null, + ?callable $onRejected = null + ): PromiseInterface { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->result->otherwise($onRejected); + } + + public function wait(bool $unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState(): string + { + return $this->result->getState(); + } + + public function resolve($value): void + { + $this->result->resolve($value); + } + + public function reject($reason): void + { + $this->result->reject($reason); + } + + public function cancel(): void + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded): void + { + $this->currentPromise = Create::promiseFor($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value): void + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason): void + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(Create::exceptionFor($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 0000000..9d3fc4a --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,79 @@ +then([$promise, 'resolve'], [$promise, 'reject']); + + return $promise; + } + + return new FulfilledPromise($value); + } + + /** + * Creates a rejected promise for a reason if the reason is not a promise. + * If the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + */ + public static function rejectionFor($reason): PromiseInterface + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + */ + public static function exceptionFor($reason): \Throwable + { + if ($reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + */ + public static function iterFor($value): \Iterator + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 0000000..dd72c83 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,81 @@ + $onFulfilled, + 'rejected' => $onRejected, + ]))->promise(); + } + + /** + * Like of, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow + * for dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + */ + public static function ofLimit( + $iterable, + $concurrency, + ?callable $onFulfilled = null, + ?callable $onRejected = null + ): PromiseInterface { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency, + ]))->promise(); + } + + /** + * Like limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + */ + public static function ofLimitAll( + $iterable, + $concurrency, + ?callable $onFulfilled = null + ): PromiseInterface { + return self::ofLimit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate): void { + $aggregate->reject($reason); + } + ); + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 0000000..e123898 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,248 @@ +iterable = Create::iterFor($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + /** @psalm-suppress InvalidNullableReturnType */ + public function promise(): PromiseInterface + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ + $this->iterable->rewind(); + $this->refillPending(); + } catch (\Throwable $e) { + $this->aggregate->reject($e); + } + + /** + * @psalm-suppress NullableReturnStatement + */ + return $this->aggregate; + } + + private function createPromise(): void + { + $this->mutex = false; + $this->aggregate = new Promise(function (): void { + if ($this->checkIfFinished()) { + return; + } + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if (Is::settled($this->aggregate)) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function (): void { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending(): void + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()) { + } + + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? ($this->concurrency)(count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()) { + } + } + + private function addPending(): bool + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key): void { + if ($this->onFulfilled) { + ($this->onFulfilled)( + $value, + $key, + $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key): void { + if ($this->onRejected) { + ($this->onRejected)( + $reason, + $key, + $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator(): bool + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + + return false; + } + } + + private function step(int $idx): void + { + // If the promise was already resolved, then ignore this step. + if (Is::settled($this->aggregate)) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished(): bool + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + + return true; + } + + return false; + } +} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 0000000..727ec31 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,89 @@ +value = $value; + } + + public function then( + ?callable $onFulfilled = null, + ?callable $onRejected = null + ): PromiseInterface { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = Utils::queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled): void { + if (Is::pending($p)) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + return $unwrap ? $this->value : null; + } + + public function getState(): string + { + return self::FULFILLED; + } + + public function resolve($value): void + { + if ($value !== $this->value) { + throw new \LogicException('Cannot resolve a fulfilled promise'); + } + } + + public function reject($reason): void + { + throw new \LogicException('Cannot reject a fulfilled promise'); + } + + public function cancel(): void + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 0000000..f3f0503 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,40 @@ +getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + */ + public static function settled(PromiseInterface $promise): bool + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + */ + public static function fulfilled(PromiseInterface $promise): bool + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + */ + public static function rejected(PromiseInterface $promise): bool + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 0000000..c0c5be2 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,281 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + ?callable $onFulfilled = null, + ?callable $onRejected = null + ): PromiseInterface { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + $promise = Create::promiseFor($this->result); + + return $onFulfilled ? $promise->then($onFulfilled) : $promise; + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = Create::rejectionFor($this->result); + + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + $this->waitIfPending(); + + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } + if ($unwrap) { + if ($this->state === self::FULFILLED) { + return $this->result; + } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); + } + } + + public function getState(): string + { + return $this->state; + } + + public function cancel(): void + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value): void + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason): void + { + $this->settle(self::REJECTED, $reason); + } + + private function settle(string $state, $value): void + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!is_object($value) || !method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + Utils::queue()->add(static function () use ($id, $value, $handlers): void { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise && Is::pending($value)) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers): void { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers): void { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + */ + private static function callHandler(int $index, $value, array $handler): void + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if (Is::settled($promise)) { + return; + } + + try { + if (isset($handler[$index])) { + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending(): void + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's no wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + .'no internal wait function. You must provide a wait ' + .'function when constructing the promise to be able to ' + .'wait on a promise.'); + } + + Utils::queue()->run(); + + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn(): void + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Throwable $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList(): void + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + do { + $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); + + if ($result instanceof PromiseInterface) { + $result->wait(false); + } + } + } +} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 0000000..c11721e --- /dev/null +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,91 @@ +reason = $reason; + } + + public function then( + ?callable $onFulfilled = null, + ?callable $onRejected = null + ): PromiseInterface { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = Utils::queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected): void { + if (Is::pending($p)) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + if ($unwrap) { + throw Create::exceptionFor($this->reason); + } + + return null; + } + + public function getState(): string + { + return self::REJECTED; + } + + public function resolve($value): void + { + throw new \LogicException('Cannot resolve a rejected promise'); + } + + public function reject($reason): void + { + if ($reason !== $this->reason) { + throw new \LogicException('Cannot reject a rejected promise'); + } + } + + public function cancel(): void + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 0000000..47dca86 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,49 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: '.$description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: '.$this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 0000000..503e0b2 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,71 @@ +run(); + * + * @final + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct(bool $withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function (): void { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty(): bool + { + return !$this->queue; + } + + public function add(callable $task): void + { + $this->queue[] = $task; + } + + public function run(): void + { + while ($task = array_shift($this->queue)) { + /** @var callable $task */ + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown(): void + { + $this->enableShutdown = false; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 0000000..34c561a --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,24 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * + * + * @param TaskQueueInterface|null $assign Optionally specify a new queue instance. + */ + public static function queue(?TaskQueueInterface $assign = null): TaskQueueInterface + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * Adds a function to run in the task queue when it is next `run()` and + * returns a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + */ + public static function task(callable $task): PromiseInterface + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise): void { + try { + if (Is::pending($promise)) { + $promise->resolve($task()); + } + } catch (\Throwable $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * Synchronously waits on a promise to resolve and returns an inspection + * state array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the + * array will contain a "value" key mapping to the fulfilled value of the + * promise. If the promise is rejected, the array will contain a "reason" + * key mapping to the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + */ + public static function inspect(PromiseInterface $promise): array + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait(), + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } + } + + /** + * Waits on all of the provided promises, but does not unwrap rejected + * promises as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + */ + public static function inspectAll($promises): array + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = self::inspect($promise); + } + + return $results; + } + + /** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same + * order the promises were provided). An exception is thrown if any of the + * promises are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @throws \Throwable on error + */ + public static function unwrap($promises): array + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * Given an array of promises, return a promise that is fulfilled when all + * the items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + */ + public static function all($promises, bool $recursive = false): PromiseInterface + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results): void { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate): void { + if (Is::pending($aggregate)) { + $aggregate->reject($reason); + } + } + )->then(function () use (&$results) { + ksort($results); + + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + + return $results; + }); + } + + return $promise; + } + + /** + * Initiate a competitive race between multiple promises or values (values + * will become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise + * is fulfilled with an array that contains the fulfillment values of the + * winners in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number + * of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + */ + public static function some(int $count, $promises): PromiseInterface + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count): void { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections): void { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + + return array_values($results); + } + ); + } + + /** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + */ + public static function any($promises): PromiseInterface + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + */ + public static function settle($promises): PromiseInterface + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results): void { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results): void { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + + return $results; + }); + } +} diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md new file mode 100644 index 0000000..4a2a121 --- /dev/null +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -0,0 +1,485 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 2.8.0 - 2025-08-23 + +### Added + +- Allow empty lists as header values + +### Changed + +- PHP 8.5 support + +## 2.7.1 - 2025-03-27 + +### Fixed + +- Fixed uppercase IPv6 addresses in URI + +### Changed + +- Improve uploaded file error message + +## 2.7.0 - 2024-07-18 + +### Added + +- Add `Utils::redactUserInfo()` method +- Add ability to encode bools as ints in `Query::build` + +## 2.6.3 - 2024-07-18 + +### Fixed + +- Make `StreamWrapper::stream_stat()` return `false` if inner stream's size is `null` + +### Changed + +- PHP 8.4 support + +## 2.6.2 - 2023-12-03 + +### Fixed + +- Fixed another issue with the fact that PHP transforms numeric strings in array keys to ints + +### Changed + +- Updated links in docs to their canonical versions +- Replaced `call_user_func*` with native calls + +## 2.6.1 - 2023-08-27 + +### Fixed + +- Properly handle the fact that PHP transforms numeric strings in array keys to ints + +## 2.6.0 - 2023-08-03 + +### Changed + +- Updated the mime type map to add some new entries, fix a couple of invalid entries, and remove an invalid entry +- Fallback to `application/octet-stream` if we are unable to guess the content type for a multipart file upload + +## 2.5.1 - 2023-08-03 + +### Fixed + +- Corrected mime type for `.acc` files to `audio/aac` + +### Changed + +- PHP 8.3 support + +## 2.5.0 - 2023-04-17 + +### Changed + +- Adjusted `psr/http-message` version constraint to `^1.1 || ^2.0` + +## 2.4.5 - 2023-04-17 + +### Fixed + +- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec` +- Fixed `Message::bodySummary` when `preg_match` fails +- Fixed header validation issue + +## 2.4.4 - 2023-03-09 + +### Changed + +- Removed the need for `AllowDynamicProperties` in `LazyOpenStream` + +## 2.4.3 - 2022-10-26 + +### Changed + +- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))` + +## 2.4.2 - 2022-10-25 + +### Fixed + +- Fixed erroneous behaviour when combining host and relative path + +## 2.4.1 - 2022-08-28 + +### Fixed + +- Rewind body before reading in `Message::bodySummary` + +## 2.4.0 - 2022-06-20 + +### Added + +- Added provisional PHP 8.2 support +- Added `UriComparator::isCrossOrigin` method + +## 2.3.0 - 2022-06-09 + +### Fixed + +- Added `Header::splitList` method +- Added `Utils::tryGetContents` method +- Improved `Stream::getContents` method +- Updated mimetype mappings + +## 2.2.2 - 2022-06-08 + +### Fixed + +- Fix `Message::parseRequestUri` for numeric headers +- Re-wrap exceptions thrown in `fread` into runtime exceptions +- Throw an exception when multipart options is misformatted + +## 2.2.1 - 2022-03-20 + +### Fixed + +- Correct header value validation + +## 2.2.0 - 2022-03-20 + +### Added + +- A more compressive list of mime types +- Add JsonSerializable to Uri +- Missing return types + +### Fixed + +- Bug MultipartStream no `uri` metadata +- Bug MultipartStream with filename for `data://` streams +- Fixed new line handling in MultipartStream +- Reduced RAM usage when copying streams +- Updated parsing in `Header::normalize()` + +## 2.1.1 - 2022-03-20 + +### Fixed + +- Validate header values properly + +## 2.1.0 - 2021-10-06 + +### Changed + +- Attempting to create a `Uri` object from a malformed URI will no longer throw a generic + `InvalidArgumentException`, but rather a `MalformedUriException`, which inherits from the former + for backwards compatibility. Callers relying on the exception being thrown to detect invalid + URIs should catch the new exception. + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + +## 2.0.0 - 2021-06-30 + +Identical to the RC release. + +## 2.0.0@RC-1 - 2021-04-29 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 2.0.0@beta-1 - 2021-03-21 + +### Added + +- PSR-17 factories +- Made classes final +- PHP7 type hints + +### Changed + +- When building a query string, booleans are represented as 1 and 0. + +### Removed + +- PHP < 7.2 support +- All functions in the `GuzzleHttp\Psr7` namespace + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 + +### Added + +- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) +- Added MIME type for WEBP image format (#246) +- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) + +### Changed + +- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) +- Accept port number 0 to be valid (#270) + +### Fixed + +- Fixed subsequent reads from `php://input` in ServerRequest (#247) +- Fixed readable/writable detection for certain stream modes (#248) +- Fixed encoding of special characters in the `userInfo` component of an URI (#253) + + +## [1.5.2] - 2018-12-04 + +### Fixed + +- Check body size when getting the message summary + + +## [1.5.1] - 2018-12-04 + +### Fixed + +- Get the summary of a body only if it is readable + + +## [1.5.0] - 2018-12-03 + +### Added + +- Response first-line to response string exception (fixes #145) +- A test for #129 behavior +- `get_message_body_summary` function in order to get the message summary +- `3gp` and `mkv` mime types + +### Changed + +- Clarify exception message when stream is detached + +### Deprecated + +- Deprecated parsing folded header lines as per RFC 7230 + +### Fixed + +- Fix `AppendStream::detach` to not close streams +- `InflateStream` preserves `isSeekable` attribute of the underlying stream +- `ServerRequest::getUriFromGlobals` to support URLs in query parameters + + +Several other fixes and improvements. + + +## [1.4.2] - 2017-03-20 + +### Fixed + +- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing + calls to `trigger_error` when deprecated methods are invoked. + + +## [1.4.1] - 2017-02-27 + +### Added + +- Rriggering of silenced deprecation warnings. + +### Fixed + +- Reverted BC break by reintroducing behavior to automagically fix a URI with a + relative path and an authority by adding a leading slash to the path. It's only + deprecated now. + + +## [1.4.0] - 2017-02-21 + +### Added + +- Added common URI utility methods based on RFC 3986 (see documentation in the readme): + - `Uri::isDefaultPort` + - `Uri::isAbsolute` + - `Uri::isNetworkPathReference` + - `Uri::isAbsolutePathReference` + - `Uri::isRelativePathReference` + - `Uri::isSameDocumentReference` + - `Uri::composeComponents` + - `UriNormalizer::normalize` + - `UriNormalizer::isEquivalent` + - `UriResolver::relativize` + +### Changed + +- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. +- Allow `parse_response` to parse a response without delimiting space and reason. +- Ensure each URI modification results in a valid URI according to PSR-7 discussions. + Invalid modifications will throw an exception instead of returning a wrong URI or + doing some magic. + - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 0000000..51c7ec8 --- /dev/null +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,26 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 0000000..24aad86 --- /dev/null +++ b/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,887 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](https://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + +![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg) +![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) + + +## Features + +This package comes with a number of stream implementations and stream +decorators. + + +## Installation + +```shell +composer require guzzlehttp/psr7 +``` + +## Version Guidance + +| Version | Status | PHP Version | +|---------|---------------------|--------------| +| 1.x | EOL (2024-06-30) | >=5.4,<8.2 | +| 2.x | Latest | >=7.2.5,<8.6 | + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\Utils::streamFor(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\Utils::streamFor('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content. + +This stream decorator converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + private $stream; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + ($this->callback)(); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Static API + +There are various static methods available under the `GuzzleHttp\Psr7` namespace. + + +## `GuzzleHttp\Psr7\Message::toString` + +`public static function toString(MessageInterface $message): string` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\Message::toString($request); +``` + + +## `GuzzleHttp\Psr7\Message::bodySummary` + +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` + +Get a short summary of the message body. + +Will return `null` if the response is not printable. + + +## `GuzzleHttp\Psr7\Message::rewindBody` + +`public static function rewindBody(MessageInterface $message): void` + +Attempts to rewind a message body and throws an exception on failure. + +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. + + +## `GuzzleHttp\Psr7\Message::parseMessage` + +`public static function parseMessage(string $message): array` + +Parses an HTTP message into an associative array. + +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. + + +## `GuzzleHttp\Psr7\Message::parseRequestUri` + +`public static function parseRequestUri(string $path, array $headers): string` + +Constructs a URI for an HTTP request message. + + +## `GuzzleHttp\Psr7\Message::parseRequest` + +`public static function parseRequest(string $message): Request` + +Parses a request message string into a request object. + + +## `GuzzleHttp\Psr7\Message::parseResponse` + +`public static function parseResponse(string $message): Response` + +Parses a response message string into a response object. + + +## `GuzzleHttp\Psr7\Header::parse` + +`public static function parse(string|array $header): array` + +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +of the header. When a parameter does not contain a value, but just +contains a key, this function will inject a key with a '' string value. + + +## `GuzzleHttp\Psr7\Header::splitList` + +`public static function splitList(string|string[] $header): string[]` + +Splits a HTTP header defined to contain a comma-separated list into +each individual value: + +``` +$knownEtags = Header::splitList($request->getHeader('if-none-match')); +``` + +Example headers include `accept`, `cache-control` and `if-none-match`. + + +## `GuzzleHttp\Psr7\Header::normalize` (deprecated) + +`public static function normalize(string|array $header): array` + +`Header::normalize()` is deprecated in favor of [`Header::splitList()`](README.md#guzzlehttppsr7headersplitlist) +which performs the same operation with a cleaned up API and improved +documentation. + +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. + + +## `GuzzleHttp\Psr7\Query::parse` + +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + + +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). + + +## `GuzzleHttp\Psr7\Utils::caselessRemove` + +`public static function caselessRemove(iterable $keys, $keys, array $data): array` + +Remove the items given by the keys, case insensitively from the data. + + +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of +bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. + +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. + + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `GuzzleHttp\Psr7\Utils::readLine` + +`public static function readLine(StreamInterface $stream, ?int $maxLength = null): string` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `GuzzleHttp\Psr7\Utils::redactUserInfo` + +`public static function redactUserInfo(UriInterface $uri): UriInterface` + +Redact the password in the user info part of a URI. + + +## `GuzzleHttp\Psr7\Utils::streamFor` + +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +- metadata: Array of custom metadata. +- size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` + + +## `GuzzleHttp\Psr7\Utils::tryFopen` + +`public static function tryFopen(string $filename, string $mode): resource` + +Safely opens a PHP stream resource using a filename. + +When fopen fails, PHP normally raises a warning. This function adds an +error handler that checks for errors and throws an exception instead. + + +## `GuzzleHttp\Psr7\Utils::tryGetContents` + +`public static function tryGetContents(resource $stream): string` + +Safely gets the contents of a given stream. + +When stream_get_contents fails, PHP normally raises a warning. This +function adds an error handler that checks for errors and throws an +exception instead. + + +## `GuzzleHttp\Psr7\Utils::uriFor` + +`public static function uriFor(string|UriInterface $uri): UriInterface` + +Returns a UriInterface for the given value. + +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` + +Determines the mimetype of a file by looking at its extension. + + +## `GuzzleHttp\Psr7\MimeType::fromExtension` + +`public static function fromExtension(string $extension): string|null` + +Maps a file extensions to a mimetype. + + +## Upgrading from Function API + +The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://datatracker.ietf.org/doc/html/rfc3986#section-5.3). Usually this method does not need +to be called manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`public static function fromParts(array $parts): UriInterface` + +Creates a URI from a hash of [`parse_url`](https://www.php.net/manual/en/function.parse-url.php) components. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Cross-Origin Detection + +`GuzzleHttp\Psr7\UriComparator` provides methods to determine if a modified URL should be considered cross-origin. + +### `GuzzleHttp\Psr7\UriComparator::isCrossOrigin` + +`public static function isCrossOrigin(UriInterface $original, UriInterface $modified): bool` + +Determines if a modified URL should be considered cross-origin with respect to an original URL. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://datatracker.ietf.org/doc/html/rfc3986#section-5). This is for example also what web +browsers do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://datatracker.ietf.org/doc/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 0000000..96098f5 --- /dev/null +++ b/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,93 @@ +{ + "name": "guzzlehttp/psr7", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "request", + "response", + "message", + "stream", + "http", + "uri", + "url", + "psr-7" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 0000000..ee8f378 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,248 @@ +addStream($stream); + } + } + + public function __toString(): string + { + try { + $this->rewind(); + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream): void + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + */ + public function close(): void + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell(): int + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + */ + public function getSize(): ?int + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof(): bool + { + return !$this->streams + || ($this->current >= count($this->streams) - 1 + && $this->streams[$this->current]->eof()); + } + + public function rewind(): void + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + */ + public function seek($offset, $whence = SEEK_SET): void + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + .$i.' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + */ + public function read($length): string + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + ++$this->current; + } + + $result = $this->streams[$this->current]->read($remaining); + + if ($result === '') { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return false; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 0000000..2b0eb77 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,147 @@ +hwm = $hwm; + } + + public function __toString(): string + { + return $this->getContents(); + } + + public function getContents(): string + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close(): void + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize(): ?int + { + return strlen($this->buffer); + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return true; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof(): bool + { + return strlen($this->buffer) === 0; + } + + public function tell(): int + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length): string + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string): int + { + $this->buffer .= $string; + + if (strlen($this->buffer) >= $this->hwm) { + return 0; + } + + return strlen($string); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if ($key === 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 0000000..7e4554d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,153 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize(): ?int + { + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence === SEEK_SET) { + $byte = $offset; + } elseif ($whence === SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence === SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length): string + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string): int + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof(): bool + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close(): void + { + $this->remoteStream->close(); + $this->stream->close(); + } + + private function cacheEntireStream(): int + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 0000000..6e3d209 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,49 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string): int + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php new file mode 100644 index 0000000..3a08477 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php @@ -0,0 +1,14 @@ + */ + private $methods; + + /** + * @param array $methods Hash of method name to a callable. + */ + public function __construct(array $methods) + { + $this->methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_'.$name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get(string $name): void + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + .'() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + ($this->_fn_close)(); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup(): void + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) { + /** @var callable $callable */ + $callable = [$stream, $diff]; + $methods[$diff] = $callable; + } + + return new self($methods); + } + + public function __toString(): string + { + try { + /** @var string */ + return ($this->_fn___toString)(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function close(): void + { + ($this->_fn_close)(); + } + + public function detach() + { + return ($this->_fn_detach)(); + } + + public function getSize(): ?int + { + return ($this->_fn_getSize)(); + } + + public function tell(): int + { + return ($this->_fn_tell)(); + } + + public function eof(): bool + { + return ($this->_fn_eof)(); + } + + public function isSeekable(): bool + { + return ($this->_fn_isSeekable)(); + } + + public function rewind(): void + { + ($this->_fn_rewind)(); + } + + public function seek($offset, $whence = SEEK_SET): void + { + ($this->_fn_seek)($offset, $whence); + } + + public function isWritable(): bool + { + return ($this->_fn_isWritable)(); + } + + public function write($string): int + { + return ($this->_fn_write)($string); + } + + public function isReadable(): bool + { + return ($this->_fn_isReadable)(); + } + + public function read($length): string + { + return ($this->_fn_read)($length); + } + + public function getContents(): string + { + return ($this->_fn_getContents)(); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return ($this->_fn_getMetadata)($key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 0000000..bbce8b0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,134 @@ +]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @deprecated Use self::splitList() instead. + */ + public static function normalize($header): array + { + $result = []; + foreach ((array) $header as $value) { + foreach (self::splitList($value) as $parsed) { + $result[] = $parsed; + } + } + + return $result; + } + + /** + * Splits a HTTP header defined to contain a comma-separated list into + * each individual value. Empty values will be removed. + * + * Example headers include 'accept', 'cache-control' and 'if-none-match'. + * + * This method must not be used to parse headers that are not defined as + * a list, such as 'user-agent' or 'set-cookie'. + * + * @param string|string[] $values Header value as returned by MessageInterface::getHeader() + * + * @return string[] + */ + public static function splitList($values): array + { + if (!\is_array($values)) { + $values = [$values]; + } + + $result = []; + foreach ($values as $value) { + if (!\is_string($value)) { + throw new \TypeError('$header must either be a string or an array containing strings.'); + } + + $v = ''; + $isQuoted = false; + $isEscaped = false; + for ($i = 0, $max = \strlen($value); $i < $max; ++$i) { + if ($isEscaped) { + $v .= $value[$i]; + $isEscaped = false; + + continue; + } + + if (!$isQuoted && $value[$i] === ',') { + $v = \trim($v); + if ($v !== '') { + $result[] = $v; + } + + $v = ''; + continue; + } + + if ($isQuoted && $value[$i] === '\\') { + $isEscaped = true; + $v .= $value[$i]; + + continue; + } + if ($value[$i] === '"') { + $isQuoted = !$isQuoted; + $v .= $value[$i]; + + continue; + } + + $v .= $value[$i]; + } + + $v = \trim($v); + if ($v !== '') { + $result[] = $v; + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php new file mode 100644 index 0000000..3ef1510 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/HttpFactory.php @@ -0,0 +1,94 @@ +getSize(); + } + + return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); + } + + public function createStream(string $content = ''): StreamInterface + { + return Utils::streamFor($content); + } + + public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface + { + try { + $resource = Utils::tryFopen($file, $mode); + } catch (\RuntimeException $e) { + if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { + throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e); + } + + throw $e; + } + + return Utils::streamFor($resource); + } + + public function createStreamFromResource($resource): StreamInterface + { + return Utils::streamFor($resource); + } + + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface + { + if (empty($method)) { + if (!empty($serverParams['REQUEST_METHOD'])) { + $method = $serverParams['REQUEST_METHOD']; + } else { + throw new \InvalidArgumentException('Cannot determine HTTP method'); + } + } + + return new ServerRequest($method, $uri, [], null, '1.1', $serverParams); + } + + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + return new Response($code, [], null, '1.1', $reasonPhrase); + } + + public function createRequest(string $method, $uri): RequestInterface + { + return new Request($method, $uri); + } + + public function createUri(string $uri = ''): UriInterface + { + return new Uri($uri); + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 0000000..e674c9a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,37 @@ + 15 + 32]); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 0000000..f6c8490 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,49 @@ +filename = $filename; + $this->mode = $mode; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->stream); + } + + /** + * Creates the underlying stream lazily when required. + */ + protected function createStream(): StreamInterface + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 0000000..fb22325 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,157 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof(): bool + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit === -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + */ + public function getSize(): ?int + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit === -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + */ + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + */ + public function tell(): int + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset(int $offset): void + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit(int $limit): void + { + $this->limit = $limit; + } + + public function read($length): string + { + if ($this->limit === -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 0000000..5561a51 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,246 @@ +getMethod().' ' + .$message->getRequestTarget()) + .' HTTP/'.$message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: ".$message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/'.$message->getProtocolVersion().' ' + .$message->getStatusCode().' ' + .$message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (is_string($name) && strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: ".$value; + } + } else { + $msg .= "\r\n{$name}: ".implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n".$message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + */ + public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $body->rewind(); + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message): void + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + */ + public static function parseMessage(string $message): array + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + [$rawHeaders, $body] = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + [$startLine, $rawHeaders] = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + */ + public static function parseRequestUri(string $path, array $headers): string + { + $hostKey = array_filter(array_keys($headers), function ($k) { + // Numeric array keys are converted to int by PHP. + $k = (string) $k; + + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme.'://'.$host.'/'.ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + */ + public static function parseRequest(string $message): RequestInterface + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + */ + public static function parseResponse(string $message): ResponseInterface + { + $data = self::parseMessage($message); + // According to https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2 + // the space between status-code and reason-phrase is required. But + // browsers accept responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + $parts[2] ?? null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 0000000..c15ee63 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,261 @@ + array of values */ + private $headers = []; + + /** @var string[] Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion(): string + { + return $this->protocol; + } + + public function withProtocolVersion($version): MessageInterface + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + + return $new; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function hasHeader($header): bool + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header): array + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header): string + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header): MessageInterface + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody(): StreamInterface + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body): MessageInterface + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + + return $new; + } + + /** + * @param (string|string[])[] $headers + */ + private function setHeaders(array $headers): void + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + // Numeric array keys are converted to int by PHP. + $header = (string) $header; + + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * @param mixed $value + * + * @return string[] + */ + private function normalizeHeaderValue($value): array + { + if (!is_array($value)) { + return $this->trimAndValidateHeaderValues([$value]); + } + + return $this->trimAndValidateHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param mixed[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4 + */ + private function trimAndValidateHeaderValues(array $values): array + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + $trimmed = trim((string) $value, " \t"); + $this->assertValue($trimmed); + + return $trimmed; + }, array_values($values)); + } + + /** + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 + * + * @param mixed $header + */ + private function assertHeader($header): void + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header name.', $header) + ); + } + } + + /** + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 + * + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * VCHAR = %x21-7E + * obs-text = %x80-FF + * obs-fold = CRLF 1*( SP / HTAB ) + */ + private function assertValue(string $value): void + { + // The regular expression intentionally does not support the obs-fold production, because as + // per RFC 7230#3.2.4: + // + // A sender MUST NOT generate a message that includes + // line folding (i.e., that has any field-value that contains a match to + // the obs-fold rule) unless the message is intended for packaging + // within the message/http media type. + // + // Clients must not send a request with line folding and a server sending folded headers is + // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting + // folding is not likely to break any legitimate use case. + if (!preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header value.', $value) + ); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 0000000..b131bdb --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,1259 @@ + 'application/vnd.1000minds.decision-model+xml', + '3dml' => 'text/vnd.in3d.3dml', + '3ds' => 'image/x-3ds', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + '3gpp' => 'video/3gpp', + '3mf' => 'model/3mf', + '7z' => 'application/x-7z-compressed', + '7zip' => 'application/x-7z-compressed', + '123' => 'application/vnd.lotus-1-2-3', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/aac', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/vnd.nokia.n-gage.ac+xml', + 'ac3' => 'audio/ac3', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'acutc' => 'application/vnd.acucorp', + 'adp' => 'audio/adpcm', + 'adts' => 'audio/aac', + 'aep' => 'application/vnd.audiograph', + 'afm' => 'application/x-font-type1', + 'afp' => 'application/vnd.ibm.modcap', + 'age' => 'application/vnd.age', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/pdf', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'air' => 'application/vnd.adobe.air-application-installer-package+zip', + 'ait' => 'application/vnd.dvb.ait', + 'ami' => 'application/vnd.amiga.ami', + 'aml' => 'application/automationml-aml+xml', + 'amlx' => 'application/automationml-amlx+zip', + 'amr' => 'audio/amr', + 'apk' => 'application/vnd.android.package-archive', + 'apng' => 'image/apng', + 'appcache' => 'text/cache-manifest', + 'appinstaller' => 'application/appinstaller', + 'application' => 'application/x-ms-application', + 'appx' => 'application/appx', + 'appxbundle' => 'application/appxbundle', + 'apr' => 'application/vnd.lotus-approach', + 'arc' => 'application/x-freearc', + 'arj' => 'application/x-arj', + 'asc' => 'application/pgp-signature', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomdeleted' => 'application/atomdeleted+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/x-au', + 'avci' => 'image/avci', + 'avcs' => 'image/avcs', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azv' => 'image/vnd.airzip.accelerator.azv', + 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bdoc' => 'application/x-bdoc', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'blb' => 'application/x-blorb', + 'blorb' => 'application/x-blorb', + 'bmi' => 'application/vnd.bmi', + 'bmml' => 'application/vnd.balsamiq.bmml+xml', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + 'bpk' => 'application/octet-stream', + 'bpmn' => 'application/octet-stream', + 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btf' => 'image/prs.btif', + 'btif' => 'image/prs.btif', + 'buffer' => 'application/octet-stream', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c4d' => 'application/vnd.clonk.c4group', + 'c4f' => 'application/vnd.clonk.c4group', + 'c4g' => 'application/vnd.clonk.c4group', + 'c4p' => 'application/vnd.clonk.c4group', + 'c4u' => 'application/vnd.clonk.c4group', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + 'cab' => 'application/vnd.ms-cab-compressed', + 'caf' => 'audio/x-caf', + 'cap' => 'application/vnd.tcpdump.pcap', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', + 'cc' => 'text/x-c', + 'cco' => 'application/x-cocoa', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + 'cdfx' => 'application/cdfx+xml', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdmia' => 'application/cdmi-capability', + 'cdmic' => 'application/cdmi-container', + 'cdmid' => 'application/cdmi-domain', + 'cdmio' => 'application/cdmi-object', + 'cdmiq' => 'application/cdmi-queue', + 'cdr' => 'application/cdr', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfs' => 'application/x-cfs-compressed', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + 'cjs' => 'application/node', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/octet-stream', + 'cld' => 'model/vnd.cld', + 'clkk' => 'application/vnd.crick.clicker.keyboard', + 'clkp' => 'application/vnd.crick.clicker.palette', + 'clkt' => 'application/vnd.crick.clicker.template', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'coffee' => 'text/coffeescript', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpl' => 'application/cpl+xml', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'crx' => 'application/x-chrome-extension', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'csh' => 'application/x-csh', + 'csl' => 'application/vnd.citationstyles.style+xml', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'csr' => 'application/octet-stream', + 'css' => 'text/css', + 'cst' => 'application/x-director', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cwl' => 'application/cwl', + 'cww' => 'application/prs.cww', + 'cxt' => 'application/x-director', + 'cxx' => 'text/x-c', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dart' => 'application/vnd.dart', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dbf' => 'application/vnd.dbf', + 'dbk' => 'application/docbook+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'ddf' => 'application/vnd.syncml.dmddf+xml', + 'dds' => 'image/vnd.ms-dds', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dfac' => 'application/vnd.dreamfactory', + 'dgc' => 'application/x-dgc-compressed', + 'dib' => 'image/bmp', + 'dic' => 'text/x-c', + 'dir' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'disposition-notification' => 'message/disposition-notification', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/octet-stream', + 'dmg' => 'application/x-apple-diskimage', + 'dmn' => 'application/octet-stream', + 'dmp' => 'application/vnd.tcpdump.pcap', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dp' => 'application/vnd.osgi.dp', + 'dpg' => 'application/vnd.dpgraph', + 'dpx' => 'image/dpx', + 'dra' => 'audio/vnd.dra', + 'drle' => 'image/dicom-rle', + 'dsc' => 'text/prs.lines.tag', + 'dssc' => 'application/dssc+der', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dump' => 'application/octet-stream', + 'dvb' => 'video/vnd.dvb.file', + 'dvi' => 'application/x-dvi', + 'dwd' => 'application/atsc-dwd+xml', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + 'ear' => 'application/java-archive', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'elc' => 'application/octet-stream', + 'emf' => 'image/emf', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'emotionml' => 'application/emotionml+xml', + 'emz' => 'application/x-msmetafile', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es3' => 'application/vnd.eszigno3+xml', + 'esa' => 'application/vnd.osgi.subsystem', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'eva' => 'application/x-eva', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'exi' => 'application/exi', + 'exp' => 'application/express', + 'exr' => 'image/aces', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f' => 'text/x-fortran', + 'f4v' => 'video/mp4', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + 'fdt' => 'application/fdt+xml', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fgd' => 'application/x-director', + 'fh' => 'image/x-freehand', + 'fh4' => 'image/x-freehand', + 'fh5' => 'image/x-freehand', + 'fh7' => 'image/x-freehand', + 'fhc' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fits' => 'image/fits', + 'flac' => 'audio/x-flac', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fo' => 'application/vnd.software602.filler.form+xml', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frame' => 'application/vnd.framemaker', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fxp' => 'application/vnd.adobe.fxp', + 'fxpl' => 'application/vnd.adobe.fxp', + 'fzs' => 'application/vnd.fuzzysheet', + 'g2w' => 'application/vnd.geoplan', + 'g3' => 'image/g3fax', + 'g3w' => 'application/vnd.geospace', + 'gac' => 'application/vnd.groove-account', + 'gam' => 'application/x-tads', + 'gbr' => 'application/rpki-ghostbusters', + 'gca' => 'application/x-gca-compressed', + 'gdl' => 'model/vnd.gdl', + 'gdoc' => 'application/vnd.google-apps.document', + 'ged' => 'text/vnd.familysearch.gedcom', + 'geo' => 'application/vnd.dynageo', + 'geojson' => 'application/geo+json', + 'gex' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'glb' => 'model/gltf-binary', + 'gltf' => 'model/gltf+json', + 'gml' => 'application/gml+xml', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gpg' => 'application/gpg-keys', + 'gph' => 'application/vnd.flographit', + 'gpx' => 'application/gpx+xml', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gramps' => 'application/x-gramps-xml', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gsheet' => 'application/vnd.google-apps.spreadsheet', + 'gslides' => 'application/vnd.google-apps.presentation', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxf' => 'application/gxf', + 'gxt' => 'application/vnd.geonext', + 'gz' => 'application/gzip', + 'gzip' => 'application/gzip', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hbs' => 'text/x-handlebars-template', + 'hdd' => 'application/x-virtualbox-hdd', + 'hdf' => 'application/x-hdf', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'hej2' => 'image/hej2k', + 'held' => 'application/atsc-held+xml', + 'hh' => 'text/x-c', + 'hjson' => 'application/hjson', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hsj2' => 'image/hsj2', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'htm' => 'text/html', + 'html' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'i2g' => 'application/vnd.intergeo', + 'icc' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'icm' => 'application/vnd.iccprofile', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ief' => 'image/ief', + 'ifb' => 'text/calendar', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'iges' => 'model/iges', + 'igl' => 'application/vnd.igloader', + 'igm' => 'application/vnd.insors.igm', + 'igs' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'img' => 'application/octet-stream', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ink' => 'application/inkml+xml', + 'inkml' => 'application/inkml+xml', + 'install' => 'application/x-install-instructions', + 'iota' => 'application/vnd.astraea-software.iota', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/x-iso9660-image', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'its' => 'application/its+xml', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jade' => 'text/jade', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'jardiff' => 'application/x-java-archive-diff', + 'java' => 'text/x-java-source', + 'jhc' => 'image/jphc', + 'jisp' => 'application/vnd.jisp', + 'jls' => 'image/jls', + 'jlt' => 'application/vnd.hp-jlyt', + 'jng' => 'image/x-jng', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jp2' => 'image/jp2', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpf' => 'image/jpx', + 'jpg' => 'image/jpeg', + 'jpg2' => 'image/jp2', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jph' => 'image/jph', + 'jpm' => 'video/jpm', + 'jpx' => 'image/jpx', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'json5' => 'application/json5', + 'jsonld' => 'application/ld+json', + 'jsonml' => 'application/jsonml+json', + 'jsx' => 'text/jsx', + 'jt' => 'model/jt', + 'jxr' => 'image/jxr', + 'jxra' => 'image/jxra', + 'jxrs' => 'image/jxrs', + 'jxs' => 'image/jxs', + 'jxsc' => 'image/jxsc', + 'jxsi' => 'image/jxsi', + 'jxss' => 'image/jxss', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + 'kdb' => 'application/octet-stream', + 'kdbx' => 'application/x-keepass2', + 'key' => 'application/x-iwork-keynote-sffkey', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne' => 'application/vnd.kinar', + 'knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr' => 'application/vnd.kde.kpresenter', + 'kpt' => 'application/vnd.kde.kpresenter', + 'kpxx' => 'application/vnd.ds-keypoint', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + 'ktx2' => 'image/ktx2', + 'ktz' => 'application/vnd.kahootz', + 'kwd' => 'application/vnd.kde.kword', + 'kwt' => 'application/vnd.kde.kword', + 'lasxml' => 'application/vnd.las.las+xml', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'lgr' => 'application/lgr+xml', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'litcoffee' => 'text/coffeescript', + 'lnk' => 'application/x-ms-shortcut', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lua' => 'text/x-lua', + 'luac' => 'application/x-lua-bytecode', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'text/plain', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/x-m4a', + 'm4p' => 'application/mp4', + 'm4s' => 'video/iso.segment', + 'm4u' => 'application/vnd.mpegurl', + 'm4v' => 'video/x-m4v', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm21' => 'application/mp21', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'maei' => 'application/mmt-aei+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + 'manifest' => 'text/cache-manifest', + 'map' => 'application/json', + 'mar' => 'application/octet-stream', + 'markdown' => 'text/markdown', + 'mathml' => 'application/mathml+xml', + 'mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'md' => 'text/markdown', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mdx' => 'text/mdx', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'metalink' => 'application/metalink+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mft' => 'application/rpki-manifest', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mie' => 'application/x-mie', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mjs' => 'text/javascript', + 'mk3d' => 'video/x-matroska', + 'mka' => 'audio/x-matroska', + 'mkd' => 'text/x-markdown', + 'mks' => 'video/x-matroska', + 'mkv' => 'video/x-matroska', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mml' => 'text/mathml', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mng' => 'video/x-mng', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mp21' => 'application/mp21', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpd' => 'application/dash+xml', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpf' => 'application/media-policy-dataset+xml', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'mpga' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mrcx' => 'application/marcxml+xml', + 'ms' => 'text/troff', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + 'msg' => 'application/vnd.ms-outlook', + 'msh' => 'model/mesh', + 'msi' => 'application/x-msdownload', + 'msix' => 'application/msix', + 'msixbundle' => 'application/msixbundle', + 'msl' => 'application/vnd.mobius.msl', + 'msm' => 'application/octet-stream', + 'msp' => 'application/octet-stream', + 'msty' => 'application/vnd.muvee.style', + 'mtl' => 'model/mtl', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musd' => 'application/mmt-usd+xml', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mvt' => 'application/vnd.mapbox-vector-tile', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxmf' => 'audio/mobile-xmf', + 'mxml' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'n3' => 'text/n3', + 'nb' => 'application/mathematica', + 'nbp' => 'application/vnd.wolfram.player', + 'nc' => 'application/x-netcdf', + 'ncx' => 'application/x-dtbncx+xml', + 'nfo' => 'text/x-nfo', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nitf' => 'application/vnd.nitf', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nq' => 'application/n-quads', + 'nsc' => 'application/x-conference', + 'nsf' => 'application/vnd.lotus-notes', + 'nt' => 'application/n-triples', + 'ntf' => 'application/vnd.nitf', + 'numbers' => 'application/x-iwork-numbers-sffnumbers', + 'nzb' => 'application/x-nzb', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'obgx' => 'application/vnd.openblox.game+xml', + 'obj' => 'model/obj', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga' => 'audio/ogg', + 'ogex' => 'model/vnd.opengex', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'omdoc' => 'application/omdoc+xml', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'opml' => 'text/x-opml', + 'oprc' => 'application/vnd.palm', + 'opus' => 'audio/ogg', + 'org' => 'text/x-org', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'osm' => 'application/vnd.openstreetmap.data+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'font/otf', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ova' => 'application/x-virtualbox-ova', + 'ovf' => 'application/x-virtualbox-ovf', + 'owl' => 'application/rdf+xml', + 'oxps' => 'application/oxps', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p7a' => 'application/x-pkcs7-signature', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'p8' => 'application/pkcs8', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'pages' => 'application/x-iwork-pages-sffpages', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcap' => 'application/vnd.tcpdump.pcap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pct' => 'image/x-pict', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb' => 'application/x-pilot', + 'pde' => 'text/x-processing', + 'pdf' => 'application/pdf', + 'pem' => 'application/x-x509-user-cert', + 'pfa' => 'application/x-font-type1', + 'pfb' => 'application/x-font-type1', + 'pfm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp', + 'phar' => 'application/octet-stream', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'pkpass' => 'application/vnd.apple.pkpass', + 'pl' => 'application/x-perl', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pm' => 'application/x-perl', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'pot' => 'application/vnd.ms-powerpoint', + 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => 'application/powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'model/prc', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'provx' => 'application/provenance+xml', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'application/x-photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + 'pti' => 'image/prs.pti', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + 'pvb' => 'application/vnd.3gpp.pic-bw-var', + 'pwn' => 'application/vnd.3m.post-it-notes', + 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyo' => 'model/vnd.pytha.pyox', + 'pyox' => 'model/vnd.pytha.pyox', + 'pyv' => 'video/vnd.ms-playready.media.pyv', + 'qam' => 'application/vnd.epson.quickanime', + 'qbo' => 'application/vnd.intu.qbo', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt' => 'video/quicktime', + 'qwd' => 'application/vnd.quark.quarkxpress', + 'qwt' => 'application/vnd.quark.quarkxpress', + 'qxb' => 'application/vnd.quark.quarkxpress', + 'qxd' => 'application/vnd.quark.quarkxpress', + 'qxl' => 'application/vnd.quark.quarkxpress', + 'qxt' => 'application/vnd.quark.quarkxpress', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'raml' => 'application/raml+yaml', + 'rapd' => 'application/route-apd+xml', + 'rar' => 'application/x-rar', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'relo' => 'application/p2p-overlay+xml', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'ris' => 'application/x-research-info-systems', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rng' => 'application/xml', + 'roa' => 'application/rpki-roa', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsa' => 'application/x-pkcs7', + 'rsat' => 'application/atsc-rsat+xml', + 'rsd' => 'application/rsd+xml', + 'rsheet' => 'application/urc-ressheet+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'run' => 'application/x-makeself', + 'rusd' => 'application/route-usd+xml', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sass' => 'text/x-sass', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scss' => 'text/x-scss', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdkm' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'sea' => 'application/octet-stream', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'senmlx' => 'application/senml+xml', + 'sensmlx' => 'application/sensml+xml', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sfv' => 'text/x-sfv', + 'sgi' => 'image/sgi', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shex' => 'text/shex', + 'shf' => 'application/shf+xml', + 'shtml' => 'text/html', + 'sid' => 'image/x-mrsid-image', + 'sieve' => 'application/sieve', + 'sig' => 'application/pgp-signature', + 'sil' => 'audio/silk', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'siv' => 'application/sieve', + 'skd' => 'application/vnd.koan', + 'skm' => 'application/vnd.koan', + 'skp' => 'application/vnd.koan', + 'skt' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slim' => 'text/slim', + 'slm' => 'text/slim', + 'sls' => 'application/route-s-tsid+xml', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'smv' => 'video/x-smv', + 'smzip' => 'application/vnd.stepmania.package', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spdx' => 'text/spdx', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'spx' => 'audio/ogg', + 'sql' => 'application/x-sql', + 'src' => 'application/x-wais-source', + 'srt' => 'application/x-subrip', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'ssdl' => 'application/ssdl+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'sst' => 'application/octet-stream', + 'st' => 'application/vnd.sailingtracker.track', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'step' => 'application/STEP', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'model/stl', + 'stp' => 'application/STEP', + 'stpx' => 'model/step+xml', + 'stpxz' => 'model/step-xml+zip', + 'stpz' => 'model/step+zip', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'styl' => 'text/stylus', + 'stylus' => 'text/stylus', + 'sub' => 'text/vnd.dvb.subtitle', + 'sus' => 'application/vnd.sus-calendar', + 'susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svc' => 'application/vnd.dvb.service', + 'svd' => 'application/vnd.svd', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swa' => 'application/x-director', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.aristanetworks.swi', + 'swidtag' => 'application/swid+xml', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 't' => 'text/troff', + 't3' => 'application/x-t3vm-image', + 't38' => 'image/t38', + 'taglet' => 'application/vnd.mynfc', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tap' => 'image/vnd.tencent.tap', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'td' => 'application/urc-targetdesc+xml', + 'teacher' => 'application/vnd.smart.teacher', + 'tei' => 'application/tei+xml', + 'teicorpus' => 'application/tei+xml', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tfi' => 'application/thraud+xml', + 'tfm' => 'application/x-tex-tfm', + 'tfx' => 'image/tiff-fx', + 'tga' => 'image/x-tga', + 'tgz' => 'application/x-tar', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tk' => 'application/x-tcl', + 'tmo' => 'application/vnd.tmobile-livetv', + 'toml' => 'application/toml', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trig' => 'application/trig', + 'trm' => 'application/x-msterminal', + 'ts' => 'video/mp2t', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', + 'ttl' => 'text/turtle', + 'ttml' => 'application/ttml+xml', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u3d' => 'model/u3d', + 'u8dsn' => 'message/global-delivery-status', + 'u8hdr' => 'message/global-headers', + 'u8mdn' => 'message/global-disposition-notification', + 'u8msg' => 'message/global', + 'u32' => 'application/x-authorware-bin', + 'ubj' => 'application/ubjson', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + 'ulx' => 'application/x-glulx', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uo' => 'application/vnd.uoml+xml', + 'uoml' => 'application/vnd.uoml+xml', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'urls' => 'text/uri-list', + 'usda' => 'model/vnd.usda', + 'usdz' => 'model/vnd.usdz+zip', + 'ustar' => 'application/x-ustar', + 'utz' => 'application/vnd.uiq.theme', + 'uu' => 'text/x-uuencode', + 'uva' => 'audio/vnd.dece.audio', + 'uvd' => 'application/vnd.dece.data', + 'uvf' => 'application/vnd.dece.data', + 'uvg' => 'image/vnd.dece.graphic', + 'uvh' => 'video/vnd.dece.hd', + 'uvi' => 'image/vnd.dece.graphic', + 'uvm' => 'video/vnd.dece.mobile', + 'uvp' => 'video/vnd.dece.pd', + 'uvs' => 'video/vnd.dece.sd', + 'uvt' => 'application/vnd.dece.ttml+xml', + 'uvu' => 'video/vnd.uvvu.mp4', + 'uvv' => 'video/vnd.dece.video', + 'uvva' => 'audio/vnd.dece.audio', + 'uvvd' => 'application/vnd.dece.data', + 'uvvf' => 'application/vnd.dece.data', + 'uvvg' => 'image/vnd.dece.graphic', + 'uvvh' => 'video/vnd.dece.hd', + 'uvvi' => 'image/vnd.dece.graphic', + 'uvvm' => 'video/vnd.dece.mobile', + 'uvvp' => 'video/vnd.dece.pd', + 'uvvs' => 'video/vnd.dece.sd', + 'uvvt' => 'application/vnd.dece.ttml+xml', + 'uvvu' => 'video/vnd.uvvu.mp4', + 'uvvv' => 'video/vnd.dece.video', + 'uvvx' => 'application/vnd.dece.unspecified', + 'uvvz' => 'application/vnd.dece.zip', + 'uvx' => 'application/vnd.dece.unspecified', + 'uvz' => 'application/vnd.dece.zip', + 'vbox' => 'application/x-virtualbox-vbox', + 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', + 'vcard' => 'text/vcard', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vdi' => 'application/x-virtualbox-vdi', + 'vds' => 'model/vnd.sap.vds', + 'vhd' => 'application/x-virtualbox-vhd', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vlc' => 'application/videolan', + 'vmdk' => 'application/x-virtualbox-vmdk', + 'vob' => 'video/x-ms-vob', + 'vor' => 'application/vnd.stardivision.writer', + 'vox' => 'application/x-authorware-bin', + 'vrml' => 'model/vrml', + 'vsd' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vtf' => 'image/vnd.valve.source.texture', + 'vtt' => 'text/vtt', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wadl' => 'application/vnd.sun.wadl+xml', + 'war' => 'application/java-archive', + 'wasm' => 'application/wasm', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wdp' => 'image/vnd.ms-photo', + 'weba' => 'audio/webm', + 'webapp' => 'application/x-web-app-manifest+json', + 'webm' => 'video/webm', + 'webmanifest' => 'application/manifest+json', + 'webp' => 'image/webp', + 'wg' => 'application/vnd.pmi.widget', + 'wgsl' => 'text/wgsl', + 'wgt' => 'application/widget', + 'wif' => 'application/watcherinfo+xml', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'image/wmf', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-msmetafile', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'word' => 'application/msword', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl' => 'model/vrml', + 'wsc' => 'message/vnd.wfa.wsc', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'model/x3d+xml', + 'x3db' => 'model/x3d+fastinfoset', + 'x3dbz' => 'model/x3d+binary', + 'x3dv' => 'model/x3d-vrml', + 'x3dvz' => 'model/x3d+vrml', + 'x3dz' => 'model/x3d+xml', + 'x32' => 'application/x-authorware-bin', + 'x_b' => 'model/vnd.parasolid.transmit.binary', + 'x_t' => 'model/vnd.parasolid.transmit.text', + 'xaml' => 'application/xaml+xml', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xav' => 'application/xcap-att+xml', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xca' => 'application/xcap-caps+xml', + 'xcs' => 'application/calendar+xml', + 'xdf' => 'application/xcap-diff+xml', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdssc' => 'application/dssc+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xel' => 'application/xcap-el+xml', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + 'xfdf' => 'application/xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xht' => 'application/xhtml+xml', + 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', + 'xhtml' => 'application/xhtml+xml', + 'xhvml' => 'application/xv+xml', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlc' => 'application/vnd.ms-excel', + 'xlf' => 'application/xliff+xml', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlt' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xlw' => 'application/vnd.ms-excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xns' => 'application/xcap-ns+xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpl' => 'application/xproc+xml', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw' => 'application/vnd.intercon.formnet', + 'xpx' => 'application/vnd.intercon.formnet', + 'xsd' => 'application/xml', + 'xsf' => 'application/prs.xsf+xml', + 'xsl' => 'application/xml', + 'xslt' => 'application/xslt+xml', + 'xsm' => 'application/vnd.syncml+xml', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xvm' => 'application/xv+xml', + 'xvml' => 'application/xv+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'xz' => 'application/x-xz', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'ymp' => 'text/x-suse-ymp', + 'z' => 'application/x-compress', + 'z1' => 'application/x-zmachine', + 'z2' => 'application/x-zmachine', + 'z3' => 'application/x-zmachine', + 'z4' => 'application/x-zmachine', + 'z5' => 'application/x-zmachine', + 'z6' => 'application/x-zmachine', + 'z7' => 'application/x-zmachine', + 'z8' => 'application/x-zmachine', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml', + 'zsh' => 'text/x-scriptzsh', + ]; + + /** + * Determines the mimetype of a file by looking at its extension. + * + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + */ + public static function fromFilename(string $filename): ?string + { + return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } + + /** + * Maps a file extensions to a mimetype. + * + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + */ + public static function fromExtension(string $extension): ?string + { + return self::MIME_TYPES[strtolower($extension)] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 0000000..43d718f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,165 @@ +boundary = $boundary ?: bin2hex(random_bytes(20)); + $this->stream = $this->createStream($elements); + } + + public function getBoundary(): string + { + return $this->boundary; + } + + public function isWritable(): bool + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + * + * @param string[] $headers + */ + private function getHeaders(array $headers): string + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n".trim($str)."\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements = []): StreamInterface + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + if (!is_array($element)) { + throw new \UnexpectedValueException('An array is expected'); + } + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element): void + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') { + $element['filename'] = $uri; + } + } + + [$body, $headers] = $this->createElement( + $element['name'], + $element['contents'], + $element['filename'] ?? null, + $element['headers'] ?? [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + /** + * @param string[] $headers + * + * @return array{0: StreamInterface, 1: string[]} + */ + private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array + { + // Set a default content-disposition header if one was no provided + $disposition = self::getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = self::getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = self::getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + $headers['Content-Type'] = MimeType::fromFilename($filename) ?? 'application/octet-stream'; + } + + return [$stream, $headers]; + } + + /** + * @param string[] $headers + */ + private static function getHeader(array $headers, string $key): ?string + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower((string) $k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 0000000..161a224 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,28 @@ +source = $source; + $this->size = $options['size'] ?? null; + $this->metadata = $options['metadata'] ?? []; + $this->buffer = new BufferStream(); + } + + public function __toString(): string + { + try { + return Utils::copyToString($this); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function close(): void + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = 0; + $this->source = null; + + return null; + } + + public function getSize(): ?int + { + return $this->size; + } + + public function tell(): int + { + return $this->tellPos; + } + + public function eof(): bool + { + return $this->source === null; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable(): bool + { + return false; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable(): bool + { + return true; + } + + public function read($length): string + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents(): string + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return $this->metadata[$key] ?? null; + } + + private function pump(int $length): void + { + if ($this->source !== null) { + do { + $data = ($this->source)($length); + if ($data === false || $data === null) { + $this->source = null; + + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 0000000..ccf867a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,118 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + */ + public static function parse(string $str, $urlEncoding = true): array + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', (string) $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!array_key_exists($key, $result)) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, + * PHP_QUERY_RFC3986 to encode using + * RFC3986, or PHP_QUERY_RFC1738 to + * encode using RFC1738. + * @param bool $treatBoolsAsInts Set to true to encode as 0/1, and + * false as false/true. + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = $treatBoolsAsInts ? static function ($v) { return (int) $v; } : static function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 0000000..faafe1a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,159 @@ +assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget(): string + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target === '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?'.$this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget): RequestInterface + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + + return $new; + } + + public function getMethod(): string + { + return $this->method; + } + + public function withMethod($method): RequestInterface + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + + return $new; + } + + public function getUri(): UriInterface + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri(): void + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':'.$port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: https://datatracker.ietf.org/doc/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + /** + * @param mixed $method + */ + private function assertMethod($method): void + { + if (!is_string($method) || $method === '') { + throw new InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 0000000..34e612f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,161 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase; + + /** @var int */ + private $statusCode; + + /** + * @param int $status Status code + * @param (string|string[])[] $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + int $status = 200, + array $headers = [], + $body = null, + string $version = '1.1', + ?string $reason = null + ) { + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::PHRASES[$this->statusCode])) { + $this->reasonPhrase = self::PHRASES[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode(): int + { + return $this->statusCode; + } + + public function getReasonPhrase(): string + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = ''): ResponseInterface + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) { + $reasonPhrase = self::PHRASES[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + + return $new; + } + + /** + * @param mixed $statusCode + */ + private function assertStatusCodeIsInteger($statusCode): void + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange(int $statusCode): void + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 0000000..8219dba --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,23 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 0000000..3cc9534 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,340 @@ +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files An array which respect $_FILES structure + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files): array + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return UploadedFileInterface|UploadedFileInterface[] + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []): array + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key] ?? null, + 'error' => $files['error'][$key] ?? null, + 'name' => $files['name'][$key] ?? null, + 'type' => $files['type'][$key] ?? null, + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + */ + public static function fromGlobals(): ServerRequestInterface + { + $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority(string $authority): array + { + $uri = 'http://'.$authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = $parts['host'] ?? null; + $port = $parts['port'] ?? null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + */ + public static function getUriFromGlobals(): UriInterface + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + public function getServerParams(): array + { + return $this->serverParams; + } + + public function getUploadedFiles(): array + { + return $this->uploadedFiles; + } + + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + public function getCookieParams(): array + { + return $this->cookieParams; + } + + public function withCookieParams(array $cookies): ServerRequestInterface + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + public function getQueryParams(): array + { + return $this->queryParams; + } + + public function withQueryParams(array $query): ServerRequestInterface + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * @return array|object|null + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + public function withParsedBody($data): ServerRequestInterface + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + /** + * @return mixed + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + public function withAttribute($attribute, $value): ServerRequestInterface + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + public function withoutAttribute($attribute): ServerRequestInterface + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 0000000..0aff9b2 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,283 @@ +size = $options['size']; + } + + $this->customMetadata = $options['metadata'] ?? []; + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool) preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool) preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function getContents(): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + + return Utils::tryGetContents($this->stream); + } + + public function close(): void + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize(): ?int + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (is_array($stats) && isset($stats['size'])) { + $this->size = $stats['size']; + + return $this->size; + } + + return null; + } + + public function isReadable(): bool + { + return $this->readable; + } + + public function isWritable(): bool + { + return $this->writable; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function eof(): bool + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell(): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + .$offset.' with whence '.var_export($whence, true)); + } + } + + public function read($length): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + try { + $string = fread($this->stream, $length); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to read from stream', 0, $e); + } + + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return $meta[$key] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 0000000..601c13a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,156 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @return StreamInterface + */ + public function __get(string $name) + { + if ($name === 'stream') { + $this->stream = $this->createStream(); + + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @return mixed + */ + public function __call(string $method, array $args) + { + /** @var callable $callable */ + $callable = [$this->stream, $method]; + $result = ($callable)(...$args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close(): void + { + $this->stream->close(); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize(): ?int + { + return $this->stream->getSize(); + } + + public function eof(): bool + { + return $this->stream->eof(); + } + + public function tell(): int + { + return $this->stream->tell(); + } + + public function isReadable(): bool + { + return $this->stream->isReadable(); + } + + public function isWritable(): bool + { + return $this->stream->isWritable(); + } + + public function isSeekable(): bool + { + return $this->stream->isSeekable(); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $this->stream->seek($offset, $whence); + } + + public function read($length): string + { + return $this->stream->read($length); + } + + public function write($string): int + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @throws \BadMethodCallException + */ + protected function createStream(): StreamInterface + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 0000000..77b04d7 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,207 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + .'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream], + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register(): void + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null): bool + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read(int $count): string + { + return $this->stream->read($count); + } + + public function stream_write(string $data): int + { + return $this->stream->write($data); + } + + public function stream_tell(): int + { + return $this->stream->tell(); + } + + public function stream_eof(): bool + { + return $this->stream->eof(); + } + + public function stream_seek(int $offset, int $whence): bool + { + $this->stream->seek($offset, $whence); + + return true; + } + + /** + * @return resource|false + */ + public function stream_cast(int $cast_as) + { + $stream = clone $this->stream; + $resource = $stream->detach(); + + return $resource ?? false; + } + + /** + * @return array{ + * dev: int, + * ino: int, + * mode: int, + * nlink: int, + * uid: int, + * gid: int, + * rdev: int, + * size: int, + * atime: int, + * mtime: int, + * ctime: int, + * blksize: int, + * blocks: int + * }|false + */ + public function stream_stat() + { + if ($this->stream->getSize() === null) { + return false; + } + + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188, + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0, + ]; + } + + /** + * @return array{ + * dev: int, + * ino: int, + * mode: int, + * nlink: int, + * uid: int, + * gid: int, + * rdev: int, + * size: int, + * atime: int, + * mtime: int, + * ctime: int, + * blksize: int, + * blocks: int + * } + */ + public function url_stat(string $path, int $flags): array + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0, + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 0000000..d9b779f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,211 @@ + 'UPLOAD_ERR_OK', + UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE', + UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE', + UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL', + UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE', + UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR', + UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE', + UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION', + ]; + + /** + * @var string|null + */ + private $clientFilename; + + /** + * @var string|null + */ + private $clientMediaType; + + /** + * @var int + */ + private $error; + + /** + * @var string|null + */ + private $file; + + /** + * @var bool + */ + private $moved = false; + + /** + * @var int|null + */ + private $size; + + /** + * @var StreamInterface|null + */ + private $stream; + + /** + * @param StreamInterface|string|resource $streamOrFile + */ + public function __construct( + $streamOrFile, + ?int $size, + int $errorStatus, + ?string $clientFilename = null, + ?string $clientMediaType = null + ) { + $this->setError($errorStatus); + $this->size = $size; + $this->clientFilename = $clientFilename; + $this->clientMediaType = $clientMediaType; + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param StreamInterface|string|resource $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile): void + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @throws InvalidArgumentException + */ + private function setError(int $error): void + { + if (!isset(UploadedFile::ERROR_MAP[$error])) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + private static function isStringNotEmpty($param): bool + { + return is_string($param) && false === empty($param); + } + + /** + * Return true if there is no upload error + */ + private function isOk(): bool + { + return $this->error === UPLOAD_ERR_OK; + } + + public function isMoved(): bool + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive(): void + { + if (false === $this->isOk()) { + throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error])); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + public function getStream(): StreamInterface + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + /** @var string $file */ + $file = $this->file; + + return new LazyOpenStream($file, 'r+'); + } + + public function moveTo($targetPath): void + { + $this->validateActive(); + + if (false === self::isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = PHP_SAPI === 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + public function getSize(): ?int + { + return $this->size; + } + + public function getError(): int + { + return $this->error; + } + + public function getClientFilename(): ?string + { + return $this->clientFilename; + } + + public function getClientMediaType(): ?string + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 0000000..a7cdfb0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,743 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + /** + * Unreserved characters for use in a regex. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.3 + */ + private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; + + /** + * Sub-delims for use in a regex. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 + */ + private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** @var string|null String representation */ + private $composedComponents; + + public function __construct(string $uri = '') + { + if ($uri !== '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new MalformedUriException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @return array|false + */ + private static function parse(string $url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) { + /** @var array{0:string, 1:string, 2:string} $matches */ + $prefix = $matches[1]; + $url = $matches[2]; + } + + /** @var string */ + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix.$encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString(): string + { + if ($this->composedComponents === null) { + $this->composedComponents = self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + return $this->composedComponents; + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.3 + */ + public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme.':'; + } + + if ($authority != '' || $scheme === 'file') { + $uri .= '//'.$authority; + } + + if ($authority != '' && $path != '' && $path[0] != '/') { + $path = '/'.$path; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?'.$query; + } + + if ($fragment != '') { + $uri .= '#'.$fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + */ + public static function isDefaultPort(UriInterface $uri): bool + { + return $uri->getPort() === null + || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri): bool + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + */ + public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + */ + public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param (string|null)[] $keyValueArray Associative array of key and values + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @see https://www.php.net/manual/en/function.parse-url.php + * + * @throws MalformedUriException If the components do not form a valid URI. + */ + public static function fromParts(array $parts): UriInterface + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme(): string + { + return $this->scheme; + } + + public function getAuthority(): string + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo.'@'.$authority; + } + + if ($this->port !== null) { + $authority .= ':'.$this->port; + } + + return $authority; + } + + public function getUserInfo(): string + { + return $this->userInfo; + } + + public function getHost(): string + { + return $this->host; + } + + public function getPort(): ?int + { + return $this->port; + } + + public function getPath(): string + { + return $this->path; + } + + public function getQuery(): string + { + return $this->query; + } + + public function getFragment(): string + { + return $this->fragment; + } + + public function withScheme($scheme): UriInterface + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null): UriInterface + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':'.$this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withHost($host): UriInterface + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withPort($port): UriInterface + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path): UriInterface + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withQuery($query): UriInterface + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + $new->composedComponents = null; + + return $new; + } + + public function withFragment($fragment): UriInterface + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + $new->composedComponents = null; + + return $new; + } + + public function jsonSerialize(): string + { + return $this->__toString(); + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts): void + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':'.$this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param mixed $scheme + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme): string + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $component + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component): string + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param mixed $host + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host): string + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $port + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port): ?int + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xFFFF < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param (string|int)[] $keys + * + * @return string[] + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys): array + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map(function ($k): string { + return rawurldecode((string) $k); + }, $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + private static function generateQueryString(string $key, ?string $value): string + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); + + if ($value !== null) { + $queryString .= '='.strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); + } + + return $queryString; + } + + private function removeDefaultPort(): void + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param mixed $path + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path): string + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param mixed $str + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str): string + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match): string + { + return rawurlencode($match[0]); + } + + private function validateState(): void + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriComparator.php b/vendor/guzzlehttp/psr7/src/UriComparator.php new file mode 100644 index 0000000..70c582a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriComparator.php @@ -0,0 +1,52 @@ +getHost(), $modified->getHost()) !== 0) { + return true; + } + + if ($original->getScheme() !== $modified->getScheme()) { + return true; + } + + if (self::computePort($original) !== self::computePort($modified)) { + return true; + } + + return false; + } + + private static function computePort(UriInterface $uri): int + { + $port = $uri->getPort(); + + if (null !== $port) { + return $port; + } + + return 'https' === $uri->getScheme() ? 443 : 80; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 0000000..e174557 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,220 @@ +getPath() === '' + && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri): UriInterface + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match): string { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match): string { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 0000000..3737be1 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,211 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/'.$rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + */ + public static function relativize(UriInterface $base, UriInterface $target): UriInterface + { + if ($target->getScheme() !== '' + && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + /** @var string $lastSegment */ + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target): string + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 0000000..5451e3d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,477 @@ + $v) { + if (!in_array(strtolower((string) $k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, int $maxLen = -1): string + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + if ($buf === '') { + break; + } + $buffer .= $buf; + } + + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + if ($buf === '') { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + */ + public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':'.$port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + */ + public static function readLine(StreamInterface $stream, ?int $maxLength = null): string + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + if ('' === ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Redact the password in the user info part of a URI. + */ + public static function redactUserInfo(UriInterface $uri): UriInterface + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = \strpos($userInfo, ':'))) { + return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array{size?: int, metadata?: array} $options Additional options + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []): StreamInterface + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, (string) $resource); + fseek($stream, 0); + } + + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + + /** @var resource $resource */ + if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + stream_copy_to_stream($resource, $stream); + fseek($stream, 0); + $resource = $stream; + } + + return new Stream($resource, $options); + case 'object': + /** @var object $resource */ + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return self::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen(string $filename, string $mode) + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $errstr + )); + + return true; + }); + + try { + /** @var resource $handle */ + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var \RuntimeException $ex */ + throw $ex; + } + + return $handle; + } + + /** + * Safely gets the contents of a given stream. + * + * When stream_get_contents fails, PHP normally raises a warning. This + * function adds an error handler that checks for errors and throws an + * exception instead. + * + * @param resource $stream + * + * @throws \RuntimeException if the stream cannot be read + */ + public static function tryGetContents($stream): string + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use (&$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $errstr + )); + + return true; + }); + + try { + /** @var string|false $contents */ + $contents = stream_get_contents($stream); + + if ($contents === false) { + $ex = new \RuntimeException('Unable to read stream contents'); + } + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var \RuntimeException $ex */ + throw $ex; + } + + return $contents; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri): UriInterface + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md new file mode 100644 index 0000000..58ddab0 --- /dev/null +++ b/vendor/psr/cache/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.1 - 2016-08-06 + +### Fixed + +- Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr +- Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr +- Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell +- For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell + +## 1.0.0 - 2015-12-11 + +Initial stable release; reflects accepted PSR-6 specification diff --git a/vendor/psr/cache/LICENSE.txt b/vendor/psr/cache/LICENSE.txt new file mode 100644 index 0000000..b1c2c97 --- /dev/null +++ b/vendor/psr/cache/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2015 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/cache/README.md b/vendor/psr/cache/README.md new file mode 100644 index 0000000..9855a31 --- /dev/null +++ b/vendor/psr/cache/README.md @@ -0,0 +1,12 @@ +Caching Interface +============== + +This repository holds all interfaces related to [PSR-6 (Caching Interface)][psr-url]. + +Note that this is not a Caching implementation of its own. It is merely interfaces that describe the components of a Caching mechanism. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-6/ +[package-url]: https://packagist.org/packages/psr/cache +[implementation-url]: https://packagist.org/providers/psr/cache-implementation diff --git a/vendor/psr/cache/composer.json b/vendor/psr/cache/composer.json new file mode 100644 index 0000000..4b68797 --- /dev/null +++ b/vendor/psr/cache/composer.json @@ -0,0 +1,25 @@ +{ + "name": "psr/cache", + "description": "Common interface for caching libraries", + "keywords": ["psr", "psr-6", "cache"], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": ">=8.0.0" + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php new file mode 100644 index 0000000..bb785f4 --- /dev/null +++ b/vendor/psr/cache/src/CacheException.php @@ -0,0 +1,10 @@ +=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-factory/src/RequestFactoryInterface.php b/vendor/psr/http-factory/src/RequestFactoryInterface.php new file mode 100644 index 0000000..cb39a08 --- /dev/null +++ b/vendor/psr/http-factory/src/RequestFactoryInterface.php @@ -0,0 +1,18 @@ + `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + diff --git a/vendor/psr/http-message/docs/PSR7-Usage.md b/vendor/psr/http-message/docs/PSR7-Usage.md new file mode 100644 index 0000000..b6d048a --- /dev/null +++ b/vendor/psr/http-message/docs/PSR7-Usage.md @@ -0,0 +1,159 @@ +### PSR-7 Usage + +All PSR-7 applications comply with these interfaces +They were created to establish a standard between middleware implementations. + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + + +The following examples will illustrate how basic operations are done in PSR-7. + +##### Examples + + +For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) +All PSR-7 implementations should have the same behaviour. + +The following will be assumed: +`$request` is an object of `Psr\Http\Message\RequestInterface` and + +`$response` is an object implementing `Psr\Http\Message\RequestInterface` + + +### Working with HTTP Headers + +#### Adding headers to response: + +```php +$response->withHeader('My-Custom-Header', 'My Custom Message'); +``` + +#### Appending values to headers + +```php +$response->withAddedHeader('My-Custom-Header', 'The second message'); +``` + +#### Checking if header exists: + +```php +$request->hasHeader('My-Custom-Header'); // will return false +$response->hasHeader('My-Custom-Header'); // will return true +``` + +> Note: My-Custom-Header was only added in the Response + +#### Getting comma-separated values from a header (also applies to request) + +```php +// getting value from request headers +$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" +// getting value from response headers +$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" +``` + +#### Getting array of value from a header (also applies to request) +```php +// getting value from request headers +$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] +// getting value from response headers +$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] +``` + +#### Removing headers from HTTP Messages +```php +// removing a header from Request, removing deprecated "Content-MD5" header +$request->withoutHeader('Content-MD5'); + +// removing a header from Response +// effect: the browser won't know the size of the stream +// the browser will download the stream till it ends +$response->withoutHeader('Content-Length'); +``` + +### Working with HTTP Message Body + +When working with the PSR-7 there are two methods of implementation: +#### 1. Getting the body separately + +> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. + +```php +$body = $response->getBody(); +// operations on body, eg. read, write, seek +// ... +// replacing the old body +$response->withBody($body); +// this last statement is optional as we working with objects +// in this case the "new" body is same with the "old" one +// the $body variable has the same value as the one in $request, only the reference is passed +``` + +#### 2. Working directly on response + +> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required + +```php +$response->getBody()->write('hello'); +``` + +### Getting the body contents + +The following snippet gets the contents of a stream contents. +> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. +```php +$body = $response->getBody(); +$body->rewind(); // or $body->seek(0); +$bodyText = $body->getContents(); +``` +> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. + +### Append to body + +```php +$response->getBody()->write('Hello'); // writing directly +$body = $request->getBody(); // which is a `StreamInterface` +$body->write('xxxxx'); +``` + +### Prepend to body +Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. +The following example will explain the behaviour of streams. + +```php +// assuming our response is initially empty +$body = $repsonse->getBody(); +// writing the string "abcd" +$body->write('abcd'); + +// seeking to start of stream +$body->seek(0); +// writing 'ef' +$body->write('ef'); // at this point the stream contains "efcd" +``` + +#### Prepending by rewriting separately + +```php +// assuming our response body stream only contains: "abcd" +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // abcd +// seeking the stream to beginning +$body->rewind(); +$body->write('ef'); // stream contains "efcd" +$body->write($contents); // stream contains "efabcd" +``` + +> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. + +#### Prepending by using contents as a string +```php +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // efabcd +$contents = 'ef'.$contents; +$body->rewind(); +$body->write($contents); +``` diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 0000000..a83c985 --- /dev/null +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(): array; + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader(string $name): bool; + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader(string $name): array; + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine(string $name): string; + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader(string $name, $value): MessageInterface; + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader(string $name, $value): MessageInterface; + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader(string $name): MessageInterface; + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(): StreamInterface; + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body): MessageInterface; +} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 0000000..33f85e5 --- /dev/null +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,130 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(): array; + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query): ServerRequestInterface; + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(): array; + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface; + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data): ServerRequestInterface; + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(): array; + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute(string $name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute(string $name, $value): ServerRequestInterface; + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute(string $name): ServerRequestInterface; +} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 0000000..a62aabb --- /dev/null +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(): string; + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(): string; + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(): string; + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(): ?int; + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(): string; + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(): string; + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(): string; + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme(string $scheme): UriInterface; + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo(string $user, ?string $password = null): UriInterface; + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost(string $host): UriInterface; + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort(?int $port): UriInterface; + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath(string $path): UriInterface; + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery(string $query): UriInterface; + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment(string $fragment): UriInterface; + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(): string; +} diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE new file mode 100644 index 0000000..474c952 --- /dev/null +++ b/vendor/psr/log/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md new file mode 100644 index 0000000..a9f20c4 --- /dev/null +++ b/vendor/psr/log/README.md @@ -0,0 +1,58 @@ +PSR Log +======= + +This repository holds all interfaces/classes/traits related to +[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). + +Note that this is not a logger of its own. It is merely an interface that +describes a logger. See the specification for more details. + +Installation +------------ + +```bash +composer require psr/log +``` + +Usage +----- + +If you need a logger, you can use the interface like this: + +```php +logger = $logger; + } + + public function doSomething() + { + if ($this->logger) { + $this->logger->info('Doing work'); + } + + try { + $this->doSomethingElse(); + } catch (Exception $exception) { + $this->logger->error('Oh no!', array('exception' => $exception)); + } + + // do something useful + } +} +``` + +You can then pick one of the implementations of the interface to get a logger. + +If you want to implement the interface, you can require this package and +implement `Psr\Log\LoggerInterface` in your code. Please read the +[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) +for details. diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json new file mode 100644 index 0000000..879fc6f --- /dev/null +++ b/vendor/psr/log/composer.json @@ -0,0 +1,26 @@ +{ + "name": "psr/log", + "description": "Common interface for logging libraries", + "keywords": ["psr", "psr-3", "log"], + "homepage": "https://github.com/php-fig/log", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": ">=8.0.0" + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php new file mode 100644 index 0000000..d60a091 --- /dev/null +++ b/vendor/psr/log/src/AbstractLogger.php @@ -0,0 +1,15 @@ +logger = $logger; + } +} diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php new file mode 100644 index 0000000..cb4cf64 --- /dev/null +++ b/vendor/psr/log/src/LoggerInterface.php @@ -0,0 +1,98 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + */ + public function alert(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + */ + public function critical(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + */ + public function error(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + */ + public function warning(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + */ + public function notice(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + */ + public function info(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + */ + public function debug(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * + * @throws \Psr\Log\InvalidArgumentException + */ + abstract public function log($level, string|\Stringable $message, array $context = []): void; +} diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php new file mode 100644 index 0000000..de0561e --- /dev/null +++ b/vendor/psr/log/src/NullLogger.php @@ -0,0 +1,26 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed[] $context + * + * @throws \Psr\Log\InvalidArgumentException + */ + public function log($level, string|\Stringable $message, array $context = []): void + { + // noop + } +} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 0000000..be5540c --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 0000000..9430d76 --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 0000000..de8ce62 --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 0000000..c7285a5 --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/vendor/ramsey/collection/LICENSE b/vendor/ramsey/collection/LICENSE new file mode 100644 index 0000000..a7fcf12 --- /dev/null +++ b/vendor/ramsey/collection/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2022 Ben Ramsey + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/ramsey/collection/README.md b/vendor/ramsey/collection/README.md new file mode 100644 index 0000000..aacf940 --- /dev/null +++ b/vendor/ramsey/collection/README.md @@ -0,0 +1,59 @@ +

ramsey/collection

+ +

+ A PHP library for representing and manipulating collections. +

+ +

+ Source Code + Download Package + PHP Programming Language + Read License + Build Status + Codecov Code Coverage +

+ +## About + +ramsey/collection is a PHP library for representing and manipulating collections. + +Much inspiration for this library came from the [Java Collections Framework][java]. + +This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). +By participating in this project and its community, you are expected to +uphold this code. + +## Installation + +Install this package as a dependency using [Composer](https://getcomposer.org). + +``` bash +composer require ramsey/collection +``` + +## Usage + +Examples of how to use this library may be found in the +[Wiki pages](https://github.com/ramsey/collection/wiki/Examples). + +## Contributing + +Contributions are welcome! To contribute, please familiarize yourself with +[CONTRIBUTING.md](CONTRIBUTING.md). + +## Coordinated Disclosure + +Keeping user information safe and secure is a top priority, and we welcome the +contribution of external security researchers. If you believe you've found a +security issue in software that is maintained in this repository, please read +[SECURITY.md][] for instructions on submitting a vulnerability report. + +## Copyright and License + +The ramsey/collection library is copyright © [Ben Ramsey](https://benramsey.com) +and licensed for use under the terms of the +MIT License (MIT). Please see [LICENSE](LICENSE) for more information. + + +[java]: http://docs.oracle.com/javase/8/docs/technotes/guides/collections/index.html +[security.md]: https://github.com/ramsey/collection/blob/main/SECURITY.md diff --git a/vendor/ramsey/collection/SECURITY.md b/vendor/ramsey/collection/SECURITY.md new file mode 100644 index 0000000..3de4c0c --- /dev/null +++ b/vendor/ramsey/collection/SECURITY.md @@ -0,0 +1,169 @@ + + +# Vulnerability Disclosure Policy (VDP) + +## Brand Promise + + + +Keeping user information safe and secure is a top priority, and we welcome the +contribution of external security researchers. + +## Scope + + + +If you believe you've found a security issue in software that is maintained in +this repository, we encourage you to notify us. + +| Version | In scope | Source code | +| ------- | :------: | ----------- | +| latest | ✅ | https://github.com/ramsey/collection | + +## How to Submit a Report + + + +To submit a vulnerability report, please contact us at security@ramsey.dev. +Your submission will be reviewed and validated by a member of our team. + +## Safe Harbor + + + +We support safe harbor for security researchers who: + +* Make a good faith effort to avoid privacy violations, destruction of data, and + interruption or degradation of our services. +* Only interact with accounts you own or with explicit permission of the account + holder. If you do encounter Personally Identifiable Information (PII) contact + us immediately, do not proceed with access, and immediately purge any local + information. +* Provide us with a reasonable amount of time to resolve vulnerabilities prior + to any disclosure to the public or a third party. + +We will consider activities conducted consistent with this policy to constitute +"authorized" conduct and will not pursue civil action or initiate a complaint to +law enforcement. We will help to the extent we can if legal action is initiated +by a third party against you. + +Please submit a report to us before engaging in conduct that may be inconsistent +with or unaddressed by this policy. + +## Preferences + + + +* Please provide detailed reports with reproducible steps and a clearly defined + impact. +* Include the version number of the vulnerable package in your report +* Social engineering (e.g. phishing, vishing, smishing) is prohibited. + + + +## Encryption Key for security@ramsey.dev + +For increased privacy when reporting sensitive issues, you may encrypt your +message using the following public key: + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBF+Z9gEBEACbT/pIx8RR0K18t8Z2rDnmEV44YdT7HNsMdq+D6SAlx8UUb6AU +jGIbV9dgBgGNtOLU1pxloaJwL9bWIRbj+X/Qb2WNIP//Vz1Y40ox1dSpfCUrizXx +kb4p58Xml0PsB8dg3b4RDUgKwGC37ne5xmDnigyJPbiB2XJ6Xc46oPCjh86XROTK +wEBB2lY67ClBlSlvC2V9KmbTboRQkLdQDhOaUosMb99zRb0EWqDLaFkZVjY5HI7i +0pTveE6dI12NfHhTwKjZ5pUiAZQGlKA6J1dMjY2unxHZkQj5MlMfrLSyJHZxccdJ +xD94T6OTcTHt/XmMpI2AObpewZDdChDQmcYDZXGfAhFoJmbvXsmLMGXKgzKoZ/ls +RmLsQhh7+/r8E+Pn5r+A6Hh4uAc14ApyEP0ckKeIXw1C6pepHM4E8TEXVr/IA6K/ +z6jlHORixIFX7iNOnfHh+qwOgZw40D6JnBfEzjFi+T2Cy+JzN2uy7I8UnecTMGo3 +5t6astPy6xcH6kZYzFTV7XERR6LIIVyLAiMFd8kF5MbJ8N5ElRFsFHPW+82N2HDX +c60iSaTB85k6R6xd8JIKDiaKE4sSuw2wHFCKq33d/GamYezp1wO+bVUQg88efljC +2JNFyD+vl30josqhw1HcmbE1TP3DlYeIL5jQOlxCMsgai6JtTfHFM/5MYwARAQAB +tBNzZWN1cml0eUByYW1zZXkuZGV2iQJUBBMBCAA+FiEE4drPD+/ofZ570fAYq0bv +vXQCywIFAl+Z9gECGwMFCQeGH4AFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ +q0bvvXQCywIkEA//Qcwv8MtTCy01LHZd9c7VslwhNdXQDYymcTyjcYw8x7O22m4B +3hXE6vqAplFhVxxkqXB2ef0tQuzxhPHNJgkCE4Wq4i+V6qGpaSVHQT2W6DN/NIhL +vS8OdScc6zddmIbIkSrzVVAtjwehFNEIrX3DnbbbK+Iku7vsKT5EclOluIsjlYoX +goW8IeReyDBqOe2H3hoCGw6EA0D/NYV2bJnfy53rXVIyarsXXeOLp7eNEH6Td7aW +PVSrMZJe1t+knrEGnEdrXWzlg4lCJJCtemGv+pKBUomnyISXSdqyoRCCzvQjqyig +2kRebUX8BXPW33p4OXPj9sIboUOjZwormWwqqbFMO+J4TiVCUoEoheI7emPFRcNN +QtPJrjbY1++OznBc0GRpfeUkGoU1cbRl1bnepnFIZMTDLkrVW6I1Y4q8ZVwX3BkE +N81ctFrRpHBlU36EdHvjPQmGtuiL77Qq3fWmMv7yTvK1wHJAXfEb0ZJWHZCbck3w +l0CVq0Z+UUAOM8Rp1N0N8m92xtapav0qCFU9qzf2J5qX6GRmWv+d29wPgFHzDWBm +nnrYYIA4wJLx00U6SMcVBSnNe91B+RfGY5XQhbWPjQQecOGCSDsxaFAq2MeOVJyZ +bIjLYfG9GxoLKr5R7oLRJvZI4nKKBc1Kci/crZbdiSdQhSQGlDz88F1OHeCIdQQQ +EQgAHRYhBOhdAxHd+lus86YQ57Atl5icjAcbBQJfmfdIAAoJELAtl5icjAcbFVcA +/1LqB3ZjsnXDAvvAXZVjSPqofSlpMLeRQP6IM/A9Odq0AQCZrtZc1knOMGEcjppK +Rk+sy/R0Mshy8TDuaZIRgh2Ux7kCDQRfmfYBARAAmchKzzVz7IaEq7PnZDb3szQs +T/+E9F3m39yOpV4fEB1YzObonFakXNT7Gw2tZEx0eitUMqQ/13jjfu3UdzlKl2bR +qA8LrSQRhB+PTC9A1XvwxCUYhhjGiLzJ9CZL6hBQB43qHOmE9XJPme90geLsF+gK +u39Waj1SNWzwGg+Gy1Gl5f2AJoDTxznreCuFGj+Vfaczt/hlfgqpOdb9jsmdoE7t +3DSWppA9dRHWwQSgE6J28rR4QySBcqyXS6IMykqaJn7Z26yNIaITLnHCZOSY8zhP +ha7GFsN549EOCgECbrnPt9dmI2+hQE0RO0e7SOBNsIf5sz/i7urhwuj0CbOqhjc2 +X1AEVNFCVcb6HPi/AWefdFCRu0gaWQxn5g+9nkq5slEgvzCCiKYzaBIcr8qR6Hb4 +FaOPVPxO8vndRouq57Ws8XpAwbPttioFuCqF4u9K+tK/8e2/R8QgRYJsE3Cz/Fu8 ++pZFpMnqbDEbK3DL3ss+1ed1sky+mDV8qXXeI33XW5hMFnk1JWshUjHNlQmE6ftC +U0xSTMVUtwJhzH2zDp8lEdu7qi3EsNULOl68ozDr6soWAvCbHPeTdTOnFySGCleG +/3TonsoZJs/sSPPJnxFQ1DtgQL6EbhIwa0ZwU4eKYVHZ9tjxuMX3teFzRvOrJjgs ++ywGlsIURtEckT5Y6nMAEQEAAYkCPAQYAQgAJhYhBOHazw/v6H2ee9HwGKtG7710 +AssCBQJfmfYBAhsMBQkHhh+AAAoJEKtG7710AssC8NcP/iDAcy1aZFvkA0EbZ85p +i7/+ywtE/1wF4U4/9OuLcoskqGGnl1pJNPooMOSBCfreoTB8HimT0Fln0CoaOm4Q +pScNq39JXmf4VxauqUJVARByP6zUfgYarqoaZNeuFF0S4AZJ2HhGzaQPjDz1uKVM +PE6tQSgQkFzdZ9AtRA4vElTH6yRAgmepUsOihk0b0gUtVnwtRYZ8e0Qt3ie97a73 +DxLgAgedFRUbLRYiT0vNaYbainBsLWKpN/T8odwIg/smP0Khjp/ckV60cZTdBiPR +szBTPJESMUTu0VPntc4gWwGsmhZJg/Tt/qP08XYo3VxNYBegyuWwNR66zDWvwvGH +muMv5UchuDxp6Rt3JkIO4voMT1JSjWy9p8krkPEE4V6PxAagLjdZSkt92wVLiK5x +y5gNrtPhU45YdRAKHr36OvJBJQ42CDaZ6nzrzghcIp9CZ7ANHrI+QLRM/csz+AGA +szSp6S4mc1lnxxfbOhPPpebZPn0nIAXoZnnoVKdrxBVedPQHT59ZFvKTQ9Fs7gd3 +sYNuc7tJGFGC2CxBH4ANDpOQkc5q9JJ1HSGrXU3juxIiRgfA26Q22S9c71dXjElw +Ri584QH+bL6kkYmm8xpKF6TVwhwu5xx/jBPrbWqFrtbvLNrnfPoapTihBfdIhkT6 +nmgawbBHA02D5xEqB5SU3WJu +=eJNx +-----END PGP PUBLIC KEY BLOCK----- +``` diff --git a/vendor/ramsey/collection/composer.json b/vendor/ramsey/collection/composer.json new file mode 100644 index 0000000..42fc22b --- /dev/null +++ b/vendor/ramsey/collection/composer.json @@ -0,0 +1,108 @@ +{ + "name": "ramsey/collection", + "description": "A PHP library for representing and manipulating collections.", + "license": "MIT", + "type": "library", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "prefer-stable": true, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Ramsey\\Collection\\Test\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "captainhook/plugin-composer": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true + }, + "sort-packages": true + }, + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "scripts": { + "dev:analyze": [ + "@dev:analyze:phpstan" + ], + "dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit=1G", + "dev:build:clean": "git clean -fX build/", + "dev:lint": [ + "@dev:lint:syntax", + "@dev:lint:style" + ], + "dev:lint:fix": "phpcbf", + "dev:lint:style": "phpcs --colors", + "dev:lint:syntax": "parallel-lint --colors src/ tests/", + "dev:test": [ + "@dev:lint", + "@dev:analyze", + "@dev:test:unit" + ], + "dev:test:coverage:ci": "phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml", + "dev:test:coverage:html": "phpunit --colors=always --coverage-html build/coverage/coverage-html/", + "dev:test:unit": "phpunit --colors=always", + "test": "@dev:test" + }, + "scripts-descriptions": { + "dev:analyze": "Runs all static analysis checks.", + "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", + "dev:build:clean": "Cleans the build/ directory.", + "dev:lint": "Runs all linting checks.", + "dev:lint:fix": "Auto-fixes coding standards issues, if possible.", + "dev:lint:style": "Checks for coding standards issues.", + "dev:lint:syntax": "Checks for syntax errors.", + "dev:test": "Runs linting, static analysis, and unit tests.", + "dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.", + "dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.", + "dev:test:unit": "Runs unit tests.", + "test": "Runs linting, static analysis, and unit tests." + } +} diff --git a/vendor/ramsey/collection/src/AbstractArray.php b/vendor/ramsey/collection/src/AbstractArray.php new file mode 100644 index 0000000..6d6b6d6 --- /dev/null +++ b/vendor/ramsey/collection/src/AbstractArray.php @@ -0,0 +1,171 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use ArrayIterator; +use Traversable; + +use function count; + +/** + * This class provides a basic implementation of `ArrayInterface`, to minimize + * the effort required to implement this interface. + * + * @template T + * @implements ArrayInterface + */ +abstract class AbstractArray implements ArrayInterface +{ + /** + * The items of this array. + * + * @var array + */ + protected array $data = []; + + /** + * Constructs a new array object. + * + * @param array $data The initial items to add to this array. + */ + public function __construct(array $data = []) + { + // Invoke offsetSet() for each value added; in this way, subclasses + // may provide additional logic about values added to the array object. + foreach ($data as $key => $value) { + $this[$key] = $value; + } + } + + /** + * Returns an iterator for this array. + * + * @link http://php.net/manual/en/iteratoraggregate.getiterator.php IteratorAggregate::getIterator() + * + * @return Traversable + */ + public function getIterator(): Traversable + { + return new ArrayIterator($this->data); + } + + /** + * Returns `true` if the given offset exists in this array. + * + * @link http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetExists() + * + * @param array-key $offset The offset to check. + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->data[$offset]); + } + + /** + * Returns the value at the specified offset. + * + * @link http://php.net/manual/en/arrayaccess.offsetget.php ArrayAccess::offsetGet() + * + * @param array-key $offset The offset for which a value should be returned. + * + * @return T the value stored at the offset, or null if the offset + * does not exist. + */ + public function offsetGet(mixed $offset): mixed + { + return $this->data[$offset]; + } + + /** + * Sets the given value to the given offset in the array. + * + * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() + * + * @param array-key | null $offset The offset to set. If `null`, the value + * may be set at a numerically-indexed offset. + * @param T $value The value to set at the given offset. + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if ($offset === null) { + $this->data[] = $value; + } else { + $this->data[$offset] = $value; + } + } + + /** + * Removes the given offset and its value from the array. + * + * @link http://php.net/manual/en/arrayaccess.offsetunset.php ArrayAccess::offsetUnset() + * + * @param array-key $offset The offset to remove from the array. + */ + public function offsetUnset(mixed $offset): void + { + unset($this->data[$offset]); + } + + /** + * Returns data suitable for PHP serialization. + * + * @link https://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.serialize + * @link https://www.php.net/serialize + * + * @return array + */ + public function __serialize(): array + { + return $this->data; + } + + /** + * Adds unserialized data to the object. + * + * @param array $data + */ + public function __unserialize(array $data): void + { + $this->data = $data; + } + + /** + * Returns the number of items in this array. + * + * @link http://php.net/manual/en/countable.count.php Countable::count() + */ + public function count(): int + { + return count($this->data); + } + + public function clear(): void + { + $this->data = []; + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return $this->data; + } + + public function isEmpty(): bool + { + return $this->data === []; + } +} diff --git a/vendor/ramsey/collection/src/AbstractCollection.php b/vendor/ramsey/collection/src/AbstractCollection.php new file mode 100644 index 0000000..2f006b9 --- /dev/null +++ b/vendor/ramsey/collection/src/AbstractCollection.php @@ -0,0 +1,365 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Closure; +use Ramsey\Collection\Exception\CollectionMismatchException; +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\NoSuchElementException; +use Ramsey\Collection\Exception\UnsupportedOperationException; +use Ramsey\Collection\Tool\TypeTrait; +use Ramsey\Collection\Tool\ValueExtractorTrait; +use Ramsey\Collection\Tool\ValueToStringTrait; + +use function array_filter; +use function array_key_first; +use function array_key_last; +use function array_map; +use function array_merge; +use function array_reduce; +use function array_search; +use function array_udiff; +use function array_uintersect; +use function in_array; +use function is_int; +use function is_object; +use function spl_object_id; +use function sprintf; +use function usort; + +/** + * This class provides a basic implementation of `CollectionInterface`, to + * minimize the effort required to implement this interface + * + * @template T + * @extends AbstractArray + * @implements CollectionInterface + */ +abstract class AbstractCollection extends AbstractArray implements CollectionInterface +{ + use TypeTrait; + use ValueToStringTrait; + use ValueExtractorTrait; + + /** + * @throws InvalidArgumentException if $element is of the wrong type. + */ + public function add(mixed $element): bool + { + $this[] = $element; + + return true; + } + + public function contains(mixed $element, bool $strict = true): bool + { + return in_array($element, $this->data, $strict); + } + + /** + * @throws InvalidArgumentException if $element is of the wrong type. + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if ($this->checkType($this->getType(), $value) === false) { + throw new InvalidArgumentException( + 'Value must be of type ' . $this->getType() . '; value is ' + . $this->toolValueToString($value), + ); + } + + if ($offset === null) { + $this->data[] = $value; + } else { + $this->data[$offset] = $value; + } + } + + public function remove(mixed $element): bool + { + if (($position = array_search($element, $this->data, true)) !== false) { + unset($this[$position]); + + return true; + } + + return false; + } + + /** + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call column() on this + * collection. + * + * @inheritDoc + */ + public function column(string $propertyOrMethod): array + { + $temp = []; + + foreach ($this->data as $item) { + $temp[] = $this->extractValue($item, $propertyOrMethod); + } + + return $temp; + } + + /** + * @return T + * + * @throws NoSuchElementException if this collection is empty. + */ + public function first(): mixed + { + $firstIndex = array_key_first($this->data); + + if ($firstIndex === null) { + throw new NoSuchElementException('Can\'t determine first item. Collection is empty'); + } + + return $this->data[$firstIndex]; + } + + /** + * @return T + * + * @throws NoSuchElementException if this collection is empty. + */ + public function last(): mixed + { + $lastIndex = array_key_last($this->data); + + if ($lastIndex === null) { + throw new NoSuchElementException('Can\'t determine last item. Collection is empty'); + } + + return $this->data[$lastIndex]; + } + + /** + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call sort() on this + * collection. + */ + public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): CollectionInterface + { + $collection = clone $this; + + usort( + $collection->data, + function (mixed $a, mixed $b) use ($propertyOrMethod, $order): int { + $aValue = $this->extractValue($a, $propertyOrMethod); + $bValue = $this->extractValue($b, $propertyOrMethod); + + return ($aValue <=> $bValue) * ($order === Sort::Descending ? -1 : 1); + }, + ); + + return $collection; + } + + /** + * @param callable(T): bool $callback A callable to use for filtering elements. + * + * @return CollectionInterface + */ + public function filter(callable $callback): CollectionInterface + { + $collection = clone $this; + $collection->data = array_merge([], array_filter($collection->data, $callback)); + + return $collection; + } + + /** + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call where() on this + * collection. + */ + public function where(?string $propertyOrMethod, mixed $value): CollectionInterface + { + return $this->filter( + fn (mixed $item): bool => $this->extractValue($item, $propertyOrMethod) === $value, + ); + } + + /** + * @param callable(T): TCallbackReturn $callback A callable to apply to each + * item of the collection. + * + * @return CollectionInterface + * + * @template TCallbackReturn + */ + public function map(callable $callback): CollectionInterface + { + return new Collection('mixed', array_map($callback, $this->data)); + } + + /** + * @param callable(TCarry, T): TCarry $callback A callable to apply to each + * item of the collection to reduce it to a single value. + * @param TCarry $initial This is the initial value provided to the callback. + * + * @return TCarry + * + * @template TCarry + */ + public function reduce(callable $callback, mixed $initial): mixed + { + return array_reduce($this->data, $callback, $initial); + } + + /** + * @param CollectionInterface $other The collection to check for divergent + * items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ + public function diff(CollectionInterface $other): CollectionInterface + { + $this->compareCollectionTypes($other); + + $diffAtoB = array_udiff($this->data, $other->toArray(), $this->getComparator()); + $diffBtoA = array_udiff($other->toArray(), $this->data, $this->getComparator()); + + $collection = clone $this; + $collection->data = array_merge($diffAtoB, $diffBtoA); + + return $collection; + } + + /** + * @param CollectionInterface $other The collection to check for + * intersecting items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ + public function intersect(CollectionInterface $other): CollectionInterface + { + $this->compareCollectionTypes($other); + + $collection = clone $this; + $collection->data = array_uintersect($this->data, $other->toArray(), $this->getComparator()); + + return $collection; + } + + /** + * @param CollectionInterface ...$collections The collections to merge. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if unable to merge any of the given + * collections or items within the given collections due to type + * mismatch errors. + */ + public function merge(CollectionInterface ...$collections): CollectionInterface + { + $mergedCollection = clone $this; + + foreach ($collections as $index => $collection) { + if (!$collection instanceof static) { + throw new CollectionMismatchException( + sprintf('Collection with index %d must be of type %s', $index, static::class), + ); + } + + // When using generics (Collection.php, Set.php, etc), + // we also need to make sure that the internal types match each other + if ($this->getUniformType($collection) !== $this->getUniformType($this)) { + throw new CollectionMismatchException( + sprintf( + 'Collection items in collection with index %d must be of type %s', + $index, + $this->getType(), + ), + ); + } + + foreach ($collection as $key => $value) { + if (is_int($key)) { + $mergedCollection[] = $value; + } else { + $mergedCollection[$key] = $value; + } + } + } + + return $mergedCollection; + } + + /** + * @param CollectionInterface $other + * + * @throws CollectionMismatchException + */ + private function compareCollectionTypes(CollectionInterface $other): void + { + if (!$other instanceof static) { + throw new CollectionMismatchException('Collection must be of type ' . static::class); + } + + // When using generics (Collection.php, Set.php, etc), + // we also need to make sure that the internal types match each other + if ($this->getUniformType($other) !== $this->getUniformType($this)) { + throw new CollectionMismatchException('Collection items must be of type ' . $this->getType()); + } + } + + private function getComparator(): Closure + { + return function (mixed $a, mixed $b): int { + // If the two values are object, we convert them to unique scalars. + // If the collection contains mixed values (unlikely) where some are objects + // and some are not, we leave them as they are. + // The comparator should still work and the result of $a < $b should + // be consistent but unpredictable since not documented. + if (is_object($a) && is_object($b)) { + $a = spl_object_id($a); + $b = spl_object_id($b); + } + + return $a === $b ? 0 : ($a < $b ? 1 : -1); + }; + } + + /** + * @param CollectionInterface $collection + */ + private function getUniformType(CollectionInterface $collection): string + { + return match ($collection->getType()) { + 'integer' => 'int', + 'boolean' => 'bool', + 'double' => 'float', + default => $collection->getType(), + }; + } +} diff --git a/vendor/ramsey/collection/src/AbstractSet.php b/vendor/ramsey/collection/src/AbstractSet.php new file mode 100644 index 0000000..63f8331 --- /dev/null +++ b/vendor/ramsey/collection/src/AbstractSet.php @@ -0,0 +1,51 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * This class contains the basic implementation of a collection that does not + * allow duplicated values (a set), to minimize the effort required to implement + * this specific type of collection. + * + * @template T + * @extends AbstractCollection + */ +abstract class AbstractSet extends AbstractCollection +{ + public function add(mixed $element): bool + { + if ($this->contains($element)) { + return false; + } + + // Call offsetSet() on the parent instead of add(), since calling + // parent::add() will invoke $this->offsetSet(), which will call + // $this->contains() a second time. This can cause performance issues + // with extremely large collections. For more information, see + // https://github.com/ramsey/collection/issues/68. + parent::offsetSet(null, $element); + + return true; + } + + public function offsetSet(mixed $offset, mixed $value): void + { + if ($this->contains($value)) { + return; + } + + parent::offsetSet($offset, $value); + } +} diff --git a/vendor/ramsey/collection/src/ArrayInterface.php b/vendor/ramsey/collection/src/ArrayInterface.php new file mode 100644 index 0000000..bc7f6f4 --- /dev/null +++ b/vendor/ramsey/collection/src/ArrayInterface.php @@ -0,0 +1,49 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use ArrayAccess; +use Countable; +use IteratorAggregate; + +/** + * `ArrayInterface` provides traversable array functionality to data types. + * + * @template T + * @extends ArrayAccess + * @extends IteratorAggregate + */ +interface ArrayInterface extends + ArrayAccess, + Countable, + IteratorAggregate +{ + /** + * Removes all items from this array. + */ + public function clear(): void; + + /** + * Returns a native PHP array representation of this array object. + * + * @return array + */ + public function toArray(): array; + + /** + * Returns `true` if this array is empty. + */ + public function isEmpty(): bool; +} diff --git a/vendor/ramsey/collection/src/Collection.php b/vendor/ramsey/collection/src/Collection.php new file mode 100644 index 0000000..3b0f768 --- /dev/null +++ b/vendor/ramsey/collection/src/Collection.php @@ -0,0 +1,95 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * A collection represents a group of objects. + * + * Each object in the collection is of a specific, defined type. + * + * This is a direct implementation of `CollectionInterface`, provided for + * the sake of convenience. + * + * Example usage: + * + * ``` + * $collection = new \Ramsey\Collection\Collection('My\\Foo'); + * $collection->add(new \My\Foo()); + * $collection->add(new \My\Foo()); + * + * foreach ($collection as $foo) { + * // Do something with $foo + * } + * ``` + * + * It is preferable to subclass `AbstractCollection` to create your own typed + * collections. For example: + * + * ``` + * namespace My\Foo; + * + * class FooCollection extends \Ramsey\Collection\AbstractCollection + * { + * public function getType() + * { + * return 'My\\Foo'; + * } + * } + * ``` + * + * And then use it similarly to the earlier example: + * + * ``` + * $fooCollection = new \My\Foo\FooCollection(); + * $fooCollection->add(new \My\Foo()); + * $fooCollection->add(new \My\Foo()); + * + * foreach ($fooCollection as $foo) { + * // Do something with $foo + * } + * ``` + * + * The benefit with this approach is that you may do type-checking on the + * collection object: + * + * ``` + * if ($collection instanceof \My\Foo\FooCollection) { + * // the collection is a collection of My\Foo objects + * } + * ``` + * + * @template T + * @extends AbstractCollection + */ +class Collection extends AbstractCollection +{ + /** + * Constructs a collection object of the specified type, optionally with the + * specified data. + * + * @param string $collectionType The type or class name associated with this + * collection. + * @param array $data The initial items to store in the collection. + */ + public function __construct(private readonly string $collectionType, array $data = []) + { + parent::__construct($data); + } + + public function getType(): string + { + return $this->collectionType; + } +} diff --git a/vendor/ramsey/collection/src/CollectionInterface.php b/vendor/ramsey/collection/src/CollectionInterface.php new file mode 100644 index 0000000..3ffbb16 --- /dev/null +++ b/vendor/ramsey/collection/src/CollectionInterface.php @@ -0,0 +1,253 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Ramsey\Collection\Exception\CollectionMismatchException; +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\NoSuchElementException; +use Ramsey\Collection\Exception\UnsupportedOperationException; + +/** + * A collection represents a group of values, known as its elements. + * + * Some collections allow duplicate elements and others do not. Some are ordered + * and others unordered. + * + * @template T + * @extends ArrayInterface + */ +interface CollectionInterface extends ArrayInterface +{ + /** + * Ensures that this collection contains the specified element (optional + * operation). + * + * Returns `true` if this collection changed as a result of the call. + * (Returns `false` if this collection does not permit duplicates and + * already contains the specified element.) + * + * Collections that support this operation may place limitations on what + * elements may be added to this collection. In particular, some + * collections will refuse to add `null` elements, and others will impose + * restrictions on the type of elements that may be added. Collection + * classes should clearly specify in their documentation any restrictions + * on what elements may be added. + * + * If a collection refuses to add a particular element for any reason other + * than that it already contains the element, it must throw an exception + * (rather than returning `false`). This preserves the invariant that a + * collection always contains the specified element after this call returns. + * + * @param T $element The element to add to the collection. + * + * @return bool `true` if this collection changed as a result of the call. + * + * @throws InvalidArgumentException if the collection refuses to add the + * $element for any reason other than that it already contains the element. + */ + public function add(mixed $element): bool; + + /** + * Returns `true` if this collection contains the specified element. + * + * @param T $element The element to check whether the collection contains. + * @param bool $strict Whether to perform a strict type check on the value. + */ + public function contains(mixed $element, bool $strict = true): bool; + + /** + * Returns the type associated with this collection. + */ + public function getType(): string; + + /** + * Removes a single instance of the specified element from this collection, + * if it is present. + * + * @param T $element The element to remove from the collection. + * + * @return bool `true` if an element was removed as a result of this call. + */ + public function remove(mixed $element): bool; + + /** + * Returns the values from the given property, method, or array key. + * + * @param string $propertyOrMethod The name of the property, method, or + * array key to evaluate and return. + * + * @return list + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call column() on this + * collection. + */ + public function column(string $propertyOrMethod): array; + + /** + * Returns the first item of the collection. + * + * @return T + * + * @throws NoSuchElementException if this collection is empty. + */ + public function first(): mixed; + + /** + * Returns the last item of the collection. + * + * @return T + * + * @throws NoSuchElementException if this collection is empty. + */ + public function last(): mixed; + + /** + * Sort the collection by a property, method, or array key with the given + * sort order. + * + * If $propertyOrMethod is `null`, this will sort by comparing each element. + * + * This will always leave the original collection untouched and will return + * a new one. + * + * @param string | null $propertyOrMethod The property, method, or array key + * to sort by. + * @param Sort $order The sort order for the resulting collection. + * + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call sort() on this + * collection. + */ + public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): self; + + /** + * Filter out items of the collection which don't match the criteria of + * given callback. + * + * This will always leave the original collection untouched and will return + * a new one. + * + * See the {@link http://php.net/manual/en/function.array-filter.php PHP array_filter() documentation} + * for examples of how the `$callback` parameter works. + * + * @param callable(T): bool $callback A callable to use for filtering elements. + * + * @return CollectionInterface + */ + public function filter(callable $callback): self; + + /** + * Create a new collection where the result of the given property, method, + * or array key of each item in the collection equals the given value. + * + * This will always leave the original collection untouched and will return + * a new one. + * + * @param string | null $propertyOrMethod The property, method, or array key + * to evaluate. If `null`, the element itself is compared to $value. + * @param mixed $value The value to match. + * + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call where() on this + * collection. + */ + public function where(?string $propertyOrMethod, mixed $value): self; + + /** + * Apply a given callback method on each item of the collection. + * + * This will always leave the original collection untouched. The new + * collection is created by mapping the callback to each item of the + * original collection. + * + * See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} + * for examples of how the `$callback` parameter works. + * + * @param callable(T): TCallbackReturn $callback A callable to apply to each + * item of the collection. + * + * @return CollectionInterface + * + * @template TCallbackReturn + */ + public function map(callable $callback): self; + + /** + * Apply a given callback method on each item of the collection + * to reduce it to a single value. + * + * See the {@link http://php.net/manual/en/function.array-reduce.php PHP array_reduce() documentation} + * for examples of how the `$callback` and `$initial` parameters work. + * + * @param callable(TCarry, T): TCarry $callback A callable to apply to each + * item of the collection to reduce it to a single value. + * @param TCarry $initial This is the initial value provided to the callback. + * + * @return TCarry + * + * @template TCarry + */ + public function reduce(callable $callback, mixed $initial): mixed; + + /** + * Create a new collection with divergent items between current and given + * collection. + * + * @param CollectionInterface $other The collection to check for divergent + * items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ + public function diff(CollectionInterface $other): self; + + /** + * Create a new collection with intersecting item between current and given + * collection. + * + * @param CollectionInterface $other The collection to check for + * intersecting items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ + public function intersect(CollectionInterface $other): self; + + /** + * Merge current items and items of given collections into a new one. + * + * @param CollectionInterface ...$collections The collections to merge. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if unable to merge any of the given + * collections or items within the given collections due to type + * mismatch errors. + */ + public function merge(CollectionInterface ...$collections): self; +} diff --git a/vendor/ramsey/collection/src/DoubleEndedQueue.php b/vendor/ramsey/collection/src/DoubleEndedQueue.php new file mode 100644 index 0000000..62947a2 --- /dev/null +++ b/vendor/ramsey/collection/src/DoubleEndedQueue.php @@ -0,0 +1,166 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Exception\NoSuchElementException; + +use function array_key_last; +use function array_pop; +use function array_unshift; + +/** + * This class provides a basic implementation of `DoubleEndedQueueInterface`, to + * minimize the effort required to implement this interface. + * + * @template T + * @extends Queue + * @implements DoubleEndedQueueInterface + */ +class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface +{ + /** + * Constructs a double-ended queue (dequeue) object of the specified type, + * optionally with the specified data. + * + * @param string $queueType The type or class name associated with this dequeue. + * @param array $data The initial items to store in the dequeue. + */ + public function __construct(private readonly string $queueType, array $data = []) + { + parent::__construct($this->queueType, $data); + } + + /** + * @throws InvalidArgumentException if $element is of the wrong type + */ + public function addFirst(mixed $element): bool + { + if ($this->checkType($this->getType(), $element) === false) { + throw new InvalidArgumentException( + 'Value must be of type ' . $this->getType() . '; value is ' + . $this->toolValueToString($element), + ); + } + + array_unshift($this->data, $element); + + return true; + } + + /** + * @throws InvalidArgumentException if $element is of the wrong type + */ + public function addLast(mixed $element): bool + { + return $this->add($element); + } + + public function offerFirst(mixed $element): bool + { + try { + return $this->addFirst($element); + } catch (InvalidArgumentException) { + return false; + } + } + + public function offerLast(mixed $element): bool + { + return $this->offer($element); + } + + /** + * @return T the first element in this queue. + * + * @throws NoSuchElementException if the queue is empty + */ + public function removeFirst(): mixed + { + return $this->remove(); + } + + /** + * @return T the last element in this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function removeLast(): mixed + { + return $this->pollLast() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); + } + + /** + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function pollFirst(): mixed + { + return $this->poll(); + } + + /** + * @return T | null the tail of this queue, or `null` if this queue is empty. + */ + public function pollLast(): mixed + { + return array_pop($this->data); + } + + /** + * @return T the head of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function firstElement(): mixed + { + return $this->element(); + } + + /** + * @return T the tail of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function lastElement(): mixed + { + return $this->peekLast() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); + } + + /** + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function peekFirst(): mixed + { + return $this->peek(); + } + + /** + * @return T | null the tail of this queue, or `null` if this queue is empty. + */ + public function peekLast(): mixed + { + $lastIndex = array_key_last($this->data); + + if ($lastIndex === null) { + return null; + } + + return $this->data[$lastIndex]; + } +} diff --git a/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php new file mode 100644 index 0000000..15cc0e9 --- /dev/null +++ b/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php @@ -0,0 +1,313 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Ramsey\Collection\Exception\NoSuchElementException; +use RuntimeException; + +/** + * A linear collection that supports element insertion and removal at both ends. + * + * Most `DoubleEndedQueueInterface` implementations place no fixed limits on the + * number of elements they may contain, but this interface supports + * capacity-restricted double-ended queues as well as those with no fixed size + * limit. + * + * This interface defines methods to access the elements at both ends of the + * double-ended queue. Methods are provided to insert, remove, and examine the + * element. Each of these methods exists in two forms: one throws an exception + * if the operation fails, the other returns a special value (either `null` or + * `false`, depending on the operation). The latter form of the insert operation + * is designed specifically for use with capacity-restricted implementations; in + * most implementations, insert operations cannot fail. + * + * The twelve methods described above are summarized in the following table: + * + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Summary of DoubleEndedQueueInterface methods
First Element (Head)Last Element (Tail)
Throws exceptionSpecial valueThrows exceptionSpecial value
InsertaddFirst()offerFirst()addLast()offerLast()
RemoveremoveFirst()pollFirst()removeLast()pollLast()
ExaminefirstElement()peekFirst()lastElement()peekLast()
+ * + * This interface extends the `QueueInterface`. When a double-ended queue is + * used as a queue, FIFO (first-in-first-out) behavior results. Elements are + * added at the end of the double-ended queue and removed from the beginning. + * The methods inherited from the `QueueInterface` are precisely equivalent to + * `DoubleEndedQueueInterface` methods as indicated in the following table: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Comparison of QueueInterface and DoubleEndedQueueInterface methods
QueueInterface MethodDoubleEndedQueueInterface Method
add()addLast()
offer()offerLast()
remove()removeFirst()
poll()pollFirst()
element()firstElement()
peek()peekFirst()
+ * + * Double-ended queues can also be used as LIFO (last-in-first-out) stacks. When + * a double-ended queue is used as a stack, elements are pushed and popped from + * the beginning of the double-ended queue. Stack concepts are precisely + * equivalent to `DoubleEndedQueueInterface` methods as indicated in the table + * below: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Comparison of stack concepts and DoubleEndedQueueInterface methods
Stack conceptDoubleEndedQueueInterface Method
pushaddFirst()
popremoveFirst()
peekpeekFirst()
+ * + * Note that the `peek()` method works equally well when a double-ended queue is + * used as a queue or a stack; in either case, elements are drawn from the + * beginning of the double-ended queue. + * + * While `DoubleEndedQueueInterface` implementations are not strictly required + * to prohibit the insertion of `null` elements, they are strongly encouraged to + * do so. Users of any `DoubleEndedQueueInterface` implementations that do allow + * `null` elements are strongly encouraged *not* to take advantage of the + * ability to insert nulls. This is so because `null` is used as a special + * return value by various methods to indicated that the double-ended queue is + * empty. + * + * @template T + * @extends QueueInterface + */ +interface DoubleEndedQueueInterface extends QueueInterface +{ + /** + * Inserts the specified element at the front of this queue if it is + * possible to do so immediately without violating capacity restrictions. + * + * When using a capacity-restricted double-ended queue, it is generally + * preferable to use the `offerFirst()` method. + * + * @param T $element The element to add to the front of this queue. + * + * @return bool `true` if this queue changed as a result of the call. + * + * @throws RuntimeException if a queue refuses to add a particular element + * for any reason other than that it already contains the element. + * Implementations should use a more-specific exception that extends + * `\RuntimeException`. + */ + public function addFirst(mixed $element): bool; + + /** + * Inserts the specified element at the end of this queue if it is possible + * to do so immediately without violating capacity restrictions. + * + * When using a capacity-restricted double-ended queue, it is generally + * preferable to use the `offerLast()` method. + * + * This method is equivalent to `add()`. + * + * @param T $element The element to add to the end of this queue. + * + * @return bool `true` if this queue changed as a result of the call. + * + * @throws RuntimeException if a queue refuses to add a particular element + * for any reason other than that it already contains the element. + * Implementations should use a more-specific exception that extends + * `\RuntimeException`. + */ + public function addLast(mixed $element): bool; + + /** + * Inserts the specified element at the front of this queue if it is + * possible to do so immediately without violating capacity restrictions. + * + * When using a capacity-restricted queue, this method is generally + * preferable to `addFirst()`, which can fail to insert an element only by + * throwing an exception. + * + * @param T $element The element to add to the front of this queue. + * + * @return bool `true` if the element was added to this queue, else `false`. + */ + public function offerFirst(mixed $element): bool; + + /** + * Inserts the specified element at the end of this queue if it is possible + * to do so immediately without violating capacity restrictions. + * + * When using a capacity-restricted queue, this method is generally + * preferable to `addLast()` which can fail to insert an element only by + * throwing an exception. + * + * @param T $element The element to add to the end of this queue. + * + * @return bool `true` if the element was added to this queue, else `false`. + */ + public function offerLast(mixed $element): bool; + + /** + * Retrieves and removes the head of this queue. + * + * This method differs from `pollFirst()` only in that it throws an + * exception if this queue is empty. + * + * @return T the first element in this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function removeFirst(): mixed; + + /** + * Retrieves and removes the tail of this queue. + * + * This method differs from `pollLast()` only in that it throws an exception + * if this queue is empty. + * + * @return T the last element in this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function removeLast(): mixed; + + /** + * Retrieves and removes the head of this queue, or returns `null` if this + * queue is empty. + * + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function pollFirst(): mixed; + + /** + * Retrieves and removes the tail of this queue, or returns `null` if this + * queue is empty. + * + * @return T | null the tail of this queue, or `null` if this queue is empty. + */ + public function pollLast(): mixed; + + /** + * Retrieves, but does not remove, the head of this queue. + * + * This method differs from `peekFirst()` only in that it throws an + * exception if this queue is empty. + * + * @return T the head of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function firstElement(): mixed; + + /** + * Retrieves, but does not remove, the tail of this queue. + * + * This method differs from `peekLast()` only in that it throws an exception + * if this queue is empty. + * + * @return T the tail of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function lastElement(): mixed; + + /** + * Retrieves, but does not remove, the head of this queue, or returns `null` + * if this queue is empty. + * + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function peekFirst(): mixed; + + /** + * Retrieves, but does not remove, the tail of this queue, or returns `null` + * if this queue is empty. + * + * @return T | null the tail of this queue, or `null` if this queue is empty. + */ + public function peekLast(): mixed; +} diff --git a/vendor/ramsey/collection/src/Exception/CollectionException.php b/vendor/ramsey/collection/src/Exception/CollectionException.php new file mode 100644 index 0000000..4aa92be --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/CollectionException.php @@ -0,0 +1,21 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use Throwable; + +interface CollectionException extends Throwable +{ +} diff --git a/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php b/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php new file mode 100644 index 0000000..42f5be2 --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use RuntimeException; + +/** + * Thrown when attempting to operate on collections of differing types. + */ +class CollectionMismatchException extends RuntimeException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php b/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php new file mode 100644 index 0000000..7b41b4a --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use InvalidArgumentException as PhpInvalidArgumentException; + +/** + * Thrown to indicate an argument is not of the expected type. + */ +class InvalidArgumentException extends PhpInvalidArgumentException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php b/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php new file mode 100644 index 0000000..a53be14 --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php @@ -0,0 +1,26 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use RuntimeException; + +/** + * Thrown when attempting to evaluate a property, method, or array key + * that doesn't exist on an element or cannot otherwise be evaluated in the + * current context. + */ +class InvalidPropertyOrMethod extends RuntimeException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/Exception/NoSuchElementException.php b/vendor/ramsey/collection/src/Exception/NoSuchElementException.php new file mode 100644 index 0000000..cd98f0c --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/NoSuchElementException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use RuntimeException; + +/** + * Thrown when attempting to access an element that does not exist. + */ +class NoSuchElementException extends RuntimeException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php b/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php new file mode 100644 index 0000000..c75294e --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use OutOfBoundsException as PhpOutOfBoundsException; + +/** + * Thrown when attempting to access an element out of the range of the collection. + */ +class OutOfBoundsException extends PhpOutOfBoundsException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php b/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php new file mode 100644 index 0000000..d074f45 --- /dev/null +++ b/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Exception; + +use RuntimeException; + +/** + * Thrown to indicate that the requested operation is not supported. + */ +class UnsupportedOperationException extends RuntimeException implements CollectionException +{ +} diff --git a/vendor/ramsey/collection/src/GenericArray.php b/vendor/ramsey/collection/src/GenericArray.php new file mode 100644 index 0000000..2b079aa --- /dev/null +++ b/vendor/ramsey/collection/src/GenericArray.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * `GenericArray` represents a standard array object. + * + * @extends AbstractArray + */ +class GenericArray extends AbstractArray +{ +} diff --git a/vendor/ramsey/collection/src/Map/AbstractMap.php b/vendor/ramsey/collection/src/Map/AbstractMap.php new file mode 100644 index 0000000..92f23e6 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/AbstractMap.php @@ -0,0 +1,205 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +use Ramsey\Collection\AbstractArray; +use Ramsey\Collection\Exception\InvalidArgumentException; +use Traversable; + +use function array_key_exists; +use function array_keys; +use function in_array; +use function var_export; + +/** + * This class provides a basic implementation of `MapInterface`, to minimize the + * effort required to implement this interface. + * + * @template K of array-key + * @template T + * @extends AbstractArray + * @implements MapInterface + */ +abstract class AbstractMap extends AbstractArray implements MapInterface +{ + /** + * @param array $data The initial items to add to this map. + */ + public function __construct(array $data = []) + { + parent::__construct($data); + } + + /** + * @return Traversable + */ + public function getIterator(): Traversable + { + return parent::getIterator(); + } + + /** + * @param K $offset The offset to set + * @param T $value The value to set at the given offset. + * + * @inheritDoc + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if ($offset === null) { + throw new InvalidArgumentException( + 'Map elements are key/value pairs; a key must be provided for ' + . 'value ' . var_export($value, true), + ); + } + + $this->data[$offset] = $value; + } + + public function containsKey(int | string $key): bool + { + return array_key_exists($key, $this->data); + } + + public function containsValue(mixed $value): bool + { + return in_array($value, $this->data, true); + } + + /** + * @inheritDoc + */ + public function keys(): array + { + /** @var list */ + return array_keys($this->data); + } + + /** + * @param K $key The key to return from the map. + * @param T | null $defaultValue The default value to use if `$key` is not found. + * + * @return T | null the value or `null` if the key could not be found. + */ + public function get(int | string $key, mixed $defaultValue = null): mixed + { + return $this[$key] ?? $defaultValue; + } + + /** + * @param K $key The key to put or replace in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function put(int | string $key, mixed $value): mixed + { + $previousValue = $this->get($key); + $this[$key] = $value; + + return $previousValue; + } + + /** + * @param K $key The key to put in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function putIfAbsent(int | string $key, mixed $value): mixed + { + $currentValue = $this->get($key); + + if ($currentValue === null) { + $this[$key] = $value; + } + + return $currentValue; + } + + /** + * @param K $key The key to remove from the map. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function remove(int | string $key): mixed + { + $previousValue = $this->get($key); + unset($this[$key]); + + return $previousValue; + } + + public function removeIf(int | string $key, mixed $value): bool + { + if ($this->get($key) === $value) { + unset($this[$key]); + + return true; + } + + return false; + } + + /** + * @param K $key The key to replace. + * @param T $value The value to set at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function replace(int | string $key, mixed $value): mixed + { + $currentValue = $this->get($key); + + if ($this->containsKey($key)) { + $this[$key] = $value; + } + + return $currentValue; + } + + public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool + { + if ($this->get($key) === $oldValue) { + $this[$key] = $newValue; + + return true; + } + + return false; + } + + /** + * @return array + */ + public function __serialize(): array + { + /** @var array */ + return parent::__serialize(); + } + + /** + * @return array + */ + public function toArray(): array + { + /** @var array */ + return parent::toArray(); + } +} diff --git a/vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/vendor/ramsey/collection/src/Map/AbstractTypedMap.php new file mode 100644 index 0000000..8b6cc04 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/AbstractTypedMap.php @@ -0,0 +1,59 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Tool\TypeTrait; +use Ramsey\Collection\Tool\ValueToStringTrait; + +/** + * This class provides a basic implementation of `TypedMapInterface`, to + * minimize the effort required to implement this interface. + * + * @template K of array-key + * @template T + * @extends AbstractMap + * @implements TypedMapInterface + */ +abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface +{ + use TypeTrait; + use ValueToStringTrait; + + /** + * @param K $offset + * @param T $value + * + * @inheritDoc + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if ($this->checkType($this->getKeyType(), $offset) === false) { + throw new InvalidArgumentException( + 'Key must be of type ' . $this->getKeyType() . '; key is ' + . $this->toolValueToString($offset), + ); + } + + if ($this->checkType($this->getValueType(), $value) === false) { + throw new InvalidArgumentException( + 'Value must be of type ' . $this->getValueType() . '; value is ' + . $this->toolValueToString($value), + ); + } + + parent::offsetSet($offset, $value); + } +} diff --git a/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php new file mode 100644 index 0000000..34e4e85 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +/** + * `AssociativeArrayMap` represents a standard associative array object. + * + * @extends AbstractMap + */ +class AssociativeArrayMap extends AbstractMap +{ +} diff --git a/vendor/ramsey/collection/src/Map/MapInterface.php b/vendor/ramsey/collection/src/Map/MapInterface.php new file mode 100644 index 0000000..22ba1bd --- /dev/null +++ b/vendor/ramsey/collection/src/Map/MapInterface.php @@ -0,0 +1,142 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +use Ramsey\Collection\ArrayInterface; + +/** + * An object that maps keys to values. + * + * A map cannot contain duplicate keys; each key can map to at most one value. + * + * @template K of array-key + * @template T + * @extends ArrayInterface + */ +interface MapInterface extends ArrayInterface +{ + /** + * Returns `true` if this map contains a mapping for the specified key. + * + * @param K $key The key to check in the map. + */ + public function containsKey(int | string $key): bool; + + /** + * Returns `true` if this map maps one or more keys to the specified value. + * + * This performs a strict type check on the value. + * + * @param T $value The value to check in the map. + */ + public function containsValue(mixed $value): bool; + + /** + * Return an array of the keys contained in this map. + * + * @return list + */ + public function keys(): array; + + /** + * Returns the value to which the specified key is mapped, `null` if this + * map contains no mapping for the key, or (optionally) `$defaultValue` if + * this map contains no mapping for the key. + * + * @param K $key The key to return from the map. + * @param T | null $defaultValue The default value to use if `$key` is not found. + * + * @return T | null the value or `null` if the key could not be found. + */ + public function get(int | string $key, mixed $defaultValue = null): mixed; + + /** + * Associates the specified value with the specified key in this map. + * + * If the map previously contained a mapping for the key, the old value is + * replaced by the specified value. + * + * @param K $key The key to put or replace in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function put(int | string $key, mixed $value): mixed; + + /** + * Associates the specified value with the specified key in this map only if + * it is not already set. + * + * If there is already a value associated with `$key`, this returns that + * value without replacing it. + * + * @param K $key The key to put in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function putIfAbsent(int | string $key, mixed $value): mixed; + + /** + * Removes the mapping for a key from this map if it is present. + * + * @param K $key The key to remove from the map. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function remove(int | string $key): mixed; + + /** + * Removes the entry for the specified key only if it is currently mapped to + * the specified value. + * + * This performs a strict type check on the value. + * + * @param K $key The key to remove from the map. + * @param T $value The value to match. + * + * @return bool true if the value was removed. + */ + public function removeIf(int | string $key, mixed $value): bool; + + /** + * Replaces the entry for the specified key only if it is currently mapped + * to some value. + * + * @param K $key The key to replace. + * @param T $value The value to set at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. + */ + public function replace(int | string $key, mixed $value): mixed; + + /** + * Replaces the entry for the specified key only if currently mapped to the + * specified value. + * + * This performs a strict type check on the value. + * + * @param K $key The key to remove from the map. + * @param T $oldValue The value to match. + * @param T $newValue The value to use as a replacement. + * + * @return bool true if the value was replaced. + */ + public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool; +} diff --git a/vendor/ramsey/collection/src/Map/NamedParameterMap.php b/vendor/ramsey/collection/src/Map/NamedParameterMap.php new file mode 100644 index 0000000..f948e47 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/NamedParameterMap.php @@ -0,0 +1,110 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Tool\TypeTrait; +use Ramsey\Collection\Tool\ValueToStringTrait; + +use function array_combine; +use function array_key_exists; +use function is_int; + +/** + * `NamedParameterMap` represents a mapping of values to a set of named keys + * that may optionally be typed + * + * @extends AbstractMap + */ +class NamedParameterMap extends AbstractMap +{ + use TypeTrait; + use ValueToStringTrait; + + /** + * Named parameters defined for this map. + * + * @var array + */ + private readonly array $namedParameters; + + /** + * Constructs a new `NamedParameterMap`. + * + * @param array $namedParameters The named parameters defined for this map. + * @param array $data An initial set of data to set on this map. + */ + public function __construct(array $namedParameters, array $data = []) + { + $this->namedParameters = $this->filterNamedParameters($namedParameters); + parent::__construct($data); + } + + /** + * Returns named parameters set for this `NamedParameterMap`. + * + * @return array + */ + public function getNamedParameters(): array + { + return $this->namedParameters; + } + + public function offsetSet(mixed $offset, mixed $value): void + { + if (!array_key_exists($offset, $this->namedParameters)) { + throw new InvalidArgumentException( + 'Attempting to set value for unconfigured parameter \'' + . $this->toolValueToString($offset) . '\'', + ); + } + + if ($this->checkType($this->namedParameters[$offset], $value) === false) { + throw new InvalidArgumentException( + 'Value for \'' . $offset . '\' must be of type ' + . $this->namedParameters[$offset] . '; value is ' + . $this->toolValueToString($value), + ); + } + + $this->data[$offset] = $value; + } + + /** + * Given an array of named parameters, constructs a proper mapping of + * named parameters to types. + * + * @param array $namedParameters The named parameters to filter. + * + * @return array + */ + protected function filterNamedParameters(array $namedParameters): array + { + $names = []; + $types = []; + + foreach ($namedParameters as $key => $value) { + if (is_int($key)) { + $names[] = $value; + $types[] = 'mixed'; + } else { + $names[] = $key; + $types[] = $value; + } + } + + return array_combine($names, $types) ?: []; + } +} diff --git a/vendor/ramsey/collection/src/Map/TypedMap.php b/vendor/ramsey/collection/src/Map/TypedMap.php new file mode 100644 index 0000000..4a090c8 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/TypedMap.php @@ -0,0 +1,112 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +/** + * A `TypedMap` represents a map of elements where key and value are typed. + * + * Each element is identified by a key with defined type and a value of defined + * type. The keys of the map must be unique. The values on the map can be + * repeated but each with its own different key. + * + * The most common case is to use a string type key, but it's not limited to + * this type of keys. + * + * This is a direct implementation of `TypedMapInterface`, provided for the sake + * of convenience. + * + * Example usage: + * + * ``` + * $map = new TypedMap('string', Foo::class); + * $map['x'] = new Foo(); + * foreach ($map as $key => $value) { + * // do something with $key, it will be a Foo::class + * } + * + * // this will throw an exception since key must be string + * $map[10] = new Foo(); + * + * // this will throw an exception since value must be a Foo + * $map['bar'] = 'bar'; + * + * // initialize map with contents + * $map = new TypedMap('string', Foo::class, [ + * new Foo(), new Foo(), new Foo() + * ]); + * ``` + * + * It is preferable to subclass `AbstractTypedMap` to create your own typed map + * implementation: + * + * ``` + * class FooTypedMap extends AbstractTypedMap + * { + * public function getKeyType() + * { + * return 'int'; + * } + * + * public function getValueType() + * { + * return Foo::class; + * } + * } + * ``` + * + * … but you also may use the `TypedMap` class: + * + * ``` + * class FooTypedMap extends TypedMap + * { + * public function __constructor(array $data = []) + * { + * parent::__construct('int', Foo::class, $data); + * } + * } + * ``` + * + * @template K of array-key + * @template T + * @extends AbstractTypedMap + */ +class TypedMap extends AbstractTypedMap +{ + /** + * Constructs a map object of the specified key and value types, + * optionally with the specified data. + * + * @param string $keyType The data type of the map's keys. + * @param string $valueType The data type of the map's values. + * @param array $data The initial data to set for this map. + */ + public function __construct( + private readonly string $keyType, + private readonly string $valueType, + array $data = [], + ) { + parent::__construct($data); + } + + public function getKeyType(): string + { + return $this->keyType; + } + + public function getValueType(): string + { + return $this->valueType; + } +} diff --git a/vendor/ramsey/collection/src/Map/TypedMapInterface.php b/vendor/ramsey/collection/src/Map/TypedMapInterface.php new file mode 100644 index 0000000..5a44f06 --- /dev/null +++ b/vendor/ramsey/collection/src/Map/TypedMapInterface.php @@ -0,0 +1,36 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Map; + +/** + * A `TypedMapInterface` represents a map of elements where key and value are + * typed. + * + * @template K of array-key + * @template T + * @extends MapInterface + */ +interface TypedMapInterface extends MapInterface +{ + /** + * Return the type used on the key. + */ + public function getKeyType(): string; + + /** + * Return the type forced on the values. + */ + public function getValueType(): string; +} diff --git a/vendor/ramsey/collection/src/Queue.php b/vendor/ramsey/collection/src/Queue.php new file mode 100644 index 0000000..0f5b337 --- /dev/null +++ b/vendor/ramsey/collection/src/Queue.php @@ -0,0 +1,148 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Exception\NoSuchElementException; +use Ramsey\Collection\Tool\TypeTrait; +use Ramsey\Collection\Tool\ValueToStringTrait; + +use function array_key_first; + +/** + * This class provides a basic implementation of `QueueInterface`, to minimize + * the effort required to implement this interface. + * + * @template T + * @extends AbstractArray + * @implements QueueInterface + */ +class Queue extends AbstractArray implements QueueInterface +{ + use TypeTrait; + use ValueToStringTrait; + + /** + * Constructs a queue object of the specified type, optionally with the + * specified data. + * + * @param string $queueType The type or class name associated with this queue. + * @param array $data The initial items to store in the queue. + */ + public function __construct(private readonly string $queueType, array $data = []) + { + parent::__construct($data); + } + + /** + * {@inheritDoc} + * + * Since arbitrary offsets may not be manipulated in a queue, this method + * serves only to fulfill the `ArrayAccess` interface requirements. It is + * invoked by other operations when adding values to the queue. + * + * @throws InvalidArgumentException if $value is of the wrong type. + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if ($this->checkType($this->getType(), $value) === false) { + throw new InvalidArgumentException( + 'Value must be of type ' . $this->getType() . '; value is ' + . $this->toolValueToString($value), + ); + } + + $this->data[] = $value; + } + + /** + * @throws InvalidArgumentException if $value is of the wrong type. + */ + public function add(mixed $element): bool + { + $this[] = $element; + + return true; + } + + /** + * @return T + * + * @throws NoSuchElementException if this queue is empty. + */ + public function element(): mixed + { + return $this->peek() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); + } + + public function offer(mixed $element): bool + { + try { + return $this->add($element); + } catch (InvalidArgumentException) { + return false; + } + } + + /** + * @return T | null + */ + public function peek(): mixed + { + $index = array_key_first($this->data); + + if ($index === null) { + return null; + } + + return $this[$index]; + } + + /** + * @return T | null + */ + public function poll(): mixed + { + $index = array_key_first($this->data); + + if ($index === null) { + return null; + } + + $head = $this[$index]; + unset($this[$index]); + + return $head; + } + + /** + * @return T + * + * @throws NoSuchElementException if this queue is empty. + */ + public function remove(): mixed + { + return $this->poll() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); + } + + public function getType(): string + { + return $this->queueType; + } +} diff --git a/vendor/ramsey/collection/src/QueueInterface.php b/vendor/ramsey/collection/src/QueueInterface.php new file mode 100644 index 0000000..f29ce43 --- /dev/null +++ b/vendor/ramsey/collection/src/QueueInterface.php @@ -0,0 +1,202 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +use Ramsey\Collection\Exception\NoSuchElementException; +use RuntimeException; + +/** + * A queue is a collection in which the entities in the collection are kept in + * order. + * + * The principal operations on the queue are the addition of entities to the end + * (tail), also known as *enqueue*, and removal of entities from the front + * (head), also known as *dequeue*. This makes the queue a first-in-first-out + * (FIFO) data structure. + * + * Besides basic array operations, queues provide additional insertion, + * extraction, and inspection operations. Each of these methods exists in two + * forms: one throws an exception if the operation fails, the other returns a + * special value (either `null` or `false`, depending on the operation). The + * latter form of the insert operation is designed specifically for use with + * capacity-restricted `QueueInterface` implementations; in most + * implementations, insert operations cannot fail. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Summary of QueueInterface methods
Throws exceptionReturns special value
Insertadd()offer()
Removeremove()poll()
Examineelement()peek()
+ * + * Queues typically, but do not necessarily, order elements in a FIFO + * (first-in-first-out) manner. Among the exceptions are priority queues, which + * order elements according to a supplied comparator, or the elements' natural + * ordering, and LIFO queues (or stacks) which order the elements LIFO + * (last-in-first-out). Whatever the ordering used, the head of the queue is + * that element which would be removed by a call to remove() or poll(). In a + * FIFO queue, all new elements are inserted at the tail of the queue. Other + * kinds of queues may use different placement rules. Every `QueueInterface` + * implementation must specify its ordering properties. + * + * The `offer()` method inserts an element if possible, otherwise returning + * `false`. This differs from the `add()` method, which can fail to add an + * element only by throwing an unchecked exception. The `offer()` method is + * designed for use when failure is a normal, rather than exceptional + * occurrence, for example, in fixed-capacity (or "bounded") queues. + * + * The `remove()` and `poll()` methods remove and return the head of the queue. + * Exactly which element is removed from the queue is a function of the queue's + * ordering policy, which differs from implementation to implementation. The + * `remove()` and `poll()` methods differ only in their behavior when the queue + * is empty: the `remove()` method throws an exception, while the `poll()` + * method returns `null`. + * + * The `element()` and `peek()` methods return, but do not remove, the head of + * the queue. + * + * `QueueInterface` implementations generally do not allow insertion of `null` + * elements, although some implementations do not prohibit insertion of `null`. + * Even in the implementations that permit it, `null` should not be inserted + * into a queue, as `null` is also used as a special return value by the + * `poll()` method to indicate that the queue contains no elements. + * + * @template T + * @extends ArrayInterface + */ +interface QueueInterface extends ArrayInterface +{ + /** + * Ensures that this queue contains the specified element (optional + * operation). + * + * Returns `true` if this queue changed as a result of the call. (Returns + * `false` if this queue does not permit duplicates and already contains the + * specified element.) + * + * Queues that support this operation may place limitations on what elements + * may be added to this queue. In particular, some queues will refuse to add + * `null` elements, and others will impose restrictions on the type of + * elements that may be added. Queue classes should clearly specify in their + * documentation any restrictions on what elements may be added. + * + * If a queue refuses to add a particular element for any reason other than + * that it already contains the element, it must throw an exception (rather + * than returning `false`). This preserves the invariant that a queue always + * contains the specified element after this call returns. + * + * @see self::offer() + * + * @param T $element The element to add to this queue. + * + * @return bool `true` if this queue changed as a result of the call. + * + * @throws RuntimeException if a queue refuses to add a particular element + * for any reason other than that it already contains the element. + * Implementations should use a more-specific exception that extends + * `\RuntimeException`. + */ + public function add(mixed $element): bool; + + /** + * Retrieves, but does not remove, the head of this queue. + * + * This method differs from `peek()` only in that it throws an exception if + * this queue is empty. + * + * @see self::peek() + * + * @return T the head of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function element(): mixed; + + /** + * Inserts the specified element into this queue if it is possible to do so + * immediately without violating capacity restrictions. + * + * When using a capacity-restricted queue, this method is generally + * preferable to `add()`, which can fail to insert an element only by + * throwing an exception. + * + * @see self::add() + * + * @param T $element The element to add to this queue. + * + * @return bool `true` if the element was added to this queue, else `false`. + */ + public function offer(mixed $element): bool; + + /** + * Retrieves, but does not remove, the head of this queue, or returns `null` + * if this queue is empty. + * + * @see self::element() + * + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function peek(): mixed; + + /** + * Retrieves and removes the head of this queue, or returns `null` + * if this queue is empty. + * + * @see self::remove() + * + * @return T | null the head of this queue, or `null` if this queue is empty. + */ + public function poll(): mixed; + + /** + * Retrieves and removes the head of this queue. + * + * This method differs from `poll()` only in that it throws an exception if + * this queue is empty. + * + * @see self::poll() + * + * @return T the head of this queue. + * + * @throws NoSuchElementException if this queue is empty. + */ + public function remove(): mixed; + + /** + * Returns the type associated with this queue. + */ + public function getType(): string; +} diff --git a/vendor/ramsey/collection/src/Set.php b/vendor/ramsey/collection/src/Set.php new file mode 100644 index 0000000..d60f248 --- /dev/null +++ b/vendor/ramsey/collection/src/Set.php @@ -0,0 +1,59 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * A set is a collection that contains no duplicate elements. + * + * Great care must be exercised if mutable objects are used as set elements. + * The behavior of a set is not specified if the value of an object is changed + * in a manner that affects equals comparisons while the object is an element in + * the set. + * + * Example usage: + * + * ``` + * $foo = new \My\Foo(); + * $set = new Set(\My\Foo::class); + * + * $set->add($foo); // returns TRUE, the element doesn't exist + * $set->add($foo); // returns FALSE, the element already exists + * + * $bar = new \My\Foo(); + * $set->add($bar); // returns TRUE, $bar !== $foo + * ``` + * + * @template T + * @extends AbstractSet + */ +class Set extends AbstractSet +{ + /** + * Constructs a set object of the specified type, optionally with the + * specified data. + * + * @param string $setType The type or class name associated with this set. + * @param array $data The initial items to store in the set. + */ + public function __construct(private readonly string $setType, array $data = []) + { + parent::__construct($data); + } + + public function getType(): string + { + return $this->setType; + } +} diff --git a/vendor/ramsey/collection/src/Sort.php b/vendor/ramsey/collection/src/Sort.php new file mode 100644 index 0000000..0c3c192 --- /dev/null +++ b/vendor/ramsey/collection/src/Sort.php @@ -0,0 +1,31 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * Collection sorting + */ +enum Sort: string +{ + /** + * Sort items in a collection in ascending order. + */ + case Ascending = 'asc'; + + /** + * Sort items in a collection in descending order. + */ + case Descending = 'desc'; +} diff --git a/vendor/ramsey/collection/src/Tool/TypeTrait.php b/vendor/ramsey/collection/src/Tool/TypeTrait.php new file mode 100644 index 0000000..ac51b7f --- /dev/null +++ b/vendor/ramsey/collection/src/Tool/TypeTrait.php @@ -0,0 +1,57 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Tool; + +use function is_array; +use function is_bool; +use function is_callable; +use function is_float; +use function is_int; +use function is_numeric; +use function is_object; +use function is_resource; +use function is_scalar; +use function is_string; + +/** + * Provides functionality to check values for specific types. + */ +trait TypeTrait +{ + /** + * Returns `true` if value is of the specified type. + * + * @param string $type The type to check the value against. + * @param mixed $value The value to check. + */ + protected function checkType(string $type, mixed $value): bool + { + return match ($type) { + 'array' => is_array($value), + 'bool', 'boolean' => is_bool($value), + 'callable' => is_callable($value), + 'float', 'double' => is_float($value), + 'int', 'integer' => is_int($value), + 'null' => $value === null, + 'numeric' => is_numeric($value), + 'object' => is_object($value), + 'resource' => is_resource($value), + 'scalar' => is_scalar($value), + 'string' => is_string($value), + 'mixed' => true, + default => $value instanceof $type, + }; + } +} diff --git a/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php b/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php new file mode 100644 index 0000000..bbe27b4 --- /dev/null +++ b/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php @@ -0,0 +1,100 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Tool; + +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\UnsupportedOperationException; +use ReflectionProperty; + +use function is_array; +use function is_object; +use function method_exists; +use function property_exists; +use function sprintf; + +/** + * Provides functionality to extract the value of a property or method from an object. + */ +trait ValueExtractorTrait +{ + /** + * Returns the type associated with this collection. + */ + abstract public function getType(): string; + + /** + * Extracts the value of the given property, method, or array key from the + * element. + * + * If `$propertyOrMethod` is `null`, we return the element as-is. + * + * @param mixed $element The element to extract the value from. + * @param string | null $propertyOrMethod The property or method for which the + * value should be extracted. + * + * @return mixed the value extracted from the specified property, method, + * or array key, or the element itself. + * + * @throws InvalidPropertyOrMethod + * @throws UnsupportedOperationException + */ + protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed + { + if ($propertyOrMethod === null) { + return $element; + } + + if (!is_object($element) && !is_array($element)) { + throw new UnsupportedOperationException(sprintf( + 'The collection type "%s" does not support the $propertyOrMethod parameter', + $this->getType(), + )); + } + + if (is_array($element)) { + return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf( + 'Key or index "%s" not found in collection elements', + $propertyOrMethod, + )); + } + + if (property_exists($element, $propertyOrMethod) && method_exists($element, $propertyOrMethod)) { + $reflectionProperty = new ReflectionProperty($element, $propertyOrMethod); + if ($reflectionProperty->isPublic()) { + return $element->$propertyOrMethod; + } + + return $element->{$propertyOrMethod}(); + } + + if (property_exists($element, $propertyOrMethod)) { + return $element->$propertyOrMethod; + } + + if (method_exists($element, $propertyOrMethod)) { + return $element->{$propertyOrMethod}(); + } + + if (isset($element->$propertyOrMethod)) { + return $element->$propertyOrMethod; + } + + throw new InvalidPropertyOrMethod(sprintf( + 'Method or property "%s" not defined in %s', + $propertyOrMethod, + $element::class, + )); + } +} diff --git a/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php new file mode 100644 index 0000000..40c7803 --- /dev/null +++ b/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php @@ -0,0 +1,92 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection\Tool; + +use DateTimeInterface; + +use function assert; +use function get_resource_type; +use function is_array; +use function is_bool; +use function is_callable; +use function is_object; +use function is_resource; +use function is_scalar; + +/** + * Provides functionality to express a value as string + */ +trait ValueToStringTrait +{ + /** + * Returns a string representation of the value. + * + * - null value: `'NULL'` + * - boolean: `'TRUE'`, `'FALSE'` + * - array: `'Array'` + * - scalar: converted-value + * - resource: `'(type resource #number)'` + * - object with `__toString()`: result of `__toString()` + * - object DateTime: ISO 8601 date + * - object: `'(className Object)'` + * - anonymous function: same as object + * + * @param mixed $value the value to return as a string. + */ + protected function toolValueToString(mixed $value): string + { + // null + if ($value === null) { + return 'NULL'; + } + + // boolean constants + if (is_bool($value)) { + return $value ? 'TRUE' : 'FALSE'; + } + + // array + if (is_array($value)) { + return 'Array'; + } + + // scalar types (integer, float, string) + if (is_scalar($value)) { + return (string) $value; + } + + // resource + if (is_resource($value)) { + return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; + } + + // From here, $value should be an object. + assert(is_object($value)); + + // __toString() is implemented + if (is_callable([$value, '__toString'])) { + /** @var string */ + return $value->__toString(); + } + + // object of type \DateTime + if ($value instanceof DateTimeInterface) { + return $value->format('c'); + } + + // unknown type + return '(' . $value::class . ' Object)'; + } +} diff --git a/vendor/ramsey/uuid/LICENSE b/vendor/ramsey/uuid/LICENSE new file mode 100644 index 0000000..22b4d0d --- /dev/null +++ b/vendor/ramsey/uuid/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2025 Ben Ramsey + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ramsey/uuid/README.md b/vendor/ramsey/uuid/README.md new file mode 100644 index 0000000..eab624d --- /dev/null +++ b/vendor/ramsey/uuid/README.md @@ -0,0 +1,82 @@ +

ramsey/uuid

+ +

+ A PHP library for generating and working with UUIDs. +

+ +

+ Source Code + Download Package + PHP Programming Language + Read License + Build Status + Codecov Code Coverage +

+ +ramsey/uuid is a PHP library for generating and working with universally unique +identifiers (UUIDs). + +This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). +By participating in this project and its community, you are expected to +uphold this code. + +Much inspiration for this library came from the [Java][javauuid] and +[Python][pyuuid] UUID libraries. + +## Installation + +The preferred method of installation is via [Composer][]. Run the following +command to install the package and add it as a requirement to your project's +`composer.json`: + +```bash +composer require ramsey/uuid +``` + +## Upgrading to Version 4 + +See the documentation for a thorough upgrade guide: + +* [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/stable/upgrading/3-to-4.html) + +## Documentation + +Please see for documentation, tips, examples, and +frequently asked questions. + +## Contributing + +Contributions are welcome! To contribute, please familiarize yourself with +[CONTRIBUTING.md](CONTRIBUTING.md). + +## Coordinated Disclosure + +Keeping user information safe and secure is a top priority, and we welcome the +contribution of external security researchers. If you believe you've found a +security issue in software that is maintained in this repository, please read +[SECURITY.md][] for instructions on submitting a vulnerability report. + +## ramsey/uuid for Enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of ramsey/uuid and thousands of other packages are working with +Tidelift to deliver commercial support and maintenance for the open source +packages you use to build your applications. Save time, reduce risk, and improve +code health, while paying the maintainers of the exact packages you use. +[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-uuid?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Copyright and License + +The ramsey/uuid library is copyright © [Ben Ramsey](https://benramsey.com/) and +licensed for use under the MIT License (MIT). Please see [LICENSE][] for more +information. + +[rfc4122]: http://tools.ietf.org/html/rfc4122 +[conduct]: https://github.com/ramsey/uuid/blob/4.x/CODE_OF_CONDUCT.md +[javauuid]: http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html +[pyuuid]: http://docs.python.org/3/library/uuid.html +[composer]: http://getcomposer.org/ +[contributing.md]: https://github.com/ramsey/uuid/blob/4.x/CONTRIBUTING.md +[security.md]: https://github.com/ramsey/uuid/blob/4.x/SECURITY.md +[license]: https://github.com/ramsey/uuid/blob/4.x/LICENSE diff --git a/vendor/ramsey/uuid/composer.json b/vendor/ramsey/uuid/composer.json new file mode 100644 index 0000000..b34d9b1 --- /dev/null +++ b/vendor/ramsey/uuid/composer.json @@ -0,0 +1,114 @@ +{ + "name": "ramsey/uuid", + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "license": "MIT", + "type": "library", + "keywords": [ + "uuid", + "identifier", + "guid" + ], + "require": { + "php": "^8.0", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "ramsey/collection": "^1.2 || ^2.0" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "autoload-dev": { + "psr-4": { + "Ramsey\\Uuid\\Benchmark\\": "tests/benchmark/", + "Ramsey\\Uuid\\StaticAnalysis\\": "tests/static-analysis/", + "Ramsey\\Uuid\\Test\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "captainhook/plugin-composer": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true + }, + "sort-packages": true + }, + "extra": { + "captainhook": { + "force-install": true + } + }, + "scripts": { + "dev:analyze": "@dev:analyze:phpstan", + "dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit 1G", + "dev:bench": "@php -d 'error_reporting=24575' vendor/bin/phpbench run", + "dev:build:clean": "git clean -fX build/", + "dev:lint": [ + "@dev:lint:syntax", + "@dev:lint:style" + ], + "dev:lint:fix": "phpcbf --cache=build/cache/phpcs.cache", + "dev:lint:style": "phpcs --cache=build/cache/phpcs.cache --colors", + "dev:lint:syntax": "parallel-lint --colors src/ tests/", + "dev:test": [ + "@dev:lint", + "@dev:bench", + "@dev:analyze", + "@dev:test:unit" + ], + "dev:test:coverage:ci": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml", + "dev:test:coverage:html": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-html build/coverage/coverage-html/", + "dev:test:unit": "phpunit --colors=always", + "test": "@dev:test" + }, + "scripts-descriptions": { + "dev:analyze": "Runs all static analysis checks.", + "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", + "dev:bench": "Runs PHPBench benchmark tests.", + "dev:build:clean": "Cleans the build/ directory.", + "dev:lint": "Runs all linting checks.", + "dev:lint:fix": "Auto-fixes coding standards issues, if possible.", + "dev:lint:style": "Checks for coding standards issues.", + "dev:lint:syntax": "Checks for syntax errors.", + "dev:test": "Runs linting, static analysis, and unit tests.", + "dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.", + "dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.", + "dev:test:unit": "Runs unit tests.", + "test": "Runs linting, static analysis, and unit tests." + } +} diff --git a/vendor/ramsey/uuid/src/BinaryUtils.php b/vendor/ramsey/uuid/src/BinaryUtils.php new file mode 100644 index 0000000..d8aac2e --- /dev/null +++ b/vendor/ramsey/uuid/src/BinaryUtils.php @@ -0,0 +1,54 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +/** + * Provides binary math utilities + */ +class BinaryUtils +{ + /** + * Applies the variant field to the 16-bit clock sequence + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + * + * @param int $clockSeq The 16-bit clock sequence value before the variant is applied + * + * @return int The 16-bit clock sequence multiplexed with the UUID variant + * + * @pure + */ + public static function applyVariant(int $clockSeq): int + { + return ($clockSeq & 0x3fff) | 0x8000; + } + + /** + * Applies the version field to the 16-bit `time_hi_and_version` field + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + * + * @param int $timeHi The value of the 16-bit `time_hi_and_version` field before the version is applied + * @param int $version The version to apply to the `time_hi` field + * + * @return int The 16-bit time_hi field of the timestamp multiplexed with the UUID version number + * + * @pure + */ + public static function applyVersion(int $timeHi, int $version): int + { + return ($timeHi & 0x0fff) | ($version << 12); + } +} diff --git a/vendor/ramsey/uuid/src/Builder/BuilderCollection.php b/vendor/ramsey/uuid/src/Builder/BuilderCollection.php new file mode 100644 index 0000000..2b2e0a2 --- /dev/null +++ b/vendor/ramsey/uuid/src/Builder/BuilderCollection.php @@ -0,0 +1,77 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Builder; + +use Ramsey\Collection\AbstractCollection; +use Ramsey\Uuid\Converter\Number\GenericNumberConverter; +use Ramsey\Uuid\Converter\Time\GenericTimeConverter; +use Ramsey\Uuid\Converter\Time\PhpTimeConverter; +use Ramsey\Uuid\Guid\GuidBuilder; +use Ramsey\Uuid\Math\BrickMathCalculator; +use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; +use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; +use Traversable; + +/** + * A collection of UuidBuilderInterface objects + * + * @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a + * pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: + * that is no longer necessary, now that you can safely verify your code to be correct, and use more generic types + * like `iterable` instead. + * + * @extends AbstractCollection + */ +class BuilderCollection extends AbstractCollection +{ + public function getType(): string + { + return UuidBuilderInterface::class; + } + + public function getIterator(): Traversable + { + return parent::getIterator(); + } + + /** + * Re-constructs the object from its serialized form + * + * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance + */ + public function unserialize($serialized): void + { + /** @var array $data */ + $data = unserialize($serialized, [ + 'allowed_classes' => [ + BrickMathCalculator::class, + GenericNumberConverter::class, + GenericTimeConverter::class, + GuidBuilder::class, + NonstandardUuidBuilder::class, + PhpTimeConverter::class, + Rfc4122UuidBuilder::class, + ], + ]); + + $this->data = array_filter( + $data, + function ($unserialized): bool { + /** @phpstan-ignore instanceof.alwaysTrue */ + return $unserialized instanceof UuidBuilderInterface; + }, + ); + } +} diff --git a/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php b/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php new file mode 100644 index 0000000..3d62159 --- /dev/null +++ b/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php @@ -0,0 +1,26 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Builder; + +use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; + +/** + * @deprecated Please transition to {@see Rfc4122UuidBuilder}. + * + * @immutable + */ +class DefaultUuidBuilder extends Rfc4122UuidBuilder +{ +} diff --git a/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php b/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php new file mode 100644 index 0000000..1554a97 --- /dev/null +++ b/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php @@ -0,0 +1,60 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Builder; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\Time\DegradedTimeConverter; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\DegradedUuid; +use Ramsey\Uuid\Rfc4122\Fields as Rfc4122Fields; +use Ramsey\Uuid\UuidInterface; + +/** + * @deprecated DegradedUuid instances are no longer necessary to support 32-bit systems. Please transition to {@see DefaultUuidBuilder}. + * + * @immutable + */ +class DegradedUuidBuilder implements UuidBuilderInterface +{ + private TimeConverterInterface $timeConverter; + + /** + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the DegradedUuid + * @param TimeConverterInterface|null $timeConverter The time converter to use for converting timestamps extracted + * from a UUID to Unix timestamps + */ + public function __construct( + private NumberConverterInterface $numberConverter, + ?TimeConverterInterface $timeConverter = null + ) { + $this->timeConverter = $timeConverter ?: new DegradedTimeConverter(); + } + + /** + * Builds and returns a DegradedUuid + * + * @param CodecInterface $codec The codec to use for building this DegradedUuid instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid + * + * @phpstan-impure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface + { + return new DegradedUuid(new Rfc4122Fields($bytes), $this->numberConverter, $codec, $this->timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php b/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php new file mode 100644 index 0000000..e40f778 --- /dev/null +++ b/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php @@ -0,0 +1,66 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Builder; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Exception\BuilderNotFoundException; +use Ramsey\Uuid\Exception\UnableToBuildUuidException; +use Ramsey\Uuid\UuidInterface; + +/** + * FallbackBuilder builds a UUID by stepping through a list of UUID builders until a UUID can be constructed without exceptions + * + * @immutable + */ +class FallbackBuilder implements UuidBuilderInterface +{ + /** + * @param iterable $builders An array of UUID builders + */ + public function __construct(private iterable $builders) + { + } + + /** + * Builds and returns a UuidInterface instance using the first builder that succeeds + * + * @param CodecInterface $codec The codec to use for building this instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return UuidInterface an instance of a UUID object + * + * @pure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface + { + $lastBuilderException = null; + + foreach ($this->builders as $builder) { + try { + return $builder->build($codec, $bytes); + } catch (UnableToBuildUuidException $exception) { + $lastBuilderException = $exception; + + continue; + } + } + + throw new BuilderNotFoundException( + 'Could not find a suitable builder for the provided codec and fields', + 0, + $lastBuilderException, + ); + } +} diff --git a/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php b/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php new file mode 100644 index 0000000..c409878 --- /dev/null +++ b/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php @@ -0,0 +1,38 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Builder; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\UuidInterface; + +/** + * A UUID builder builds instances of UuidInterface + * + * @immutable + */ +interface UuidBuilderInterface +{ + /** + * Builds and returns a UuidInterface + * + * @param CodecInterface $codec The codec to use for building this UuidInterface instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return UuidInterface Implementations may choose to return more specific instances of UUIDs that implement UuidInterface + * + * @pure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface; +} diff --git a/vendor/ramsey/uuid/src/Codec/CodecInterface.php b/vendor/ramsey/uuid/src/Codec/CodecInterface.php new file mode 100644 index 0000000..b1e554e --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/CodecInterface.php @@ -0,0 +1,69 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +use Ramsey\Uuid\UuidInterface; + +/** + * A codec encodes and decodes a UUID according to defined rules + * + * @immutable + */ +interface CodecInterface +{ + /** + * Returns a hexadecimal string representation of a UuidInterface + * + * @param UuidInterface $uuid The UUID for which to create a hexadecimal string representation + * + * @return non-empty-string Hexadecimal string representation of a UUID + * + * @pure + */ + public function encode(UuidInterface $uuid): string; + + /** + * Returns a binary string representation of a UuidInterface + * + * @param UuidInterface $uuid The UUID for which to create a binary string representation + * + * @return non-empty-string Binary string representation of a UUID + * + * @pure + */ + public function encodeBinary(UuidInterface $uuid): string; + + /** + * Returns a UuidInterface derived from a hexadecimal string representation + * + * @param string $encodedUuid The hexadecimal string representation to convert into a UuidInterface instance + * + * @return UuidInterface An instance of a UUID decoded from a hexadecimal string representation + * + * @pure + */ + public function decode(string $encodedUuid): UuidInterface; + + /** + * Returns a UuidInterface derived from a binary string representation + * + * @param string $bytes The binary string representation to convert into a UuidInterface instance + * + * @return UuidInterface An instance of a UUID decoded from a binary string representation + * + * @pure + */ + public function decodeBytes(string $bytes): UuidInterface; +} diff --git a/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php b/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php new file mode 100644 index 0000000..a1bd58a --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php @@ -0,0 +1,78 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +use Ramsey\Uuid\Guid\Guid; +use Ramsey\Uuid\UuidInterface; + +use function bin2hex; +use function sprintf; +use function substr; + +/** + * GuidStringCodec encodes and decodes globally unique identifiers (GUID) + * + * @see Guid + * + * @immutable + */ +class GuidStringCodec extends StringCodec +{ + public function encode(UuidInterface $uuid): string + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $hex = bin2hex($uuid->getFields()->getBytes()); + + /** @var non-empty-string */ + return sprintf( + '%02s%02s%02s%02s-%02s%02s-%02s%02s-%04s-%012s', + substr($hex, 6, 2), + substr($hex, 4, 2), + substr($hex, 2, 2), + substr($hex, 0, 2), + substr($hex, 10, 2), + substr($hex, 8, 2), + substr($hex, 14, 2), + substr($hex, 12, 2), + substr($hex, 16, 4), + substr($hex, 20), + ); + } + + public function decode(string $encodedUuid): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $bytes = $this->getBytes($encodedUuid); + + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ + return $this->getBuilder()->build($this, $this->swapBytes($bytes)); + } + + public function decodeBytes(string $bytes): UuidInterface + { + // Call parent::decode() to preserve the correct byte order. + return parent::decode(bin2hex($bytes)); + } + + /** + * Swaps bytes according to the GUID rules + */ + private function swapBytes(string $bytes): string + { + return $bytes[3] . $bytes[2] . $bytes[1] . $bytes[0] + . $bytes[5] . $bytes[4] . $bytes[7] . $bytes[6] + . substr($bytes, 8); + } +} diff --git a/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php b/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php new file mode 100644 index 0000000..ea533d9 --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php @@ -0,0 +1,101 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\UuidInterface; + +use function strlen; +use function substr; + +/** + * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for more efficient storage + * + * For binary representations of version 1 UUID, this codec may be used to reorganize the time fields, making the UUID + * closer to sequential when storing the bytes. According to Percona, this optimization can improve database INSERT and + * SELECT statements using the UUID column as a key. + * + * The string representation of the UUID will remain unchanged. Only the binary representation is reordered. + * + * PLEASE NOTE: Binary representations of UUIDs encoded with this codec must be decoded with this codec. Decoding using + * another codec can result in malformed UUIDs. + * + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version6.html Version 6, reordered time-based UUIDs}. + * + * @link https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ Storing UUID Values in MySQL + * + * @immutable + */ +class OrderedTimeCodec extends StringCodec +{ + /** + * Returns a binary string representation of a UUID, with the timestamp fields rearranged for optimized storage + * + * @return non-empty-string + */ + public function encodeBinary(UuidInterface $uuid): string + { + if ( + /** @phpstan-ignore possiblyImpure.methodCall */ + !($uuid->getFields() instanceof Rfc4122FieldsInterface) + /** @phpstan-ignore possiblyImpure.methodCall */ + || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME + ) { + throw new InvalidArgumentException('Expected version 1 (time-based) UUID'); + } + + /** @phpstan-ignore possiblyImpure.methodCall */ + $bytes = $uuid->getFields()->getBytes(); + + return $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] + . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3] + . substr($bytes, 8); + } + + /** + * Returns a UuidInterface derived from an ordered-time binary string representation + * + * @throws InvalidArgumentException if $bytes is an invalid length + * + * @inheritDoc + */ + public function decodeBytes(string $bytes): UuidInterface + { + if (strlen($bytes) !== 16) { + throw new InvalidArgumentException('$bytes string should contain 16 characters.'); + } + + // Rearrange the bytes to their original order. + $rearrangedBytes = $bytes[4] . $bytes[5] . $bytes[6] . $bytes[7] + . $bytes[2] . $bytes[3] . $bytes[0] . $bytes[1] + . substr($bytes, 8); + + $uuid = parent::decodeBytes($rearrangedBytes); + + /** @phpstan-ignore possiblyImpure.methodCall */ + $fields = $uuid->getFields(); + + if (!$fields instanceof Rfc4122FieldsInterface || $fields->getVersion() !== Uuid::UUID_TYPE_TIME) { + throw new UnsupportedOperationException( + 'Attempting to decode a non-time-based UUID using OrderedTimeCodec', + ); + } + + return $uuid; + } +} diff --git a/vendor/ramsey/uuid/src/Codec/StringCodec.php b/vendor/ramsey/uuid/src/Codec/StringCodec.php new file mode 100644 index 0000000..55f4f8b --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/StringCodec.php @@ -0,0 +1,121 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Exception\InvalidUuidStringException; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\UuidInterface; + +use function bin2hex; +use function hex2bin; +use function implode; +use function sprintf; +use function str_replace; +use function strlen; +use function substr; + +/** + * StringCodec encodes and decodes RFC 9562 (formerly RFC 4122) UUIDs + * + * @immutable + */ +class StringCodec implements CodecInterface +{ + /** + * Constructs a StringCodec + * + * @param UuidBuilderInterface $builder The builder to use when encoding UUIDs + */ + public function __construct(private UuidBuilderInterface $builder) + { + } + + public function encode(UuidInterface $uuid): string + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $hex = bin2hex($uuid->getFields()->getBytes()); + + /** @var non-empty-string */ + return sprintf( + '%08s-%04s-%04s-%04s-%012s', + substr($hex, 0, 8), + substr($hex, 8, 4), + substr($hex, 12, 4), + substr($hex, 16, 4), + substr($hex, 20), + ); + } + + /** + * @return non-empty-string + */ + public function encodeBinary(UuidInterface $uuid): string + { + /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ + return $uuid->getFields()->getBytes(); + } + + /** + * @throws InvalidUuidStringException + * + * @inheritDoc + */ + public function decode(string $encodedUuid): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return $this->builder->build($this, $this->getBytes($encodedUuid)); + } + + public function decodeBytes(string $bytes): UuidInterface + { + if (strlen($bytes) !== 16) { + throw new InvalidArgumentException('$bytes string should contain 16 characters.'); + } + + return $this->builder->build($this, $bytes); + } + + /** + * Returns the UUID builder + */ + protected function getBuilder(): UuidBuilderInterface + { + return $this->builder; + } + + /** + * Returns a byte string of the UUID + */ + protected function getBytes(string $encodedUuid): string + { + $parsedUuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}', '-'], '', $encodedUuid); + + $components = [ + substr($parsedUuid, 0, 8), + substr($parsedUuid, 8, 4), + substr($parsedUuid, 12, 4), + substr($parsedUuid, 16, 4), + substr($parsedUuid, 20), + ]; + + if (!Uuid::isValid(implode('-', $components))) { + throw new InvalidUuidStringException('Invalid UUID string: ' . $encodedUuid); + } + + return (string) hex2bin($parsedUuid); + } +} diff --git a/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php b/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php new file mode 100644 index 0000000..e7c8efd --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php @@ -0,0 +1,112 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +use Ramsey\Uuid\Exception\InvalidUuidStringException; +use Ramsey\Uuid\UuidInterface; + +use function bin2hex; +use function sprintf; +use function substr; +use function substr_replace; + +/** + * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the first 48 bits + * + * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec adds the timestamp to the first 48 bits of + * the COMB. To generate a timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along with the + * CombGenerator as the random generator. + * + * ``` + * $factory = new UuidFactory(); + * + * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); + * + * $factory->setRandomGenerator(new CombGenerator( + * $factory->getRandomGenerator(), + * $factory->getNumberConverter(), + * )); + * + * $timestampFirstComb = $factory->uuid4(); + * ``` + * + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version7.html Version 7, Unix Epoch Time UUIDs}. + * + * @link https://web.archive.org/web/20240118030355/https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys + * + * @immutable + */ +class TimestampFirstCombCodec extends StringCodec +{ + /** + * @return non-empty-string + */ + public function encode(UuidInterface $uuid): string + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $bytes = $this->swapBytes($uuid->getFields()->getBytes()); + + return sprintf( + '%08s-%04s-%04s-%04s-%012s', + bin2hex(substr($bytes, 0, 4)), + bin2hex(substr($bytes, 4, 2)), + bin2hex(substr($bytes, 6, 2)), + bin2hex(substr($bytes, 8, 2)), + bin2hex(substr($bytes, 10)) + ); + } + + /** + * @return non-empty-string + */ + public function encodeBinary(UuidInterface $uuid): string + { + /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ + return $this->swapBytes($uuid->getFields()->getBytes()); + } + + /** + * @throws InvalidUuidStringException + * + * @inheritDoc + */ + public function decode(string $encodedUuid): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $bytes = $this->getBytes($encodedUuid); + + /** @phpstan-ignore possiblyImpure.methodCall */ + return $this->getBuilder()->build($this, $this->swapBytes($bytes)); + } + + public function decodeBytes(string $bytes): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return $this->getBuilder()->build($this, $this->swapBytes($bytes)); + } + + /** + * Swaps bytes according to the timestamp-first COMB rules + * + * @pure + */ + private function swapBytes(string $bytes): string + { + $first48Bits = substr($bytes, 0, 6); + $last48Bits = substr($bytes, -6); + + return substr_replace(substr_replace($bytes, $last48Bits, 0, 6), $first48Bits, -6); + } +} diff --git a/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php b/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php new file mode 100644 index 0000000..14d10b6 --- /dev/null +++ b/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php @@ -0,0 +1,48 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Codec; + +/** + * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the last 48 bits + * + * The CombGenerator when used with the StringCodec (and, by proxy, the TimestampLastCombCodec) adds the timestamp to + * the last 48 bits of the COMB. The TimestampLastCombCodec is provided for the sake of consistency. In practice, it is + * identical to the standard StringCodec, but it may be used with the CombGenerator for additional context when reading + * code. + * + * Consider the following code. By default, the codec used by UuidFactory is the StringCodec, but here, we explicitly + * set the TimestampLastCombCodec. It is redundant, but it is clear that we intend this COMB to be generated with the + * timestamp appearing at the end. + * + * ``` + * $factory = new UuidFactory(); + * + * $factory->setCodec(new TimestampLastCombCodec($factory->getUuidBuilder())); + * + * $factory->setRandomGenerator(new CombGenerator( + * $factory->getRandomGenerator(), + * $factory->getNumberConverter(), + * )); + * + * $timestampLastComb = $factory->uuid4(); + * ``` + * + * @deprecated Please use {@see StringCodec} instead. + * + * @immutable + */ +class TimestampLastCombCodec extends StringCodec +{ +} diff --git a/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php new file mode 100644 index 0000000..ff4e1cc --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php @@ -0,0 +1,52 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Number; + +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Math\BrickMathCalculator; + +/** + * Previously used to integrate moontoast/math as a bignum arithmetic library, BigNumberConverter is deprecated in favor + * of GenericNumberConverter + * + * @deprecated Please transition to {@see GenericNumberConverter}. + * + * @immutable + */ +class BigNumberConverter implements NumberConverterInterface +{ + private NumberConverterInterface $converter; + + public function __construct() + { + $this->converter = new GenericNumberConverter(new BrickMathCalculator()); + } + + /** + * @pure + */ + public function fromHex(string $hex): string + { + return $this->converter->fromHex($hex); + } + + /** + * @pure + */ + public function toHex(string $number): string + { + return $this->converter->toHex($number); + } +} diff --git a/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php new file mode 100644 index 0000000..54e4e8c --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php @@ -0,0 +1,25 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Number; + +/** + * @deprecated DegradedNumberConverter is no longer necessary for converting numbers on 32-bit systems. Please + * transition to {@see GenericNumberConverter}. + * + * @immutable + */ +class DegradedNumberConverter extends BigNumberConverter +{ +} diff --git a/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php new file mode 100644 index 0000000..86968ab --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php @@ -0,0 +1,48 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Number; + +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Math\CalculatorInterface; +use Ramsey\Uuid\Type\Integer as IntegerObject; + +/** + * GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values + * + * @immutable + */ +class GenericNumberConverter implements NumberConverterInterface +{ + public function __construct(private CalculatorInterface $calculator) + { + } + + /** + * @pure + */ + public function fromHex(string $hex): string + { + return $this->calculator->fromBase($hex, 16)->toString(); + } + + /** + * @pure + */ + public function toHex(string $number): string + { + /** @phpstan-ignore return.type, possiblyImpure.new */ + return $this->calculator->toBase(new IntegerObject($number), 16); + } +} diff --git a/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php b/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php new file mode 100644 index 0000000..63eca6c --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php @@ -0,0 +1,49 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter; + +/** + * A number converter converts UUIDs from hexadecimal characters into representations of integers and vice versa + * + * @immutable + */ +interface NumberConverterInterface +{ + /** + * Converts a hexadecimal number into a string integer representation of the number + * + * The integer representation returned is a string representation of the integer to accommodate unsigned integers + * that are greater than `PHP_INT_MAX`. + * + * @param string $hex The hexadecimal string representation to convert + * + * @return numeric-string String representation of an integer + * + * @pure + */ + public function fromHex(string $hex): string; + + /** + * Converts a string integer representation into a hexadecimal string representation of the number + * + * @param string $number A string integer representation to convert; this must be a numeric string to accommodate + * unsigned integers that are greater than `PHP_INT_MAX`. + * + * @return non-empty-string Hexadecimal string + * + * @pure + */ + public function toHex(string $number): string; +} diff --git a/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php new file mode 100644 index 0000000..7112495 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php @@ -0,0 +1,48 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Time; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Math\BrickMathCalculator; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Time; + +/** + * Previously used to integrate moontoast/math as a bignum arithmetic library, BigNumberTimeConverter is deprecated in + * favor of GenericTimeConverter + * + * @deprecated Please transition to {@see GenericTimeConverter}. + * + * @immutable + */ +class BigNumberTimeConverter implements TimeConverterInterface +{ + private TimeConverterInterface $converter; + + public function __construct() + { + $this->converter = new GenericTimeConverter(new BrickMathCalculator()); + } + + public function calculateTime(string $seconds, string $microseconds): Hexadecimal + { + return $this->converter->calculateTime($seconds, $microseconds); + } + + public function convertTime(Hexadecimal $uuidTimestamp): Time + { + return $this->converter->convertTime($uuidTimestamp); + } +} diff --git a/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php new file mode 100644 index 0000000..4720450 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php @@ -0,0 +1,25 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Time; + +/** + * @deprecated DegradedTimeConverter is no longer necessary for converting time on 32-bit systems. Please transition to + * {@see GenericTimeConverter}. + * + * @immutable + */ +class DegradedTimeConverter extends BigNumberTimeConverter +{ +} diff --git a/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php new file mode 100644 index 0000000..1079e88 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php @@ -0,0 +1,112 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Time; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Math\CalculatorInterface; +use Ramsey\Uuid\Math\RoundingMode; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\Time; + +use function explode; +use function str_pad; + +use const STR_PAD_LEFT; + +/** + * GenericTimeConverter uses the provided calculator to calculate and convert time values + * + * @immutable + */ +class GenericTimeConverter implements TimeConverterInterface +{ + /** + * The number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix epoch. + */ + private const GREGORIAN_TO_UNIX_INTERVALS = '122192928000000000'; + + /** + * The number of 100-nanosecond intervals in one second. + */ + private const SECOND_INTERVALS = '10000000'; + + /** + * The number of 100-nanosecond intervals in one microsecond. + */ + private const MICROSECOND_INTERVALS = '10'; + + public function __construct(private CalculatorInterface $calculator) + { + } + + public function calculateTime(string $seconds, string $microseconds): Hexadecimal + { + /** @phpstan-ignore possiblyImpure.new */ + $timestamp = new Time($seconds, $microseconds); + + // Convert the seconds into a count of 100-nanosecond intervals. + $sec = $this->calculator->multiply( + $timestamp->getSeconds(), + new IntegerObject(self::SECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ + ); + + // Convert the microseconds into a count of 100-nanosecond intervals. + $usec = $this->calculator->multiply( + $timestamp->getMicroseconds(), + new IntegerObject(self::MICROSECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ + ); + + /** + * Combine the intervals of seconds and microseconds and add the count of 100-nanosecond intervals from the + * Gregorian calendar epoch to the Unix epoch. This gives us the correct count of 100-nanosecond intervals since + * the Gregorian calendar epoch for the given seconds and microseconds. + * + * @var IntegerObject $uuidTime + * @phpstan-ignore possiblyImpure.new + */ + $uuidTime = $this->calculator->add($sec, $usec, new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS)); + + /** + * PHPStan considers CalculatorInterface::toHexadecimal, Hexadecimal:toString impure. + * + * @phpstan-ignore possiblyImpure.new + */ + return new Hexadecimal(str_pad($this->calculator->toHexadecimal($uuidTime)->toString(), 16, '0', STR_PAD_LEFT)); + } + + public function convertTime(Hexadecimal $uuidTimestamp): Time + { + // From the total, subtract the number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix + // epoch. This gives us the number of 100-nanosecond intervals from the Unix epoch, which also includes the microtime. + $epochNanoseconds = $this->calculator->subtract( + $this->calculator->toInteger($uuidTimestamp), + new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ + ); + + // Convert the 100-nanosecond intervals into seconds and microseconds. + $unixTimestamp = $this->calculator->divide( + RoundingMode::HALF_UP, + 6, + $epochNanoseconds, + new IntegerObject(self::SECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ + ); + + $split = explode('.', (string) $unixTimestamp, 2); + + /** @phpstan-ignore possiblyImpure.new */ + return new Time($split[0], $split[1] ?? 0); + } +} diff --git a/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php new file mode 100644 index 0000000..67dbf88 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php @@ -0,0 +1,170 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Time; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Math\BrickMathCalculator; +use Ramsey\Uuid\Math\CalculatorInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\Time; + +use function count; +use function dechex; +use function explode; +use function is_float; +use function is_int; +use function str_pad; +use function strlen; +use function substr; + +use const STR_PAD_LEFT; +use const STR_PAD_RIGHT; + +/** + * PhpTimeConverter uses built-in PHP functions and standard math operations available to the PHP programming language + * to provide facilities for converting parts of time into representations that may be used in UUIDs + * + * @immutable + */ +class PhpTimeConverter implements TimeConverterInterface +{ + /** + * The number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix epoch. + */ + private const GREGORIAN_TO_UNIX_INTERVALS = 0x01b21dd213814000; + + /** + * The number of 100-nanosecond intervals in one second. + */ + private const SECOND_INTERVALS = 10_000_000; + + /** + * The number of 100-nanosecond intervals in one microsecond. + */ + private const MICROSECOND_INTERVALS = 10; + + private int $phpPrecision; + private CalculatorInterface $calculator; + private TimeConverterInterface $fallbackConverter; + + public function __construct( + ?CalculatorInterface $calculator = null, + ?TimeConverterInterface $fallbackConverter = null, + ) { + if ($calculator === null) { + $calculator = new BrickMathCalculator(); + } + + if ($fallbackConverter === null) { + $fallbackConverter = new GenericTimeConverter($calculator); + } + + $this->calculator = $calculator; + $this->fallbackConverter = $fallbackConverter; + $this->phpPrecision = (int) ini_get('precision'); + } + + public function calculateTime(string $seconds, string $microseconds): Hexadecimal + { + $seconds = new IntegerObject($seconds); /** @phpstan-ignore possiblyImpure.new */ + $microseconds = new IntegerObject($microseconds); /** @phpstan-ignore possiblyImpure.new */ + + // Calculate the count of 100-nanosecond intervals since the Gregorian calendar epoch + // for the given seconds and microseconds. + $uuidTime = ((int) $seconds->toString() * self::SECOND_INTERVALS) + + ((int) $microseconds->toString() * self::MICROSECOND_INTERVALS) + + self::GREGORIAN_TO_UNIX_INTERVALS; + + // Check to see whether we've overflowed the max/min integer size. + // If so, we will default to a different time converter. + // @phpstan-ignore function.alreadyNarrowedType (the integer value might have overflowed) + if (!is_int($uuidTime)) { + return $this->fallbackConverter->calculateTime( + $seconds->toString(), + $microseconds->toString(), + ); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new Hexadecimal( + str_pad(dechex($uuidTime), 16, '0', STR_PAD_LEFT) + ); + } + + public function convertTime(Hexadecimal $uuidTimestamp): Time + { + $timestamp = $this->calculator->toInteger($uuidTimestamp); + + // Convert the 100-nanosecond intervals into seconds and microseconds. + $splitTime = $this->splitTime( + ((int) $timestamp->toString() - self::GREGORIAN_TO_UNIX_INTERVALS) / self::SECOND_INTERVALS, + ); + + if (count($splitTime) === 0) { + return $this->fallbackConverter->convertTime($uuidTimestamp); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new Time($splitTime['sec'], $splitTime['usec']); + } + + /** + * @param float | int $time The time to split into seconds and microseconds + * + * @return string[] + * + * @pure + */ + private function splitTime(float | int $time): array + { + $split = explode('.', (string) $time, 2); + + // If the $time value is a float but $split only has 1 element, then the float math was rounded up to the next + // second, so we want to return an empty array to allow use of the fallback converter. + if (is_float($time) && count($split) === 1) { + return []; + } + + if (count($split) === 1) { + return ['sec' => $split[0], 'usec' => '0']; + } + + // If the microseconds are less than six characters AND the length of the number is greater than or equal to the + // PHP precision, then it's possible that we lost some precision for the microseconds. Return an empty array so + // that we can choose to use the fallback converter. + if (strlen($split[1]) < 6 && strlen((string) $time) >= $this->phpPrecision) { + return []; + } + + $microseconds = $split[1]; + + // Ensure the microseconds are no longer than 6 digits. If they are, + // truncate the number to the first 6 digits and round up, if needed. + if (strlen($microseconds) > 6) { + $roundingDigit = (int) substr($microseconds, 6, 1); + $microseconds = (int) substr($microseconds, 0, 6); + + if ($roundingDigit >= 5) { + $microseconds++; + } + } + + return [ + 'sec' => $split[0], + 'usec' => str_pad((string) $microseconds, 6, '0', STR_PAD_RIGHT), + ]; + } +} diff --git a/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php new file mode 100644 index 0000000..4bd4125 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php @@ -0,0 +1,92 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter\Time; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Math\CalculatorInterface; +use Ramsey\Uuid\Math\RoundingMode; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\Time; + +use function explode; +use function str_pad; + +use const STR_PAD_LEFT; + +/** + * UnixTimeConverter converts Unix Epoch timestamps to/from hexadecimal values consisting of milliseconds elapsed since + * the Unix Epoch + * + * @immutable + */ +class UnixTimeConverter implements TimeConverterInterface +{ + private const MILLISECONDS = 1000; + + public function __construct(private CalculatorInterface $calculator) + { + } + + public function calculateTime(string $seconds, string $microseconds): Hexadecimal + { + /** @phpstan-ignore possiblyImpure.new */ + $timestamp = new Time($seconds, $microseconds); + + // Convert the seconds into milliseconds. + $sec = $this->calculator->multiply( + $timestamp->getSeconds(), + new IntegerObject(self::MILLISECONDS) /** @phpstan-ignore possiblyImpure.new */ + ); + + // Convert the microseconds into milliseconds; the scale is zero because we need to discard the fractional part. + $usec = $this->calculator->divide( + RoundingMode::DOWN, // Always round down to stay in the previous millisecond. + 0, + $timestamp->getMicroseconds(), + new IntegerObject(self::MILLISECONDS), /** @phpstan-ignore possiblyImpure.new */ + ); + + /** @var IntegerObject $unixTime */ + $unixTime = $this->calculator->add($sec, $usec); + + /** @phpstan-ignore possiblyImpure.new */ + return new Hexadecimal( + str_pad( + $this->calculator->toHexadecimal($unixTime)->toString(), + 12, + '0', + STR_PAD_LEFT + ), + ); + } + + public function convertTime(Hexadecimal $uuidTimestamp): Time + { + $milliseconds = $this->calculator->toInteger($uuidTimestamp); + + $unixTimestamp = $this->calculator->divide( + RoundingMode::HALF_UP, + 6, + $milliseconds, + new IntegerObject(self::MILLISECONDS), /** @phpstan-ignore possiblyImpure.new */ + ); + + $split = explode('.', (string) $unixTimestamp, 2); + + /** @phpstan-ignore possiblyImpure.new */ + return new Time($split[0], $split[1] ?? '0'); + } +} diff --git a/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php b/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php new file mode 100644 index 0000000..065e3b7 --- /dev/null +++ b/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php @@ -0,0 +1,53 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Converter; + +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Time; + +/** + * A time converter converts timestamps into representations that may be used in UUIDs + * + * @immutable + */ +interface TimeConverterInterface +{ + /** + * Uses the provided seconds and micro-seconds to calculate the count of 100-nanosecond intervals since + * UTC 00:00:00.00, 15 October 1582, for RFC 9562 (formerly RFC 4122) variant UUIDs + * + * @link https://www.rfc-editor.org/rfc/rfc9562#appendix-A RFC 9562, Appendix A. Test Vectors + * + * @param string $seconds A string representation of seconds since the Unix epoch for the time to calculate + * @param string $microseconds A string representation of the micro-seconds associated with the time to calculate + * + * @return Hexadecimal The full UUID timestamp as a Hexadecimal value + * + * @pure + */ + public function calculateTime(string $seconds, string $microseconds): Hexadecimal; + + /** + * Converts a timestamp extracted from a UUID to a Unix timestamp + * + * @param Hexadecimal $uuidTimestamp A hexadecimal representation of a UUID timestamp; a UUID timestamp is a count + * of 100-nanosecond intervals since UTC 00:00:00.00, 15 October 1582. + * + * @return Time An instance of {@see Time} + * + * @pure + */ + public function convertTime(Hexadecimal $uuidTimestamp): Time; +} diff --git a/vendor/ramsey/uuid/src/DegradedUuid.php b/vendor/ramsey/uuid/src/DegradedUuid.php new file mode 100644 index 0000000..169976e --- /dev/null +++ b/vendor/ramsey/uuid/src/DegradedUuid.php @@ -0,0 +1,25 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +/** + * @deprecated DegradedUuid is no longer necessary to represent UUIDs on 32-bit systems. + * Transition any type declarations using this class to {@see UuidInterface}. + * + * @immutable + */ +class DegradedUuid extends Uuid +{ +} diff --git a/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php b/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php new file mode 100644 index 0000000..91dbbc6 --- /dev/null +++ b/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php @@ -0,0 +1,126 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use DateTimeInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; + +/** + * This interface encapsulates deprecated methods for ramsey/uuid + * + * @immutable + */ +interface DeprecatedUuidInterface +{ + /** + * @deprecated This method will be removed in 5.0.0. There is no alternative recommendation, so plan accordingly. + */ + public function getNumberConverter(): NumberConverterInterface; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. + * + * @return string[] + */ + public function getFieldsHex(): array; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. + */ + public function getClockSeqHiAndReservedHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. + */ + public function getClockSeqLowHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. + */ + public function getClockSequenceHex(): string; + + /** + * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the interface. It is available at + * {@see UuidV1::getDateTime()}. + */ + public function getDateTime(): DateTimeInterface; + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getLeastSignificantBitsHex(): string; + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getMostSignificantBitsHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. + */ + public function getNodeHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. + */ + public function getTimeHiAndVersionHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. + */ + public function getTimeLowHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. + */ + public function getTimeMidHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. + */ + public function getTimestampHex(): string; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. + */ + public function getVariant(): ?int; + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. + */ + public function getVersion(): ?int; +} diff --git a/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php b/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php new file mode 100644 index 0000000..fb88578 --- /dev/null +++ b/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php @@ -0,0 +1,326 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use DateTimeImmutable; +use DateTimeInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Exception\DateTimeException; +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Throwable; + +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + +/** + * This trait encapsulates deprecated methods for ramsey/uuid; this trait and its methods will be removed in ramsey/uuid 5.0.0. + * + * @deprecated This trait and its methods will be removed in ramsey/uuid 5.0.0. + * + * @immutable + */ +trait DeprecatedUuidMethodsTrait +{ + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()} and use the arbitrary-precision math + * library of your choice to convert it to a string integer. + */ + public function getClockSeqHiAndReserved(): string + { + return $this->numberConverter->fromHex($this->fields->getClockSeqHiAndReserved()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. + */ + public function getClockSeqHiAndReservedHex(): string + { + return $this->fields->getClockSeqHiAndReserved()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. + */ + public function getClockSeqLow(): string + { + return $this->numberConverter->fromHex($this->fields->getClockSeqLow()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. + */ + public function getClockSeqLowHex(): string + { + return $this->fields->getClockSeqLow()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. + */ + public function getClockSequence(): string + { + return $this->numberConverter->fromHex($this->fields->getClockSeq()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. + */ + public function getClockSequenceHex(): string + { + return $this->fields->getClockSeq()->toString(); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no alternative recommendation, so plan accordingly. + */ + public function getNumberConverter(): NumberConverterInterface + { + return $this->numberConverter; + } + + /** + * @deprecated In ramsey/uuid version 5.0.0, this will be removed. It is available at {@see UuidV1::getDateTime()}. + * + * @return DateTimeImmutable An immutable instance of DateTimeInterface + * + * @throws UnsupportedOperationException if UUID is not time-based + * @throws DateTimeException if DateTime throws an exception/error + */ + public function getDateTime(): DateTimeInterface + { + if ($this->fields->getVersion() !== 1) { + throw new UnsupportedOperationException('Not a time-based UUID'); + } + + $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); + + try { + return new DateTimeImmutable( + '@' + . $time->getSeconds()->toString() + . '.' + . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) + ); + } catch (Throwable $e) { + throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); + } + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * + * @return string[] + */ + public function getFieldsHex(): array + { + return [ + 'time_low' => $this->fields->getTimeLow()->toString(), + 'time_mid' => $this->fields->getTimeMid()->toString(), + 'time_hi_and_version' => $this->fields->getTimeHiAndVersion()->toString(), + 'clock_seq_hi_and_reserved' => $this->fields->getClockSeqHiAndReserved()->toString(), + 'clock_seq_low' => $this->fields->getClockSeqLow()->toString(), + 'node' => $this->fields->getNode()->toString(), + ]; + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getLeastSignificantBits(): string + { + $leastSignificantHex = substr($this->getHex()->toString(), 16); + + return $this->numberConverter->fromHex($leastSignificantHex); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getLeastSignificantBitsHex(): string + { + return substr($this->getHex()->toString(), 16); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getMostSignificantBits(): string + { + $mostSignificantHex = substr($this->getHex()->toString(), 0, 16); + + return $this->numberConverter->fromHex($mostSignificantHex); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getMostSignificantBitsHex(): string + { + return substr($this->getHex()->toString(), 0, 16); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()} and use the arbitrary-precision math library of your + * choice to convert it to a string integer. + */ + public function getNode(): string + { + return $this->numberConverter->fromHex($this->fields->getNode()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. + */ + public function getNodeHex(): string + { + return $this->fields->getNode()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()} and use the arbitrary-precision math + * library of your choice to convert it to a string integer. + */ + public function getTimeHiAndVersion(): string + { + return $this->numberConverter->fromHex($this->fields->getTimeHiAndVersion()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. + */ + public function getTimeHiAndVersionHex(): string + { + return $this->fields->getTimeHiAndVersion()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. + */ + public function getTimeLow(): string + { + return $this->numberConverter->fromHex($this->fields->getTimeLow()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. + */ + public function getTimeLowHex(): string + { + return $this->fields->getTimeLow()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. + */ + public function getTimeMid(): string + { + return $this->numberConverter->fromHex($this->fields->getTimeMid()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. + */ + public function getTimeMidHex(): string + { + return $this->fields->getTimeMid()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. + */ + public function getTimestamp(): string + { + if ($this->fields->getVersion() !== 1) { + throw new UnsupportedOperationException('Not a time-based UUID'); + } + + return $this->numberConverter->fromHex($this->fields->getTimestamp()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. + */ + public function getTimestampHex(): string + { + if ($this->fields->getVersion() !== 1) { + throw new UnsupportedOperationException('Not a time-based UUID'); + } + + return $this->fields->getTimestamp()->toString(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. + */ + public function getVariant(): ?int + { + return $this->fields->getVariant(); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. + */ + public function getVersion(): ?int + { + return $this->fields->getVersion(); + } +} diff --git a/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php b/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php new file mode 100644 index 0000000..220ffed --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that no suitable builder could be found + */ +class BuilderNotFoundException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/DateTimeException.php b/vendor/ramsey/uuid/src/Exception/DateTimeException.php new file mode 100644 index 0000000..5f0e658 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/DateTimeException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that the PHP DateTime extension encountered an exception/error + */ +class DateTimeException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/DceSecurityException.php b/vendor/ramsey/uuid/src/Exception/DceSecurityException.php new file mode 100644 index 0000000..bd8ca4c --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/DceSecurityException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate an exception occurred while dealing with DCE Security (version 2) UUIDs + */ +class DceSecurityException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php b/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php new file mode 100644 index 0000000..2a1fa3a --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use InvalidArgumentException as PhpInvalidArgumentException; + +/** + * Thrown to indicate that the argument received is not valid + */ +class InvalidArgumentException extends PhpInvalidArgumentException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php b/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php new file mode 100644 index 0000000..1c94f65 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that the bytes being operated on are invalid in some way + */ +class InvalidBytesException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php b/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php new file mode 100644 index 0000000..cfc7eee --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php @@ -0,0 +1,25 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +/** + * Thrown to indicate that the string received is not a valid UUID + * + * The InvalidArgumentException that this extends is the ramsey/uuid version of this exception. It exists in the same + * namespace as this class. + */ +class InvalidUuidStringException extends InvalidArgumentException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/NameException.php b/vendor/ramsey/uuid/src/Exception/NameException.php new file mode 100644 index 0000000..ee72e16 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/NameException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that an error occurred while attempting to hash a namespace and name + */ +class NameException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/NodeException.php b/vendor/ramsey/uuid/src/Exception/NodeException.php new file mode 100644 index 0000000..0dbdd50 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/NodeException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that attempting to fetch or create a node ID encountered an error + */ +class NodeException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/RandomSourceException.php b/vendor/ramsey/uuid/src/Exception/RandomSourceException.php new file mode 100644 index 0000000..7b24604 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/RandomSourceException.php @@ -0,0 +1,27 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that the source of random data encountered an error + * + * This exception is used mostly to indicate that random_bytes() or random_int() threw an exception. However, it may be + * used for other sources of random data. + */ +class RandomSourceException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/TimeSourceException.php b/vendor/ramsey/uuid/src/Exception/TimeSourceException.php new file mode 100644 index 0000000..fc9cf36 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/TimeSourceException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate that the source of time encountered an error + */ +class TimeSourceException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php b/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php new file mode 100644 index 0000000..5ba26d8 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use RuntimeException as PhpRuntimeException; + +/** + * Thrown to indicate a builder is unable to build a UUID + */ +class UnableToBuildUuidException extends PhpRuntimeException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php b/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php new file mode 100644 index 0000000..e1b3eda --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php @@ -0,0 +1,24 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use LogicException as PhpLogicException; + +/** + * Thrown to indicate that the requested operation is not supported + */ +class UnsupportedOperationException extends PhpLogicException implements UuidExceptionInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php b/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php new file mode 100644 index 0000000..a2f1c10 --- /dev/null +++ b/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php @@ -0,0 +1,21 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Exception; + +use Throwable; + +interface UuidExceptionInterface extends Throwable +{ +} diff --git a/vendor/ramsey/uuid/src/FeatureSet.php b/vendor/ramsey/uuid/src/FeatureSet.php new file mode 100644 index 0000000..88ce7c4 --- /dev/null +++ b/vendor/ramsey/uuid/src/FeatureSet.php @@ -0,0 +1,383 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use Ramsey\Uuid\Builder\FallbackBuilder; +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Codec\GuidStringCodec; +use Ramsey\Uuid\Codec\StringCodec; +use Ramsey\Uuid\Converter\Number\GenericNumberConverter; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\Time\GenericTimeConverter; +use Ramsey\Uuid\Converter\Time\PhpTimeConverter; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Generator\DceSecurityGenerator; +use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; +use Ramsey\Uuid\Generator\NameGeneratorFactory; +use Ramsey\Uuid\Generator\NameGeneratorInterface; +use Ramsey\Uuid\Generator\PeclUuidNameGenerator; +use Ramsey\Uuid\Generator\PeclUuidRandomGenerator; +use Ramsey\Uuid\Generator\PeclUuidTimeGenerator; +use Ramsey\Uuid\Generator\RandomGeneratorFactory; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; +use Ramsey\Uuid\Generator\TimeGeneratorFactory; +use Ramsey\Uuid\Generator\TimeGeneratorInterface; +use Ramsey\Uuid\Generator\UnixTimeGenerator; +use Ramsey\Uuid\Guid\GuidBuilder; +use Ramsey\Uuid\Math\BrickMathCalculator; +use Ramsey\Uuid\Math\CalculatorInterface; +use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; +use Ramsey\Uuid\Provider\Dce\SystemDceSecurityProvider; +use Ramsey\Uuid\Provider\DceSecurityProviderInterface; +use Ramsey\Uuid\Provider\Node\FallbackNodeProvider; +use Ramsey\Uuid\Provider\Node\RandomNodeProvider; +use Ramsey\Uuid\Provider\Node\SystemNodeProvider; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Provider\Time\SystemTimeProvider; +use Ramsey\Uuid\Provider\TimeProviderInterface; +use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; +use Ramsey\Uuid\Validator\GenericValidator; +use Ramsey\Uuid\Validator\ValidatorInterface; + +use const PHP_INT_SIZE; + +/** + * FeatureSet detects and exposes available features in the current environment + * + * A feature set is used by UuidFactory to determine the available features and capabilities of the environment. + */ +class FeatureSet +{ + private ?TimeProviderInterface $timeProvider = null; + private CalculatorInterface $calculator; + private CodecInterface $codec; + private DceSecurityGeneratorInterface $dceSecurityGenerator; + private NameGeneratorInterface $nameGenerator; + private NodeProviderInterface $nodeProvider; + private NumberConverterInterface $numberConverter; + private RandomGeneratorInterface $randomGenerator; + private TimeConverterInterface $timeConverter; + private TimeGeneratorInterface $timeGenerator; + private TimeGeneratorInterface $unixTimeGenerator; + private UuidBuilderInterface $builder; + private ValidatorInterface $validator; + + /** + * @param bool $useGuids True build UUIDs using the GuidStringCodec + * @param bool $force32Bit True to force the use of 32-bit functionality (primarily for testing purposes) + * @param bool $forceNoBigNumber (obsolete) + * @param bool $ignoreSystemNode True to disable attempts to check for the system node ID (primarily for testing purposes) + * @param bool $enablePecl True to enable the use of the PeclUuidTimeGenerator to generate version 1 UUIDs + * + * @phpstan-ignore constructor.unusedParameter ($forceNoBigNumber is deprecated) + */ + public function __construct( + bool $useGuids = false, + private bool $force32Bit = false, + bool $forceNoBigNumber = false, + private bool $ignoreSystemNode = false, + private bool $enablePecl = false, + ) { + $this->randomGenerator = $this->buildRandomGenerator(); + $this->setCalculator(new BrickMathCalculator()); + $this->builder = $this->buildUuidBuilder($useGuids); + $this->codec = $this->buildCodec($useGuids); + $this->nodeProvider = $this->buildNodeProvider(); + $this->nameGenerator = $this->buildNameGenerator(); + $this->setTimeProvider(new SystemTimeProvider()); + $this->setDceSecurityProvider(new SystemDceSecurityProvider()); + $this->validator = new GenericValidator(); + + assert($this->timeProvider !== null); + $this->unixTimeGenerator = $this->buildUnixTimeGenerator(); + } + + /** + * Returns the builder configured for this environment + */ + public function getBuilder(): UuidBuilderInterface + { + return $this->builder; + } + + /** + * Returns the calculator configured for this environment + */ + public function getCalculator(): CalculatorInterface + { + return $this->calculator; + } + + /** + * Returns the codec configured for this environment + */ + public function getCodec(): CodecInterface + { + return $this->codec; + } + + /** + * Returns the DCE Security generator configured for this environment + */ + public function getDceSecurityGenerator(): DceSecurityGeneratorInterface + { + return $this->dceSecurityGenerator; + } + + /** + * Returns the name generator configured for this environment + */ + public function getNameGenerator(): NameGeneratorInterface + { + return $this->nameGenerator; + } + + /** + * Returns the node provider configured for this environment + */ + public function getNodeProvider(): NodeProviderInterface + { + return $this->nodeProvider; + } + + /** + * Returns the number converter configured for this environment + */ + public function getNumberConverter(): NumberConverterInterface + { + return $this->numberConverter; + } + + /** + * Returns the random generator configured for this environment + */ + public function getRandomGenerator(): RandomGeneratorInterface + { + return $this->randomGenerator; + } + + /** + * Returns the time converter configured for this environment + */ + public function getTimeConverter(): TimeConverterInterface + { + return $this->timeConverter; + } + + /** + * Returns the time generator configured for this environment + */ + public function getTimeGenerator(): TimeGeneratorInterface + { + return $this->timeGenerator; + } + + /** + * Returns the Unix Epoch time generator configured for this environment + */ + public function getUnixTimeGenerator(): TimeGeneratorInterface + { + return $this->unixTimeGenerator; + } + + /** + * Returns the validator configured for this environment + */ + public function getValidator(): ValidatorInterface + { + return $this->validator; + } + + /** + * Sets the calculator to use in this environment + */ + public function setCalculator(CalculatorInterface $calculator): void + { + $this->calculator = $calculator; + $this->numberConverter = $this->buildNumberConverter($calculator); + $this->timeConverter = $this->buildTimeConverter($calculator); + + if (isset($this->timeProvider)) { + $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); + } + } + + /** + * Sets the DCE Security provider to use in this environment + */ + public function setDceSecurityProvider(DceSecurityProviderInterface $dceSecurityProvider): void + { + $this->dceSecurityGenerator = $this->buildDceSecurityGenerator($dceSecurityProvider); + } + + /** + * Sets the node provider to use in this environment + */ + public function setNodeProvider(NodeProviderInterface $nodeProvider): void + { + $this->nodeProvider = $nodeProvider; + + if (isset($this->timeProvider)) { + $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); + } + } + + /** + * Sets the time provider to use in this environment + */ + public function setTimeProvider(TimeProviderInterface $timeProvider): void + { + $this->timeProvider = $timeProvider; + $this->timeGenerator = $this->buildTimeGenerator($timeProvider); + } + + /** + * Set the validator to use in this environment + */ + public function setValidator(ValidatorInterface $validator): void + { + $this->validator = $validator; + } + + /** + * Returns a codec configured for this environment + * + * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec + */ + private function buildCodec(bool $useGuids = false): CodecInterface + { + if ($useGuids) { + return new GuidStringCodec($this->builder); + } + + return new StringCodec($this->builder); + } + + /** + * Returns a DCE Security generator configured for this environment + */ + private function buildDceSecurityGenerator( + DceSecurityProviderInterface $dceSecurityProvider, + ): DceSecurityGeneratorInterface { + return new DceSecurityGenerator($this->numberConverter, $this->timeGenerator, $dceSecurityProvider); + } + + /** + * Returns a node provider configured for this environment + */ + private function buildNodeProvider(): NodeProviderInterface + { + if ($this->ignoreSystemNode) { + return new RandomNodeProvider(); + } + + return new FallbackNodeProvider([new SystemNodeProvider(), new RandomNodeProvider()]); + } + + /** + * Returns a number converter configured for this environment + */ + private function buildNumberConverter(CalculatorInterface $calculator): NumberConverterInterface + { + return new GenericNumberConverter($calculator); + } + + /** + * Returns a random generator configured for this environment + */ + private function buildRandomGenerator(): RandomGeneratorInterface + { + if ($this->enablePecl) { + return new PeclUuidRandomGenerator(); + } + + return (new RandomGeneratorFactory())->getGenerator(); + } + + /** + * Returns a time generator configured for this environment + * + * @param TimeProviderInterface $timeProvider The time provider to use with + * the time generator + */ + private function buildTimeGenerator(TimeProviderInterface $timeProvider): TimeGeneratorInterface + { + if ($this->enablePecl) { + return new PeclUuidTimeGenerator(); + } + + return (new TimeGeneratorFactory($this->nodeProvider, $this->timeConverter, $timeProvider))->getGenerator(); + } + + /** + * Returns a Unix Epoch time generator configured for this environment + */ + private function buildUnixTimeGenerator(): TimeGeneratorInterface + { + return new UnixTimeGenerator($this->randomGenerator); + } + + /** + * Returns a name generator configured for this environment + */ + private function buildNameGenerator(): NameGeneratorInterface + { + if ($this->enablePecl) { + return new PeclUuidNameGenerator(); + } + + return (new NameGeneratorFactory())->getGenerator(); + } + + /** + * Returns a time converter configured for this environment + */ + private function buildTimeConverter(CalculatorInterface $calculator): TimeConverterInterface + { + $genericConverter = new GenericTimeConverter($calculator); + + if ($this->is64BitSystem()) { + return new PhpTimeConverter($calculator, $genericConverter); + } + + return $genericConverter; + } + + /** + * Returns a UUID builder configured for this environment + * + * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec + */ + private function buildUuidBuilder(bool $useGuids = false): UuidBuilderInterface + { + if ($useGuids) { + return new GuidBuilder($this->numberConverter, $this->timeConverter); + } + + return new FallbackBuilder([ + new Rfc4122UuidBuilder($this->numberConverter, $this->timeConverter), + new NonstandardUuidBuilder($this->numberConverter, $this->timeConverter), + ]); + } + + /** + * Returns true if the PHP build is 64-bit + */ + private function is64BitSystem(): bool + { + return PHP_INT_SIZE === 8 && !$this->force32Bit; + } +} diff --git a/vendor/ramsey/uuid/src/Fields/FieldsInterface.php b/vendor/ramsey/uuid/src/Fields/FieldsInterface.php new file mode 100644 index 0000000..f17ea88 --- /dev/null +++ b/vendor/ramsey/uuid/src/Fields/FieldsInterface.php @@ -0,0 +1,33 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Fields; + +use Serializable; + +/** + * UUIDs consist of unsigned integers, the bytes of which are separated into fields and arranged in a particular layout + * defined by the specification for the variant + * + * @immutable + */ +interface FieldsInterface extends Serializable +{ + /** + * Returns the bytes that comprise the fields + * + * @pure + */ + public function getBytes(): string; +} diff --git a/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php b/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php new file mode 100644 index 0000000..9ea47c6 --- /dev/null +++ b/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php @@ -0,0 +1,83 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Fields; + +use ValueError; + +use function base64_decode; +use function sprintf; +use function strlen; + +/** + * Provides common serialization functionality to fields + * + * @immutable + */ +trait SerializableFieldsTrait +{ + /** + * @param string $bytes The bytes that comprise the fields + */ + abstract public function __construct(string $bytes); + + /** + * Returns the bytes that comprise the fields + */ + abstract public function getBytes(): string; + + /** + * Returns a string representation of the object + */ + public function serialize(): string + { + return $this->getBytes(); + } + + /** + * @return array{bytes: string} + */ + public function __serialize(): array + { + return ['bytes' => $this->getBytes()]; + } + + /** + * Constructs the object from a serialized string representation + * + * @param string $data The serialized string representation of the object + */ + public function unserialize(string $data): void + { + if (strlen($data) === 16) { + $this->__construct($data); + } else { + $this->__construct(base64_decode($data)); + } + } + + /** + * @param array{bytes?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['bytes'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['bytes']); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/CombGenerator.php b/vendor/ramsey/uuid/src/Generator/CombGenerator.php new file mode 100644 index 0000000..5f6fa1d --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/CombGenerator.php @@ -0,0 +1,112 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; + +use function bin2hex; +use function explode; +use function hex2bin; +use function microtime; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + +/** + * CombGenerator generates COMBs (combined UUID/timestamp) + * + * The CombGenerator, when used with the StringCodec (and, by proxy, the TimestampLastCombCodec) or the + * TimestampFirstCombCodec, combines the current timestamp with a UUID (hence the name "COMB"). The timestamp either + * appears as the first or last 48 bits of the COMB, depending on the codec used. + * + * By default, COMBs will have the timestamp set as the last 48 bits of the identifier. + * + * ``` + * $factory = new UuidFactory(); + * + * $factory->setRandomGenerator(new CombGenerator( + * $factory->getRandomGenerator(), + * $factory->getNumberConverter(), + * )); + * + * $comb = $factory->uuid4(); + * ``` + * + * To generate a COMB with the timestamp as the first 48 bits, set the TimestampFirstCombCodec as the codec. + * + * ``` + * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); + * ``` + * + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version7.html Version 7, Unix Epoch Time UUIDs}. + * + * @link https://web.archive.org/web/20240118030355/https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys + */ +class CombGenerator implements RandomGeneratorInterface +{ + public const TIMESTAMP_BYTES = 6; + + public function __construct( + private RandomGeneratorInterface $generator, + private NumberConverterInterface $numberConverter + ) { + } + + /** + * @throws InvalidArgumentException if $length is not a positive integer greater than or equal to CombGenerator::TIMESTAMP_BYTES + * + * @inheritDoc + */ + public function generate(int $length): string + { + if ($length < self::TIMESTAMP_BYTES) { + throw new InvalidArgumentException( + 'Length must be a positive integer greater than or equal to ' . self::TIMESTAMP_BYTES + ); + } + + if ($length % 2 !== 0) { + throw new InvalidArgumentException('Length must be an even number'); + } + + $hash = ''; + + /** @phpstan-ignore greater.alwaysTrue (TIMESTAMP_BYTES constant could change in child classes) */ + if (self::TIMESTAMP_BYTES > 0 && $length > self::TIMESTAMP_BYTES) { + $hash = $this->generator->generate($length - self::TIMESTAMP_BYTES); + } + + $lsbTime = str_pad( + $this->numberConverter->toHex($this->timestamp()), + self::TIMESTAMP_BYTES * 2, + '0', + STR_PAD_LEFT, + ); + + return (string) hex2bin(str_pad(bin2hex($hash), $length - self::TIMESTAMP_BYTES, '0') . $lsbTime); + } + + /** + * Returns the current timestamp as a string integer, precise to 0.00001 seconds + */ + private function timestamp(): string + { + $time = explode(' ', microtime(false)); + + return $time[1] . substr($time[0], 2, 5); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php new file mode 100644 index 0000000..71192c0 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php @@ -0,0 +1,133 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Exception\DceSecurityException; +use Ramsey\Uuid\Provider\DceSecurityProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Uuid; + +use function hex2bin; +use function in_array; +use function pack; +use function str_pad; +use function strlen; +use function substr_replace; + +use const STR_PAD_LEFT; + +/** + * DceSecurityGenerator generates strings of binary data based on a local domain, local identifier, node ID, clock + * sequence, and the current time + */ +class DceSecurityGenerator implements DceSecurityGeneratorInterface +{ + private const DOMAINS = [ + Uuid::DCE_DOMAIN_PERSON, + Uuid::DCE_DOMAIN_GROUP, + Uuid::DCE_DOMAIN_ORG, + ]; + + /** + * Upper bounds for the clock sequence in DCE Security UUIDs. + */ + private const CLOCK_SEQ_HIGH = 63; + + /** + * Lower bounds for the clock sequence in DCE Security UUIDs. + */ + private const CLOCK_SEQ_LOW = 0; + + public function __construct( + private NumberConverterInterface $numberConverter, + private TimeGeneratorInterface $timeGenerator, + private DceSecurityProviderInterface $dceSecurityProvider, + ) { + } + + public function generate( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): string { + if (!in_array($localDomain, self::DOMAINS)) { + throw new DceSecurityException('Local domain must be a valid DCE Security domain'); + } + + if ($localIdentifier && $localIdentifier->isNegative()) { + throw new DceSecurityException( + 'Local identifier out of bounds; it must be a value between 0 and 4294967295', + ); + } + + if ($clockSeq > self::CLOCK_SEQ_HIGH || $clockSeq < self::CLOCK_SEQ_LOW) { + throw new DceSecurityException('Clock sequence out of bounds; it must be a value between 0 and 63'); + } + + switch ($localDomain) { + case Uuid::DCE_DOMAIN_ORG: + if ($localIdentifier === null) { + throw new DceSecurityException('A local identifier must be provided for the org domain'); + } + + break; + case Uuid::DCE_DOMAIN_PERSON: + if ($localIdentifier === null) { + $localIdentifier = $this->dceSecurityProvider->getUid(); + } + + break; + case Uuid::DCE_DOMAIN_GROUP: + default: + if ($localIdentifier === null) { + $localIdentifier = $this->dceSecurityProvider->getGid(); + } + + break; + } + + $identifierHex = $this->numberConverter->toHex($localIdentifier->toString()); + + // The maximum value for the local identifier is 0xffffffff, or 4,294,967,295. This is 8 hexadecimal digits, so + // if the length of hexadecimal digits is greater than 8, we know the value is greater than 0xffffffff. + if (strlen($identifierHex) > 8) { + throw new DceSecurityException( + 'Local identifier out of bounds; it must be a value between 0 and 4294967295', + ); + } + + $domainByte = pack('n', $localDomain)[1]; + $identifierBytes = (string) hex2bin(str_pad($identifierHex, 8, '0', STR_PAD_LEFT)); + + if ($node instanceof Hexadecimal) { + $node = $node->toString(); + } + + // Shift the clock sequence 8 bits to the left, so it matches 0x3f00. + if ($clockSeq !== null) { + $clockSeq = $clockSeq << 8; + } + + $bytes = $this->timeGenerator->generate($node, $clockSeq); + + // Replace bytes in the time-based UUID with DCE Security values. + $bytes = substr_replace($bytes, $identifierBytes, 0, 4); + + return substr_replace($bytes, $domainByte, 9, 1); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php new file mode 100644 index 0000000..f52eb55 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php @@ -0,0 +1,48 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Rfc4122\UuidV2; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; + +/** + * A DCE Security generator generates strings of binary data based on a local domain, local identifier, node ID, clock + * sequence, and the current time + * + * @see UuidV2 + */ +interface DceSecurityGeneratorInterface +{ + /** + * Generate a binary string from a local domain, local identifier, node ID, clock sequence, and current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems if the local domain is "person" or "group," or it may be a site-defined identifier if the + * local domain is "org" + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return string A binary string + */ + public function generate( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): string; +} diff --git a/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php new file mode 100644 index 0000000..cf37b45 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php @@ -0,0 +1,42 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Exception\NameException; +use Ramsey\Uuid\UuidInterface; +use ValueError; + +use function hash; + +/** + * DefaultNameGenerator generates strings of binary data based on a namespace, name, and hashing algorithm + */ +class DefaultNameGenerator implements NameGeneratorInterface +{ + /** + * @pure + */ + public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string + { + try { + return hash($hashAlgorithm, $ns->getBytes() . $name, true); + } catch (ValueError $e) { + throw new NameException( + message: sprintf('Unable to hash namespace and name with algorithm \'%s\'', $hashAlgorithm), + previous: $e, + ); + } + } +} diff --git a/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php new file mode 100644 index 0000000..6ded59d --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php @@ -0,0 +1,118 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Exception\RandomSourceException; +use Ramsey\Uuid\Exception\TimeSourceException; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Provider\TimeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Throwable; + +use function dechex; +use function hex2bin; +use function is_int; +use function pack; +use function preg_match; +use function sprintf; +use function str_pad; +use function strlen; + +use const STR_PAD_LEFT; + +/** + * DefaultTimeGenerator generates strings of binary data based on a node ID, clock sequence, and the current time + */ +class DefaultTimeGenerator implements TimeGeneratorInterface +{ + public function __construct( + private NodeProviderInterface $nodeProvider, + private TimeConverterInterface $timeConverter, + private TimeProviderInterface $timeProvider, + ) { + } + + /** + * @throws InvalidArgumentException if the parameters contain invalid values + * @throws RandomSourceException if random_int() throws an exception/error + * + * @inheritDoc + */ + public function generate($node = null, ?int $clockSeq = null): string + { + if ($node instanceof Hexadecimal) { + $node = $node->toString(); + } + + $node = $this->getValidNode($node); + + if ($clockSeq === null) { + try { + // This does not use "stable storage"; see RFC 9562, section 6.3. + $clockSeq = random_int(0, 0x3fff); + } catch (Throwable $exception) { + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); + } + } + + $time = $this->timeProvider->getTime(); + + $uuidTime = $this->timeConverter->calculateTime( + $time->getSeconds()->toString(), + $time->getMicroseconds()->toString() + ); + + $timeHex = str_pad($uuidTime->toString(), 16, '0', STR_PAD_LEFT); + + if (strlen($timeHex) !== 16) { + throw new TimeSourceException(sprintf('The generated time of \'%s\' is larger than expected', $timeHex)); + } + + $timeBytes = (string) hex2bin($timeHex); + + return $timeBytes[4] . $timeBytes[5] . $timeBytes[6] . $timeBytes[7] + . $timeBytes[2] . $timeBytes[3] . $timeBytes[0] . $timeBytes[1] + . pack('n*', $clockSeq) . $node; + } + + /** + * Uses the node provider given when constructing this instance to get the node ID (usually a MAC address) + * + * @param int | string | null $node A node value that may be used to override the node provider + * + * @return string 6-byte binary string representation of the node + * + * @throws InvalidArgumentException + */ + private function getValidNode(int | string | null $node): string + { + if ($node === null) { + $node = $this->nodeProvider->getNode(); + } + + // Convert the node to hex if it is still an integer. + if (is_int($node)) { + $node = dechex($node); + } + + if (!preg_match('/^[A-Fa-f0-9]+$/', (string) $node) || strlen((string) $node) > 12) { + throw new InvalidArgumentException('Invalid node value'); + } + + return (string) hex2bin(str_pad((string) $node, 12, '0', STR_PAD_LEFT)); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php new file mode 100644 index 0000000..d68e94b --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php @@ -0,0 +1,29 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +/** + * NameGeneratorFactory retrieves a default name generator, based on the environment + */ +class NameGeneratorFactory +{ + /** + * Returns a default name generator, based on the current environment + */ + public function getGenerator(): NameGeneratorInterface + { + return new DefaultNameGenerator(); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php new file mode 100644 index 0000000..f0fb8da --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php @@ -0,0 +1,37 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\UuidInterface; + +/** + * A name generator generates strings of binary data created by hashing together a namespace with a name, according to a + * hashing algorithm + */ +interface NameGeneratorInterface +{ + /** + * Generate a binary string from a namespace and name hashed together with the specified hashing algorithm + * + * @param UuidInterface $ns The namespace + * @param string $name The name to use for creating a UUID + * @param string $hashAlgorithm The hashing algorithm to use + * + * @return string A binary string + * + * @pure + */ + public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string; +} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php new file mode 100644 index 0000000..d13bafc --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php @@ -0,0 +1,48 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Exception\NameException; +use Ramsey\Uuid\UuidInterface; + +use function sprintf; +use function uuid_generate_md5; +use function uuid_generate_sha1; +use function uuid_parse; + +/** + * PeclUuidNameGenerator generates strings of binary data from a namespace and a name, using ext-uuid + * + * @link https://pecl.php.net/package/uuid ext-uuid + */ +class PeclUuidNameGenerator implements NameGeneratorInterface +{ + /** + * @pure + */ + public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string + { + $uuid = match ($hashAlgorithm) { + 'md5' => uuid_generate_md5($ns->toString(), $name), /** @phpstan-ignore possiblyImpure.functionCall */ + 'sha1' => uuid_generate_sha1($ns->toString(), $name), /** @phpstan-ignore possiblyImpure.functionCall */ + default => throw new NameException( + sprintf('Unable to hash namespace and name with algorithm \'%s\'', $hashAlgorithm), + ), + }; + + /** @phpstan-ignore possiblyImpure.functionCall */ + return (string) uuid_parse($uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php new file mode 100644 index 0000000..6ad45ac --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php @@ -0,0 +1,35 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use function uuid_create; +use function uuid_parse; + +use const UUID_TYPE_RANDOM; + +/** + * PeclUuidRandomGenerator generates strings of random binary data using ext-uuid + * + * @link https://pecl.php.net/package/uuid ext-uuid + */ +class PeclUuidRandomGenerator implements RandomGeneratorInterface +{ + public function generate(int $length): string + { + $uuid = uuid_create(UUID_TYPE_RANDOM); + + return (string) uuid_parse($uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php new file mode 100644 index 0000000..558abf7 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php @@ -0,0 +1,38 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use function uuid_create; +use function uuid_parse; + +use const UUID_TYPE_TIME; + +/** + * PeclUuidTimeGenerator generates strings of binary data for time-base UUIDs, using ext-uuid + * + * @link https://pecl.php.net/package/uuid ext-uuid + */ +class PeclUuidTimeGenerator implements TimeGeneratorInterface +{ + /** + * @inheritDoc + */ + public function generate($node = null, ?int $clockSeq = null): string + { + $uuid = uuid_create(UUID_TYPE_TIME); + + return (string) uuid_parse($uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php b/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php new file mode 100644 index 0000000..c169e63 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php @@ -0,0 +1,40 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Exception\RandomSourceException; +use Throwable; + +/** + * RandomBytesGenerator generates strings of random binary data using the built-in `random_bytes()` PHP function + * + * @link http://php.net/random_bytes random_bytes() + */ +class RandomBytesGenerator implements RandomGeneratorInterface +{ + /** + * @throws RandomSourceException if random_bytes() throws an exception/error + * + * @inheritDoc + */ + public function generate(int $length): string + { + try { + return random_bytes($length); + } catch (Throwable $exception) { + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); + } + } +} diff --git a/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php new file mode 100644 index 0000000..f4c3a6f --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php @@ -0,0 +1,29 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +/** + * RandomGeneratorFactory retrieves a default random generator, based on the environment + */ +class RandomGeneratorFactory +{ + /** + * Returns a default random generator, based on the current environment + */ + public function getGenerator(): RandomGeneratorInterface + { + return new RandomBytesGenerator(); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php new file mode 100644 index 0000000..ddd8732 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php @@ -0,0 +1,30 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +/** + * A random generator generates strings of random binary data + */ +interface RandomGeneratorInterface +{ + /** + * Generates a string of randomized binary data + * + * @param int<1, max> $length The number of bytes to generate of random binary data + * + * @return string A binary string + */ + public function generate(int $length): string; +} diff --git a/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php b/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php new file mode 100644 index 0000000..b6d401d --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php @@ -0,0 +1,54 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use RandomLib\Factory; +use RandomLib\Generator; + +/** + * RandomLibAdapter generates strings of random binary data using the paragonie/random-lib library + * + * @deprecated This class will be removed in 5.0.0. Use the default RandomBytesGenerator or implement your own generator + * that implements RandomGeneratorInterface. + * + * @link https://packagist.org/packages/paragonie/random-lib paragonie/random-lib + */ +class RandomLibAdapter implements RandomGeneratorInterface +{ + private Generator $generator; + + /** + * Constructs a RandomLibAdapter + * + * By default, if no Generator is passed in, this creates a high-strength generator to use when generating random + * binary data. + * + * @param Generator | null $generator The generator to use when generating binary data + */ + public function __construct(?Generator $generator = null) + { + if ($generator === null) { + $factory = new Factory(); + $generator = $factory->getHighStrengthGenerator(); + } + + $this->generator = $generator; + } + + public function generate(int $length): string + { + return $this->generator->generate($length); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php new file mode 100644 index 0000000..433e74c --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php @@ -0,0 +1,40 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Provider\TimeProviderInterface; + +/** + * TimeGeneratorFactory retrieves a default time generator, based on the environment + */ +class TimeGeneratorFactory +{ + public function __construct( + private NodeProviderInterface $nodeProvider, + private TimeConverterInterface $timeConverter, + private TimeProviderInterface $timeProvider, + ) { + } + + /** + * Returns a default time generator, based on the current environment + */ + public function getGenerator(): TimeGeneratorInterface + { + return new DefaultTimeGenerator($this->nodeProvider, $this->timeConverter, $this->timeProvider); + } +} diff --git a/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php new file mode 100644 index 0000000..c15d820 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php @@ -0,0 +1,35 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Ramsey\Uuid\Type\Hexadecimal; + +/** + * A time generator generates strings of binary data based on a node ID, clock sequence, and the current time + */ +interface TimeGeneratorInterface +{ + /** + * Generate a binary string from a node ID, clock sequence, and current time + * + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return string A binary string + */ + public function generate($node = null, ?int $clockSeq = null): string; +} diff --git a/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php new file mode 100644 index 0000000..a2615f1 --- /dev/null +++ b/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php @@ -0,0 +1,165 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Generator; + +use Brick\Math\BigInteger; +use DateTimeInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +use function assert; +use function hash; +use function pack; +use function str_pad; +use function strlen; +use function substr; +use function substr_replace; +use function unpack; + +use const PHP_INT_SIZE; +use const STR_PAD_LEFT; + +/** + * UnixTimeGenerator generates bytes, combining a 48-bit timestamp in milliseconds since the Unix Epoch with 80 random bits + * + * Code and concepts within this class are borrowed from the symfony/uid package and are used under the terms of the MIT + * license distributed with symfony/uid. + * + * symfony/uid is copyright (c) Fabien Potencier. + * + * @link https://symfony.com/components/Uid Symfony Uid component + * @link https://github.com/symfony/uid/blob/4f9f537e57261519808a7ce1d941490736522bbc/UuidV7.php Symfony UuidV7 class + * @link https://github.com/symfony/uid/blob/6.2/LICENSE MIT License + */ +class UnixTimeGenerator implements TimeGeneratorInterface +{ + private static string $time = ''; + private static ?string $seed = null; + private static int $seedIndex = 0; + + /** @var int[] */ + private static array $rand = []; + + /** @var int[] */ + private static array $seedParts; + + public function __construct( + private RandomGeneratorInterface $randomGenerator, + private int $intSize = PHP_INT_SIZE, + ) { + } + + /** + * @param Hexadecimal | int | string | null $node Unused in this generator + * @param int | null $clockSeq Unused in this generator + * @param DateTimeInterface | null $dateTime A date-time instance to use when generating bytes + */ + public function generate($node = null, ?int $clockSeq = null, ?DateTimeInterface $dateTime = null): string + { + if ($dateTime === null) { + $time = microtime(false); + $time = substr($time, 11) . substr($time, 2, 3); + } else { + $time = $dateTime->format('Uv'); + } + + if ($time > self::$time || ($dateTime !== null && $time !== self::$time)) { + $this->randomize($time); + } else { + $time = $this->increment(); + } + + if ($this->intSize >= 8) { + $time = substr(pack('J', (int) $time), -6); + } else { + $time = str_pad(BigInteger::of($time)->toBytes(false), 6, "\x00", STR_PAD_LEFT); + } + + assert(strlen($time) === 6); + + return $time . pack('n*', self::$rand[1], self::$rand[2], self::$rand[3], self::$rand[4], self::$rand[5]); + } + + private function randomize(string $time): void + { + if (self::$seed === null) { + $seed = $this->randomGenerator->generate(16); + self::$seed = $seed; + } else { + $seed = $this->randomGenerator->generate(10); + } + + /** @var int[] $rand */ + $rand = unpack('n*', $seed); + $rand[1] &= 0x03ff; + + self::$rand = $rand; + self::$time = $time; + } + + /** + * Special thanks to Nicolas Grekas () for sharing the following information: + * + * Within the same ms, we increment the rand part by a random 24-bit number. + * + * Instead of getting this number from random_bytes(), which is slow, we get it by sha512-hashing self::$seed. This + * produces 64 bytes of entropy, which we need to split in a list of 24-bit numbers. `unpack()` first splits them + * into 16 x 32-bit numbers; we take the first byte of each number to get 5 extra 24-bit numbers. Then, we consume + * each number one-by-one and run this logic every 21 iterations. + * + * `self::$rand` holds the random part of the UUID, split into 5 x 16-bit numbers for x86 portability. We increment + * this random part by the next 24-bit number in the `self::$seedParts` list and decrement `self::$seedIndex`. + */ + private function increment(): string + { + if (self::$seedIndex === 0 && self::$seed !== null) { + self::$seed = hash('sha512', self::$seed, true); + + /** @var int[] $s */ + $s = unpack('l*', self::$seed); + $s[] = ($s[1] >> 8 & 0xff0000) | ($s[2] >> 16 & 0xff00) | ($s[3] >> 24 & 0xff); + $s[] = ($s[4] >> 8 & 0xff0000) | ($s[5] >> 16 & 0xff00) | ($s[6] >> 24 & 0xff); + $s[] = ($s[7] >> 8 & 0xff0000) | ($s[8] >> 16 & 0xff00) | ($s[9] >> 24 & 0xff); + $s[] = ($s[10] >> 8 & 0xff0000) | ($s[11] >> 16 & 0xff00) | ($s[12] >> 24 & 0xff); + $s[] = ($s[13] >> 8 & 0xff0000) | ($s[14] >> 16 & 0xff00) | ($s[15] >> 24 & 0xff); + + self::$seedParts = $s; + self::$seedIndex = 21; + } + + self::$rand[5] = 0xffff & $carry = self::$rand[5] + 1 + (self::$seedParts[self::$seedIndex--] & 0xffffff); + self::$rand[4] = 0xffff & $carry = self::$rand[4] + ($carry >> 16); + self::$rand[3] = 0xffff & $carry = self::$rand[3] + ($carry >> 16); + self::$rand[2] = 0xffff & $carry = self::$rand[2] + ($carry >> 16); + self::$rand[1] += $carry >> 16; + + if (0xfc00 & self::$rand[1]) { + $time = self::$time; + $mtime = (int) substr($time, -9); + + if ($this->intSize >= 8 || strlen($time) < 10) { + $time = (string) ((int) $time + 1); + } elseif ($mtime === 999999999) { + $time = (1 + (int) substr($time, 0, -9)) . '000000000'; + } else { + $mtime++; + $time = substr_replace($time, str_pad((string) $mtime, 9, '0', STR_PAD_LEFT), -9); + } + + $this->randomize($time); + } + + return self::$time; + } +} diff --git a/vendor/ramsey/uuid/src/Guid/Fields.php b/vendor/ramsey/uuid/src/Guid/Fields.php new file mode 100644 index 0000000..58aa5e1 --- /dev/null +++ b/vendor/ramsey/uuid/src/Guid/Fields.php @@ -0,0 +1,180 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Guid; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Fields\SerializableFieldsTrait; +use Ramsey\Uuid\Rfc4122\FieldsInterface; +use Ramsey\Uuid\Rfc4122\MaxTrait; +use Ramsey\Uuid\Rfc4122\NilTrait; +use Ramsey\Uuid\Rfc4122\VariantTrait; +use Ramsey\Uuid\Rfc4122\VersionTrait; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Uuid; + +use function bin2hex; +use function dechex; +use function hexdec; +use function pack; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + +/** + * GUIDs consist of a set of named fields, according to RFC 9562 (formerly RFC 4122) + * + * @see Guid + * + * @immutable + */ +final class Fields implements FieldsInterface +{ + use MaxTrait; + use NilTrait; + use SerializableFieldsTrait; + use VariantTrait; + use VersionTrait; + + /** + * @param string $bytes A 16-byte binary string representation of a UUID + * + * @throws InvalidArgumentException if the byte string is not exactly 16 bytes + * @throws InvalidArgumentException if the byte string does not represent a GUID + * @throws InvalidArgumentException if the byte string does not contain a valid version + */ + public function __construct(private string $bytes) + { + if (strlen($this->bytes) !== 16) { + throw new InvalidArgumentException( + 'The byte string must be 16 bytes long; received ' . strlen($this->bytes) . ' bytes', + ); + } + + if (!$this->isCorrectVariant()) { + throw new InvalidArgumentException( + 'The byte string received does not conform to the RFC 9562 (formerly RFC 4122) ' + . 'or Microsoft Corporation variants', + ); + } + + if (!$this->isCorrectVersion()) { + throw new InvalidArgumentException('The byte string received does not contain a valid version'); + } + } + + public function getBytes(): string + { + return $this->bytes; + } + + public function getTimeLow(): Hexadecimal + { + // Swap the bytes from little endian to network byte order. + /** @var string[] $hex */ + $hex = unpack( + 'H*', + pack( + 'v*', + hexdec(bin2hex(substr($this->bytes, 2, 2))), + hexdec(bin2hex(substr($this->bytes, 0, 2))), + ), + ); + + return new Hexadecimal($hex[1] ?? ''); + } + + public function getTimeMid(): Hexadecimal + { + // Swap the bytes from little endian to network byte order. + /** @var string[] $hex */ + $hex = unpack('H*', pack('v', hexdec(bin2hex(substr($this->bytes, 4, 2))))); + + return new Hexadecimal($hex[1] ?? ''); + } + + public function getTimeHiAndVersion(): Hexadecimal + { + // Swap the bytes from little endian to network byte order. + /** @var string[] $hex */ + $hex = unpack('H*', pack('v', hexdec(bin2hex(substr($this->bytes, 6, 2))))); + + return new Hexadecimal($hex[1] ?? ''); + } + + public function getTimestamp(): Hexadecimal + { + return new Hexadecimal(sprintf( + '%03x%04s%08s', + hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, + $this->getTimeMid()->toString(), + $this->getTimeLow()->toString() + )); + } + + public function getClockSeq(): Hexadecimal + { + if ($this->isMax()) { + $clockSeq = 0xffff; + } elseif ($this->isNil()) { + $clockSeq = 0x0000; + } else { + $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; + } + + return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); + } + + public function getClockSeqHiAndReserved(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); + } + + public function getClockSeqLow(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); + } + + public function getNode(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 10))); + } + + public function getVersion(): ?int + { + if ($this->isNil() || $this->isMax()) { + return null; + } + + /** @var int[] $parts */ + $parts = unpack('n*', $this->bytes); + + return ($parts[4] >> 4) & 0x00f; + } + + private function isCorrectVariant(): bool + { + if ($this->isNil() || $this->isMax()) { + return true; + } + + $variant = $this->getVariant(); + + return $variant === Uuid::RFC_4122 || $variant === Uuid::RESERVED_MICROSOFT; + } +} diff --git a/vendor/ramsey/uuid/src/Guid/Guid.php b/vendor/ramsey/uuid/src/Guid/Guid.php new file mode 100644 index 0000000..af551cf --- /dev/null +++ b/vendor/ramsey/uuid/src/Guid/Guid.php @@ -0,0 +1,57 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Guid; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Uuid; + +/** + * Guid represents a UUID with "native" (little-endian) byte order + * + * From Wikipedia: + * + * > The first three fields are unsigned 32- and 16-bit integers and are subject to swapping, while the last two fields + * > consist of uninterpreted bytes, not subject to swapping. This byte swapping applies even for versions 3, 4, and 5, + * > where the canonical fields do not correspond to the content of the UUID. + * + * The first three fields of a GUID are encoded in little-endian byte order, while the last three fields are in network + * (big-endian) byte order. This is according to the history of the Microsoft GUID definition. + * + * According to the .NET Guid.ToByteArray method documentation: + * + * > Note that the order of bytes in the returned byte array is different from the string representation of a Guid value. + * > The order of the beginning four-byte group and the next two two-byte groups is reversed, whereas the order of the + * > last two-byte group and the closing six-byte group is the same. + * + * @link https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants UUID Variants on Wikipedia + * @link https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid Windows GUID structure + * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid .NET Guid Struct + * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray .NET Guid.ToByteArray Method + * + * @immutable + */ +final class Guid extends Uuid +{ + public function __construct( + Fields $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Guid/GuidBuilder.php b/vendor/ramsey/uuid/src/Guid/GuidBuilder.php new file mode 100644 index 0000000..db743d9 --- /dev/null +++ b/vendor/ramsey/uuid/src/Guid/GuidBuilder.php @@ -0,0 +1,76 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Guid; + +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\UnableToBuildUuidException; +use Ramsey\Uuid\UuidInterface; +use Throwable; + +/** + * GuidBuilder builds instances of Guid + * + * @see Guid + * + * @immutable + */ +class GuidBuilder implements UuidBuilderInterface +{ + /** + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Guid + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to Unix timestamps + */ + public function __construct( + private NumberConverterInterface $numberConverter, + private TimeConverterInterface $timeConverter, + ) { + } + + /** + * Builds and returns a Guid + * + * @param CodecInterface $codec The codec to use for building this Guid instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid + * + * @pure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface + { + try { + /** @phpstan-ignore possiblyImpure.new */ + return new Guid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter); + } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ + throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); + } + } + + /** + * Proxy method to allow injecting a mock for testing + * + * @pure + */ + protected function buildFields(string $bytes): Fields + { + /** @phpstan-ignore possiblyImpure.new */ + return new Fields($bytes); + } +} diff --git a/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php b/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php new file mode 100644 index 0000000..8d3129c --- /dev/null +++ b/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php @@ -0,0 +1,426 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Lazy; + +use DateTimeInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Ramsey\Uuid\Fields\FieldsInterface; +use Ramsey\Uuid\Rfc4122\UuidV1; +use Ramsey\Uuid\Rfc4122\UuidV6; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\UuidFactory; +use Ramsey\Uuid\UuidInterface; +use ValueError; + +use function assert; +use function bin2hex; +use function hex2bin; +use function sprintf; +use function str_replace; +use function substr; + +/** + * Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes + * conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of increased + * overhead for more advanced UUID operations. + * + * > [!NOTE] + * > The {@see FieldsInterface} does not declare methods that deprecated API relies upon: the API has been ported from + * > the {@see \Ramsey\Uuid\Uuid} definition, and is deprecated anyway. + * + * > [!NOTE] + * > The deprecated API from {@see \Ramsey\Uuid\Uuid} is in use here (on purpose): it will be removed once the + * > deprecated API is gone from this class too. + * + * @internal this type is used internally for performance reasons and is not supposed to be directly referenced in consumer libraries. + */ +final class LazyUuidFromString implements UuidInterface +{ + public const VALID_REGEX = '/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ms'; + + private ?UuidInterface $unwrapped = null; + + /** + * @param non-empty-string $uuid + */ + public function __construct(private string $uuid) + { + } + + public static function fromBytes(string $bytes): self + { + $base16Uuid = bin2hex($bytes); + + return new self( + substr($base16Uuid, 0, 8) + . '-' + . substr($base16Uuid, 8, 4) + . '-' + . substr($base16Uuid, 12, 4) + . '-' + . substr($base16Uuid, 16, 4) + . '-' + . substr($base16Uuid, 20, 12) + ); + } + + public function serialize(): string + { + return $this->uuid; + } + + /** + * @return array{string: non-empty-string} + */ + public function __serialize(): array + { + return ['string' => $this->uuid]; + } + + /** + * {@inheritDoc} + * + * @param non-empty-string $data + */ + public function unserialize(string $data): void + { + $this->uuid = $data; + } + + /** + * @param array{string?: non-empty-string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['string'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['string']); + } + + public function getNumberConverter(): NumberConverterInterface + { + return ($this->unwrapped ?? $this->unwrap())->getNumberConverter(); + } + + /** + * @inheritDoc + */ + public function getFieldsHex(): array + { + return ($this->unwrapped ?? $this->unwrap())->getFieldsHex(); + } + + public function getClockSeqHiAndReservedHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getClockSeqHiAndReservedHex(); + } + + public function getClockSeqLowHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getClockSeqLowHex(); + } + + public function getClockSequenceHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getClockSequenceHex(); + } + + public function getDateTime(): DateTimeInterface + { + return ($this->unwrapped ?? $this->unwrap())->getDateTime(); + } + + public function getLeastSignificantBitsHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getLeastSignificantBitsHex(); + } + + public function getMostSignificantBitsHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getMostSignificantBitsHex(); + } + + public function getNodeHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getNodeHex(); + } + + public function getTimeHiAndVersionHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getTimeHiAndVersionHex(); + } + + public function getTimeLowHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getTimeLowHex(); + } + + public function getTimeMidHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getTimeMidHex(); + } + + public function getTimestampHex(): string + { + return ($this->unwrapped ?? $this->unwrap())->getTimestampHex(); + } + + public function getUrn(): string + { + return ($this->unwrapped ?? $this->unwrap())->getUrn(); + } + + public function getVariant(): ?int + { + return ($this->unwrapped ?? $this->unwrap())->getVariant(); + } + + public function getVersion(): ?int + { + return ($this->unwrapped ?? $this->unwrap())->getVersion(); + } + + public function compareTo(UuidInterface $other): int + { + return ($this->unwrapped ?? $this->unwrap())->compareTo($other); + } + + public function equals(?object $other): bool + { + if (!$other instanceof UuidInterface) { + return false; + } + + return $this->uuid === $other->toString(); + } + + public function getBytes(): string + { + /** + * @var non-empty-string + * @phpstan-ignore possiblyImpure.functionCall, possiblyImpure.functionCall + */ + return (string) hex2bin(str_replace('-', '', $this->uuid)); + } + + public function getFields(): FieldsInterface + { + return ($this->unwrapped ?? $this->unwrap())->getFields(); + } + + public function getHex(): Hexadecimal + { + return ($this->unwrapped ?? $this->unwrap())->getHex(); + } + + public function getInteger(): IntegerObject + { + return ($this->unwrapped ?? $this->unwrap())->getInteger(); + } + + public function toString(): string + { + return $this->uuid; + } + + public function __toString(): string + { + return $this->uuid; + } + + public function jsonSerialize(): string + { + return $this->uuid; + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} + * and use the arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getClockSeqHiAndReserved(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeqHiAndReserved()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} and use + * the arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getClockSeqLow(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeqLow()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getClockSequence(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeq()->toString()); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getLeastSignificantBits(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + return $instance->getNumberConverter()->fromHex(substr($instance->getHex()->toString(), 16)); + } + + /** + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. + */ + public function getMostSignificantBits(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + return $instance->getNumberConverter()->fromHex(substr($instance->getHex()->toString(), 0, 16)); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getNode()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getNode(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getNode()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} and + * use the arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getTimeHiAndVersion(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeHiAndVersion()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getTimeLow(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeLow()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getTimeMid(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeMid()->toString()); + } + + /** + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} and use + * the arbitrary-precision math library of your choice to convert it to a string integer. + */ + public function getTimestamp(): string + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + if ($fields->getVersion() !== 1) { + throw new UnsupportedOperationException('Not a time-based UUID'); + } + + return $instance->getNumberConverter()->fromHex($fields->getTimestamp()->toString()); + } + + public function toUuidV1(): UuidV1 + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + if ($instance instanceof UuidV1) { + return $instance; + } + + assert($instance instanceof UuidV6); + + return $instance->toUuidV1(); + } + + public function toUuidV6(): UuidV6 + { + $instance = ($this->unwrapped ?? $this->unwrap()); + + assert($instance instanceof UuidV6); + + return $instance; + } + + private function unwrap(): UuidInterface + { + return $this->unwrapped = (new UuidFactory())->fromString($this->uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php b/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php new file mode 100644 index 0000000..649f580 --- /dev/null +++ b/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php @@ -0,0 +1,154 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Math; + +use Brick\Math\BigDecimal; +use Brick\Math\BigInteger; +use Brick\Math\Exception\MathException; +use Brick\Math\RoundingMode as BrickMathRounding; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Type\Decimal; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\NumberInterface; + +/** + * A calculator using the brick/math library for arbitrary-precision arithmetic + * + * @immutable + */ +final class BrickMathCalculator implements CalculatorInterface +{ + private const ROUNDING_MODE_MAP = [ + RoundingMode::UNNECESSARY => BrickMathRounding::UNNECESSARY, + RoundingMode::UP => BrickMathRounding::UP, + RoundingMode::DOWN => BrickMathRounding::DOWN, + RoundingMode::CEILING => BrickMathRounding::CEILING, + RoundingMode::FLOOR => BrickMathRounding::FLOOR, + RoundingMode::HALF_UP => BrickMathRounding::HALF_UP, + RoundingMode::HALF_DOWN => BrickMathRounding::HALF_DOWN, + RoundingMode::HALF_CEILING => BrickMathRounding::HALF_CEILING, + RoundingMode::HALF_FLOOR => BrickMathRounding::HALF_FLOOR, + RoundingMode::HALF_EVEN => BrickMathRounding::HALF_EVEN, + ]; + + public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface + { + $sum = BigInteger::of($augend->toString()); + + foreach ($addends as $addend) { + $sum = $sum->plus($addend->toString()); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new IntegerObject((string) $sum); + } + + public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface + { + $difference = BigInteger::of($minuend->toString()); + + foreach ($subtrahends as $subtrahend) { + $difference = $difference->minus($subtrahend->toString()); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new IntegerObject((string) $difference); + } + + public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface + { + $product = BigInteger::of($multiplicand->toString()); + + foreach ($multipliers as $multiplier) { + $product = $product->multipliedBy($multiplier->toString()); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new IntegerObject((string) $product); + } + + public function divide( + int $roundingMode, + int $scale, + NumberInterface $dividend, + NumberInterface ...$divisors, + ): NumberInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ + $brickRounding = $this->getBrickRoundingMode($roundingMode); + + $quotient = BigDecimal::of($dividend->toString()); + + foreach ($divisors as $divisor) { + $quotient = $quotient->dividedBy($divisor->toString(), $scale, $brickRounding); + } + + if ($scale === 0) { + /** @phpstan-ignore possiblyImpure.new */ + return new IntegerObject((string) $quotient->toBigInteger()); + } + + /** @phpstan-ignore possiblyImpure.new */ + return new Decimal((string) $quotient); + } + + public function fromBase(string $value, int $base): IntegerObject + { + try { + /** @phpstan-ignore possiblyImpure.new */ + return new IntegerObject((string) BigInteger::fromBase($value, $base)); + } catch (MathException | \InvalidArgumentException $exception) { + throw new InvalidArgumentException( + $exception->getMessage(), + (int) $exception->getCode(), + $exception + ); + } + } + + public function toBase(IntegerObject $value, int $base): string + { + try { + return BigInteger::of($value->toString())->toBase($base); + } catch (MathException | \InvalidArgumentException $exception) { + throw new InvalidArgumentException( + $exception->getMessage(), + (int) $exception->getCode(), + $exception + ); + } + } + + public function toHexadecimal(IntegerObject $value): Hexadecimal + { + /** @phpstan-ignore possiblyImpure.new */ + return new Hexadecimal($this->toBase($value, 16)); + } + + public function toInteger(Hexadecimal $value): IntegerObject + { + return $this->fromBase($value->toString(), 16); + } + + /** + * Maps ramsey/uuid rounding modes to those used by brick/math + * + * @return BrickMathRounding::* + */ + private function getBrickRoundingMode(int $roundingMode) + { + return self::ROUNDING_MODE_MAP[$roundingMode] ?? BrickMathRounding::UNNECESSARY; + } +} diff --git a/vendor/ramsey/uuid/src/Math/CalculatorInterface.php b/vendor/ramsey/uuid/src/Math/CalculatorInterface.php new file mode 100644 index 0000000..e6789a6 --- /dev/null +++ b/vendor/ramsey/uuid/src/Math/CalculatorInterface.php @@ -0,0 +1,121 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Math; + +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\NumberInterface; + +/** + * A calculator performs arithmetic operations on numbers + * + * @immutable + */ +interface CalculatorInterface +{ + /** + * Returns the sum of all the provided parameters + * + * @param NumberInterface $augend The first addend (the integer being added to) + * @param NumberInterface ...$addends The additional integers to a add to the augend + * + * @return NumberInterface The sum of all the parameters + * + * @pure + */ + public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface; + + /** + * Returns the difference of all the provided parameters + * + * @param NumberInterface $minuend The integer being subtracted from + * @param NumberInterface ...$subtrahends The integers to subtract from the minuend + * + * @return NumberInterface The difference after subtracting all parameters + * + * @pure + */ + public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface; + + /** + * Returns the product of all the provided parameters + * + * @param NumberInterface $multiplicand The integer to be multiplied + * @param NumberInterface ...$multipliers The factors by which to multiply the multiplicand + * + * @return NumberInterface The product of multiplying all the provided parameters + * + * @pure + */ + public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface; + + /** + * Returns the quotient of the provided parameters divided left-to-right + * + * @param int $roundingMode The RoundingMode constant to use for this operation + * @param int $scale The scale to use for this operation + * @param NumberInterface $dividend The integer to be divided + * @param NumberInterface ...$divisors The integers to divide $dividend by, in the order in which the division + * operations should take place (left-to-right) + * + * @return NumberInterface The quotient of dividing the provided parameters left-to-right + * + * @pure + */ + public function divide( + int $roundingMode, + int $scale, + NumberInterface $dividend, + NumberInterface ...$divisors, + ): NumberInterface; + + /** + * Converts a value from an arbitrary base to a base-10 integer value + * + * @param string $value The value to convert + * @param int $base The base to convert from (i.e., 2, 16, 32, etc.) + * + * @return IntegerObject The base-10 integer value of the converted value + * + * @pure + */ + public function fromBase(string $value, int $base): IntegerObject; + + /** + * Converts a base-10 integer value to an arbitrary base + * + * @param IntegerObject $value The integer value to convert + * @param int $base The base to convert to (i.e., 2, 16, 32, etc.) + * + * @return string The value represented in the specified base + * + * @pure + */ + public function toBase(IntegerObject $value, int $base): string; + + /** + * Converts an Integer instance to a Hexadecimal instance + * + * @pure + */ + public function toHexadecimal(IntegerObject $value): Hexadecimal; + + /** + * Converts a Hexadecimal instance to an Integer instance + * + * @pure + */ + public function toInteger(Hexadecimal $value): IntegerObject; +} diff --git a/vendor/ramsey/uuid/src/Math/RoundingMode.php b/vendor/ramsey/uuid/src/Math/RoundingMode.php new file mode 100644 index 0000000..1497aa6 --- /dev/null +++ b/vendor/ramsey/uuid/src/Math/RoundingMode.php @@ -0,0 +1,127 @@ += 0.5; otherwise, behaves as for DOWN. Note that this is the + * rounding mode commonly taught at school. + */ + public const HALF_UP = 5; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. + * + * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. + */ + public const HALF_DOWN = 6; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. + * + * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. + */ + public const HALF_CEILING = 7; + + /** + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. + * + * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. + */ + public const HALF_FLOOR = 8; + + /** + * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. + * + * Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for HALF_DOWN if it's even. + * + * Note that this is the rounding mode that statistically minimizes cumulative error when applied repeatedly over a + * sequence of calculations. It is sometimes known as "Banker's rounding", and is chiefly used in the USA. + */ + public const HALF_EVEN = 9; + + /** + * Private constructor. This class is not instantiable. + * + * @codeCoverageIgnore + */ + private function __construct() + { + } +} diff --git a/vendor/ramsey/uuid/src/Nonstandard/Fields.php b/vendor/ramsey/uuid/src/Nonstandard/Fields.php new file mode 100644 index 0000000..d309c9a --- /dev/null +++ b/vendor/ramsey/uuid/src/Nonstandard/Fields.php @@ -0,0 +1,128 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Nonstandard; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Fields\SerializableFieldsTrait; +use Ramsey\Uuid\Rfc4122\FieldsInterface; +use Ramsey\Uuid\Rfc4122\VariantTrait; +use Ramsey\Uuid\Type\Hexadecimal; + +use function bin2hex; +use function dechex; +use function hexdec; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; + +use const STR_PAD_LEFT; + +/** + * Nonstandard UUID fields do not conform to the RFC 9562 (formerly RFC 4122) standard + * + * Since some systems may create nonstandard UUIDs, this implements the {@see FieldsInterface}, so that functionality of + * a nonstandard UUID is not degraded, in the event these UUIDs are expected to contain RFC 9562 (formerly RFC 4122) fields. + * + * Internally, this class represents the fields together as a 16-byte binary string. + * + * @immutable + */ +final class Fields implements FieldsInterface +{ + use SerializableFieldsTrait; + use VariantTrait; + + /** + * @param string $bytes A 16-byte binary string representation of a UUID + * + * @throws InvalidArgumentException if the byte string is not exactly 16 bytes + */ + public function __construct(private string $bytes) + { + if (strlen($this->bytes) !== 16) { + throw new InvalidArgumentException( + 'The byte string must be 16 bytes long; received ' . strlen($this->bytes) . ' bytes', + ); + } + } + + public function getBytes(): string + { + return $this->bytes; + } + + public function getClockSeq(): Hexadecimal + { + $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; + + return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); + } + + public function getClockSeqHiAndReserved(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); + } + + public function getClockSeqLow(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); + } + + public function getNode(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 10))); + } + + public function getTimeHiAndVersion(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); + } + + public function getTimeLow(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); + } + + public function getTimeMid(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); + } + + public function getTimestamp(): Hexadecimal + { + return new Hexadecimal(sprintf( + '%03x%04s%08s', + hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, + $this->getTimeMid()->toString(), + $this->getTimeLow()->toString() + )); + } + + public function getVersion(): ?int + { + return null; + } + + public function isNil(): bool + { + return false; + } + + public function isMax(): bool + { + return false; + } +} diff --git a/vendor/ramsey/uuid/src/Nonstandard/Uuid.php b/vendor/ramsey/uuid/src/Nonstandard/Uuid.php new file mode 100644 index 0000000..7f15e6e --- /dev/null +++ b/vendor/ramsey/uuid/src/Nonstandard/Uuid.php @@ -0,0 +1,38 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Nonstandard; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Uuid as BaseUuid; + +/** + * Nonstandard\Uuid is a UUID that doesn't conform to RFC 9562 (formerly RFC 4122) + * + * @immutable + * @pure + */ +final class Uuid extends BaseUuid +{ + public function __construct( + Fields $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php b/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php new file mode 100644 index 0000000..74da992 --- /dev/null +++ b/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php @@ -0,0 +1,74 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Nonstandard; + +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\UnableToBuildUuidException; +use Ramsey\Uuid\UuidInterface; +use Throwable; + +/** + * Nonstandard\UuidBuilder builds instances of Nonstandard\Uuid + * + * @immutable + */ +class UuidBuilder implements UuidBuilderInterface +{ + /** + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Nonstandard\Uuid + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to Unix timestamps + */ + public function __construct( + private NumberConverterInterface $numberConverter, + private TimeConverterInterface $timeConverter, + ) { + } + + /** + * Builds and returns a Nonstandard\Uuid + * + * @param CodecInterface $codec The codec to use for building this instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return Uuid The Nonstandard\UuidBuilder returns an instance of Nonstandard\Uuid + * + * @pure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface + { + try { + /** @phpstan-ignore possiblyImpure.new */ + return new Uuid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter); + } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ + throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); + } + } + + /** + * Proxy method to allow injecting a mock for testing + * + * @pure + */ + protected function buildFields(string $bytes): Fields + { + /** @phpstan-ignore possiblyImpure.new */ + return new Fields($bytes); + } +} diff --git a/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php b/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php new file mode 100644 index 0000000..e277afc --- /dev/null +++ b/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php @@ -0,0 +1,103 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Nonstandard; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Lazy\LazyUuidFromString; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Rfc4122\TimeTrait; +use Ramsey\Uuid\Rfc4122\UuidInterface; +use Ramsey\Uuid\Rfc4122\UuidV1; +use Ramsey\Uuid\Uuid as BaseUuid; + +/** + * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and node values that are combined into a + * 128-bit unsigned integer + * + * @deprecated Use {@see \Ramsey\Uuid\Rfc4122\UuidV6} instead. + * + * @link https://github.com/uuid6/uuid6-ietf-draft UUID version 6 IETF draft + * @link http://gh.peabody.io/uuidv6/ "Version 6" UUIDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.6 RFC 9562, 5.6. UUID Version 6 + * + * @immutable + */ +class UuidV6 extends BaseUuid implements UuidInterface +{ + use TimeTrait; + + /** + * Creates a version 6 (reordered Gregorian time) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== BaseUuid::UUID_TYPE_REORDERED_TIME) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV6 must represent a version 6 (reordered time) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } + + /** + * Converts this UUID into an instance of a version 1 UUID + */ + public function toUuidV1(): UuidV1 + { + $hex = $this->getHex()->toString(); + $hex = substr($hex, 7, 5) + . substr($hex, 13, 3) + . substr($hex, 3, 4) + . '1' . substr($hex, 0, 3) + . substr($hex, 16); + + /** @var LazyUuidFromString $uuid */ + $uuid = BaseUuid::fromBytes((string) hex2bin($hex)); + + return $uuid->toUuidV1(); + } + + /** + * Converts a version 1 UUID into an instance of a version 6 UUID + */ + public static function fromUuidV1(UuidV1 $uuidV1): \Ramsey\Uuid\Rfc4122\UuidV6 + { + $hex = $uuidV1->getHex()->toString(); + $hex = substr($hex, 13, 3) + . substr($hex, 8, 4) + . substr($hex, 0, 5) + . '6' . substr($hex, 5, 3) + . substr($hex, 16); + + /** @var LazyUuidFromString $uuid */ + $uuid = BaseUuid::fromBytes((string) hex2bin($hex)); + + return $uuid->toUuidV6(); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php new file mode 100644 index 0000000..830ffdd --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php @@ -0,0 +1,216 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Dce; + +use Ramsey\Uuid\Exception\DceSecurityException; +use Ramsey\Uuid\Provider\DceSecurityProviderInterface; +use Ramsey\Uuid\Type\Integer as IntegerObject; + +use function escapeshellarg; +use function preg_split; +use function str_getcsv; +use function strrpos; +use function strtolower; +use function strtoupper; +use function substr; +use function trim; + +use const PREG_SPLIT_NO_EMPTY; + +/** + * SystemDceSecurityProvider retrieves the user or group identifiers from the system + */ +class SystemDceSecurityProvider implements DceSecurityProviderInterface +{ + /** + * @throws DceSecurityException if unable to get a user identifier + * + * @inheritDoc + */ + public function getUid(): IntegerObject + { + /** @var IntegerObject | int | float | string | null $uid */ + static $uid = null; + + if ($uid instanceof IntegerObject) { + return $uid; + } + + if ($uid === null) { + $uid = $this->getSystemUid(); + } + + if ($uid === '') { + throw new DceSecurityException( + 'Unable to get a user identifier using the system DCE Security provider; please provide a custom ' + . 'identifier or use a different provider', + ); + } + + $uid = new IntegerObject($uid); + + return $uid; + } + + /** + * @throws DceSecurityException if unable to get a group identifier + * + * @inheritDoc + */ + public function getGid(): IntegerObject + { + /** @var IntegerObject | int | float | string | null $gid */ + static $gid = null; + + if ($gid instanceof IntegerObject) { + return $gid; + } + + if ($gid === null) { + $gid = $this->getSystemGid(); + } + + if ($gid === '') { + throw new DceSecurityException( + 'Unable to get a group identifier using the system DCE Security provider; please provide a custom ' + . 'identifier or use a different provider', + ); + } + + $gid = new IntegerObject($gid); + + return $gid; + } + + /** + * Returns the UID from the system + */ + private function getSystemUid(): string + { + if (!$this->hasShellExec()) { + return ''; + } + + return match ($this->getOs()) { + 'WIN' => $this->getWindowsUid(), + default => trim((string) shell_exec('id -u')), + }; + } + + /** + * Returns the GID from the system + */ + private function getSystemGid(): string + { + if (!$this->hasShellExec()) { + return ''; + } + + return match ($this->getOs()) { + 'WIN' => $this->getWindowsGid(), + default => trim((string) shell_exec('id -g')), + }; + } + + /** + * Returns true if shell_exec() is available for use + */ + private function hasShellExec(): bool + { + return !str_contains(strtolower((string) ini_get('disable_functions')), 'shell_exec'); + } + + /** + * Returns the PHP_OS string + */ + private function getOs(): string + { + /** @var string $phpOs */ + $phpOs = constant('PHP_OS'); + + return strtoupper(substr($phpOs, 0, 3)); + } + + /** + * Returns the user identifier for a user on a Windows system + * + * Windows does not have the same concept as an effective POSIX UID for the running script. Instead, each user is + * uniquely identified by an SID (security identifier). The SID includes three 32-bit unsigned integers that make up + * a unique domain identifier, followed by an RID (relative identifier) that we will use as the UID. The primary + * caveat is that this UID may not be unique to the system, since it is, instead, unique to the domain. + * + * @link https://www.lifewire.com/what-is-an-sid-number-2626005 What Is an SID Number? + * @link https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/81d92bba-d22b-4a8c-908a-554ab29148ab Well-known SID Structures + * @link https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers#well-known-sids Well-known SIDs + * @link https://www.windows-commandline.com/get-sid-of-user/ Get SID of user + */ + private function getWindowsUid(): string + { + $response = shell_exec('whoami /user /fo csv /nh'); + + if ($response === null) { + return ''; + } + + $sid = str_getcsv(trim((string) $response), escape: '\\')[1] ?? ''; + + if (($lastHyphen = strrpos($sid, '-')) === false) { + return ''; + } + + return trim(substr($sid, $lastHyphen + 1)); + } + + /** + * Returns a group identifier for a user on a Windows system + * + * Since Windows does not have the same concept as an effective POSIX GID for the running script, we will get the + * local group memberships for the user running the script. Then, we will get the SID (security identifier) for the + * first group that appears in that list. Finally, we will return the RID (relative identifier) for the group and + * use that as the GID. + * + * @link https://www.windows-commandline.com/list-of-user-groups-command-line/ List of user groups command line + */ + private function getWindowsGid(): string + { + $response = shell_exec('net user %username% | findstr /b /i "Local Group Memberships"'); + + if ($response === null) { + return ''; + } + + $userGroups = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); + $firstGroup = trim($userGroups[1] ?? '', "* \t\n\r\0\x0B"); + + if ($firstGroup === '') { + return ''; + } + + $response = shell_exec('wmic group get name,sid | findstr /b /i ' . escapeshellarg($firstGroup)); + + if ($response === null) { + return ''; + } + + $userGroup = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); + $sid = $userGroup[1] ?? ''; + + if (($lastHyphen = strrpos($sid, '-')) === false) { + return ''; + } + + return trim(substr($sid, $lastHyphen + 1)); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php b/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php new file mode 100644 index 0000000..f1c3e97 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php @@ -0,0 +1,40 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider; + +use Ramsey\Uuid\Rfc4122\UuidV2; +use Ramsey\Uuid\Type\Integer as IntegerObject; + +/** + * A DCE provider provides access to local domain identifiers for version 2, DCE Security, UUIDs + * + * @see UuidV2 + */ +interface DceSecurityProviderInterface +{ + /** + * Returns a user identifier for the system + * + * @link https://en.wikipedia.org/wiki/User_identifier User identifier + */ + public function getUid(): IntegerObject; + + /** + * Returns a group identifier for the system + * + * @link https://en.wikipedia.org/wiki/Group_identifier Group identifier + */ + public function getGid(): IntegerObject; +} diff --git a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php new file mode 100644 index 0000000..267ea9b --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php @@ -0,0 +1,49 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Node; + +use Ramsey\Uuid\Exception\NodeException; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +/** + * FallbackNodeProvider retrieves the system node ID by stepping through a list of providers until a node ID can be obtained + */ +class FallbackNodeProvider implements NodeProviderInterface +{ + /** + * @param iterable $providers Array of node providers + */ + public function __construct(private iterable $providers) + { + } + + public function getNode(): Hexadecimal + { + $lastProviderException = null; + + foreach ($this->providers as $provider) { + try { + return $provider->getNode(); + } catch (NodeException $exception) { + $lastProviderException = $exception; + + continue; + } + } + + throw new NodeException(message: 'Unable to find a suitable node provider', previous: $lastProviderException); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php b/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php new file mode 100644 index 0000000..1d4908a --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php @@ -0,0 +1,58 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Node; + +use Ramsey\Collection\AbstractCollection; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +/** + * A collection of NodeProviderInterface objects + * + * @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a + * pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: + * that is no longer necessary, now that you can safely verify your code to be correct and use more generic types + * like `iterable` instead. + * + * @extends AbstractCollection + */ +class NodeProviderCollection extends AbstractCollection +{ + public function getType(): string + { + return NodeProviderInterface::class; + } + + /** + * Re-constructs the object from its serialized form + * + * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance + */ + public function unserialize($serialized): void + { + /** @var array $data */ + $data = unserialize($serialized, [ + 'allowed_classes' => [ + Hexadecimal::class, + RandomNodeProvider::class, + StaticNodeProvider::class, + SystemNodeProvider::class, + ], + ]); + + /** @phpstan-ignore-next-line */ + $this->data = array_filter($data, fn ($unserialized): bool => $unserialized instanceof NodeProviderInterface); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php new file mode 100644 index 0000000..9334ce0 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php @@ -0,0 +1,55 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Node; + +use Ramsey\Uuid\Exception\RandomSourceException; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Throwable; + +use function bin2hex; +use function dechex; +use function hex2bin; +use function hexdec; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + +/** + * RandomNodeProvider generates a random node ID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host + */ +class RandomNodeProvider implements NodeProviderInterface +{ + public function getNode(): Hexadecimal + { + try { + $nodeBytes = random_bytes(6); + } catch (Throwable $exception) { + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); + } + + // Split the node bytes for math on 32-bit systems. + $nodeMsb = substr($nodeBytes, 0, 3); + $nodeLsb = substr($nodeBytes, 3); + + // Set the multicast bit; see RFC 9562, section 6.10. + $nodeMsb = hex2bin(str_pad(dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), 6, '0', STR_PAD_LEFT)); + + return new Hexadecimal(str_pad(bin2hex($nodeMsb . $nodeLsb), 12, '0', STR_PAD_LEFT)); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php new file mode 100644 index 0000000..612ccd9 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php @@ -0,0 +1,65 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Node; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +use function dechex; +use function hexdec; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + +/** + * StaticNodeProvider provides a static node value with the multicast bit set + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host + */ +class StaticNodeProvider implements NodeProviderInterface +{ + private Hexadecimal $node; + + /** + * @param Hexadecimal $node The static node value to use + */ + public function __construct(Hexadecimal $node) + { + if (strlen($node->toString()) > 12) { + throw new InvalidArgumentException('Static node value cannot be greater than 12 hexadecimal characters'); + } + + $this->node = $this->setMulticastBit($node); + } + + public function getNode(): Hexadecimal + { + return $this->node; + } + + /** + * Set the multicast bit for the static node value + */ + private function setMulticastBit(Hexadecimal $node): Hexadecimal + { + $nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT); + $firstOctet = substr($nodeHex, 0, 2); + $firstOctet = str_pad(dechex(hexdec($firstOctet) | 0x01), 2, '0', STR_PAD_LEFT); + + return new Hexadecimal($firstOctet . substr($nodeHex, 2)); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php new file mode 100644 index 0000000..05e2ea8 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php @@ -0,0 +1,184 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Node; + +use Ramsey\Uuid\Exception\NodeException; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +use function array_filter; +use function array_map; +use function array_walk; +use function count; +use function ob_get_clean; +use function ob_start; +use function preg_match; +use function preg_match_all; +use function reset; +use function str_contains; +use function str_replace; +use function strtolower; +use function strtoupper; +use function substr; + +use const GLOB_NOSORT; +use const PREG_PATTERN_ORDER; + +/** + * SystemNodeProvider retrieves the system node ID, if possible + * + * The system node ID, or host ID, is often the same as the MAC address for a network interface on the host. + */ +class SystemNodeProvider implements NodeProviderInterface +{ + /** + * Pattern to match nodes in `ifconfig` and `ipconfig` output. + */ + private const IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\2[0-9a-f]{2}){4})[^:]/i'; + + /** + * Pattern to match nodes in sysfs stream output. + */ + private const SYSFS_PATTERN = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i'; + + public function getNode(): Hexadecimal + { + $node = $this->getNodeFromSystem(); + + if ($node === '') { + throw new NodeException('Unable to fetch a node for this system'); + } + + return new Hexadecimal($node); + } + + /** + * Returns the system node if found + */ + protected function getNodeFromSystem(): string + { + /** @var string | null $node */ + static $node = null; + + if ($node !== null) { + return $node; + } + + // First, try a Linux-specific approach. + $node = $this->getSysfs(); + + if ($node === '') { + // Search ifconfig output for MAC addresses & return the first one. + $node = $this->getIfconfig(); + } + + $node = str_replace([':', '-'], '', $node); + + return $node; + } + + /** + * Returns the network interface configuration for the system + * + * @codeCoverageIgnore + */ + protected function getIfconfig(): string + { + if (str_contains(strtolower((string) ini_get('disable_functions')), 'passthru')) { + return ''; + } + + /** @var string $phpOs */ + $phpOs = constant('PHP_OS'); + + ob_start(); + switch (strtoupper(substr($phpOs, 0, 3))) { + case 'WIN': + passthru('ipconfig /all 2>&1'); + + break; + case 'DAR': + passthru('ifconfig 2>&1'); + + break; + case 'FRE': + passthru('netstat -i -f link 2>&1'); + + break; + case 'LIN': + default: + passthru('netstat -ie 2>&1'); + + break; + } + + $ifconfig = (string) ob_get_clean(); + + if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) { + foreach ($matches[1] as $iface) { + if ($iface !== '00:00:00:00:00:00' && $iface !== '00-00-00-00-00-00') { + return $iface; + } + } + } + + return ''; + } + + /** + * Returns MAC address from the first system interface via the sysfs interface + */ + protected function getSysfs(): string + { + /** @var string $phpOs */ + $phpOs = constant('PHP_OS'); + + if (strtoupper($phpOs) !== 'LINUX') { + return ''; + } + + $addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT); + + if ($addressPaths === false || count($addressPaths) === 0) { + return ''; + } + + /** @var array $macs */ + $macs = []; + + array_walk($addressPaths, function (string $addressPath) use (&$macs): void { + if (is_readable($addressPath)) { + $macs[] = file_get_contents($addressPath); + } + }); + + /** @var callable $trim */ + $trim = 'trim'; + + $macs = array_map($trim, $macs); + + // Remove invalid entries. + $macs = array_filter($macs, function (mixed $address): bool { + assert(is_string($address)); + + return $address !== '00:00:00:00:00:00' && preg_match(self::SYSFS_PATTERN, $address); + }); + + /** @var bool | string $mac */ + $mac = reset($macs); + + return (string) $mac; + } +} diff --git a/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php b/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php new file mode 100644 index 0000000..d536b45 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php @@ -0,0 +1,30 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider; + +use Ramsey\Uuid\Type\Hexadecimal; + +/** + * A node provider retrieves or generates a node ID + */ +interface NodeProviderInterface +{ + /** + * Returns a node ID + * + * @return Hexadecimal The node ID as a hexadecimal string + */ + public function getNode(): Hexadecimal; +} diff --git a/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php b/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php new file mode 100644 index 0000000..68d9f10 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php @@ -0,0 +1,56 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Time; + +use Ramsey\Uuid\Provider\TimeProviderInterface; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\Time; + +/** + * FixedTimeProvider uses a known time to provide the time + * + * This provider allows the use of a previously generated, or known, time when generating time-based UUIDs. + */ +class FixedTimeProvider implements TimeProviderInterface +{ + public function __construct(private Time $time) + { + } + + /** + * Sets the `usec` component of the time + * + * @param IntegerObject | int | string $value The `usec` value to set + */ + public function setUsec($value): void + { + $this->time = new Time($this->time->getSeconds(), $value); + } + + /** + * Sets the `sec` component of the time + * + * @param IntegerObject | int | string $value The `sec` value to set + */ + public function setSec($value): void + { + $this->time = new Time($value, $this->time->getMicroseconds()); + } + + public function getTime(): Time + { + return $this->time; + } +} diff --git a/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php b/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php new file mode 100644 index 0000000..3a1e09c --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php @@ -0,0 +1,33 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider\Time; + +use Ramsey\Uuid\Provider\TimeProviderInterface; +use Ramsey\Uuid\Type\Time; + +use function gettimeofday; + +/** + * SystemTimeProvider retrieves the current time using built-in PHP functions + */ +class SystemTimeProvider implements TimeProviderInterface +{ + public function getTime(): Time + { + $time = gettimeofday(); + + return new Time($time['sec'], $time['usec']); + } +} diff --git a/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php b/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php new file mode 100644 index 0000000..43588e0 --- /dev/null +++ b/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Provider; + +use Ramsey\Uuid\Type\Time; + +/** + * A time provider retrieves the current time + */ +interface TimeProviderInterface +{ + /** + * Returns a time object + */ + public function getTime(): Time; +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/Fields.php b/vendor/ramsey/uuid/src/Rfc4122/Fields.php new file mode 100644 index 0000000..4f607d5 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/Fields.php @@ -0,0 +1,190 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Fields\SerializableFieldsTrait; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Uuid; + +use function bin2hex; +use function dechex; +use function hexdec; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + +/** + * RFC 9562 (formerly RFC 4122) variant UUIDs consist of a set of named fields + * + * Internally, this class represents the fields together as a 16-byte binary string. + * + * @immutable + */ +final class Fields implements FieldsInterface +{ + use MaxTrait; + use NilTrait; + use SerializableFieldsTrait; + use VariantTrait; + use VersionTrait; + + /** + * @param string $bytes A 16-byte binary string representation of a UUID + * + * @throws InvalidArgumentException if the byte string is not exactly 16 bytes + * @throws InvalidArgumentException if the byte string does not represent an RFC 9562 (formerly RFC 4122) UUID + * @throws InvalidArgumentException if the byte string does not contain a valid version + */ + public function __construct(private string $bytes) + { + if (strlen($this->bytes) !== 16) { + throw new InvalidArgumentException( + 'The byte string must be 16 bytes long; ' . 'received ' . strlen($this->bytes) . ' bytes', + ); + } + + if (!$this->isCorrectVariant()) { + throw new InvalidArgumentException( + 'The byte string received does not conform to the RFC 9562 (formerly RFC 4122) variant', + ); + } + + if (!$this->isCorrectVersion()) { + throw new InvalidArgumentException( + 'The byte string received does not contain a valid RFC 9562 (formerly RFC 4122) version', + ); + } + } + + /** + * @pure + */ + public function getBytes(): string + { + return $this->bytes; + } + + public function getClockSeq(): Hexadecimal + { + if ($this->isMax()) { + $clockSeq = 0xffff; + } elseif ($this->isNil()) { + $clockSeq = 0x0000; + } else { + $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; + } + + return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); + } + + public function getClockSeqHiAndReserved(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); + } + + public function getClockSeqLow(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); + } + + public function getNode(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 10))); + } + + public function getTimeHiAndVersion(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); + } + + public function getTimeLow(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); + } + + public function getTimeMid(): Hexadecimal + { + return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); + } + + /** + * Returns the full 60-bit timestamp, without the version + * + * For version 2 UUIDs, the time_low field is the local identifier and should not be returned as part of the time. + * For this reason, we set the bottom 32 bits of the timestamp to 0's. As a result, there is some loss of timestamp + * fidelity, for version 2 UUIDs. The timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 minutes, 9 + * seconds, and 496,730 microseconds). + * + * For version 6 UUIDs, the timestamp order is reversed from the typical RFC 9562 (formerly RFC 4122) order (the + * time bits are in the correct bit order, so that it is monotonically increasing). In returning the timestamp + * value, we put the bits in the order: time_low + time_mid + time_hi. + */ + public function getTimestamp(): Hexadecimal + { + return new Hexadecimal(match ($this->getVersion()) { + Uuid::UUID_TYPE_DCE_SECURITY => sprintf( + '%03x%04s%08s', + hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, + $this->getTimeMid()->toString(), + '' + ), + Uuid::UUID_TYPE_REORDERED_TIME => sprintf( + '%08s%04s%03x', + $this->getTimeLow()->toString(), + $this->getTimeMid()->toString(), + hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff + ), + // The Unix timestamp in version 7 UUIDs is a 48-bit number, but for consistency, we will return a 60-bit + // number, padded to the left with zeros. + Uuid::UUID_TYPE_UNIX_TIME => sprintf( + '%011s%04s', + $this->getTimeLow()->toString(), + $this->getTimeMid()->toString(), + ), + default => sprintf( + '%03x%04s%08s', + hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, + $this->getTimeMid()->toString(), + $this->getTimeLow()->toString() + ), + }); + } + + public function getVersion(): ?int + { + if ($this->isNil() || $this->isMax()) { + return null; + } + + /** @var int[] $parts */ + $parts = unpack('n*', $this->bytes); + + return $parts[4] >> 12; + } + + private function isCorrectVariant(): bool + { + if ($this->isNil() || $this->isMax()) { + return true; + } + + return $this->getVariant() === Uuid::RFC_4122; + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php b/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php new file mode 100644 index 0000000..13d86d9 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php @@ -0,0 +1,130 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Fields\FieldsInterface as BaseFieldsInterface; +use Ramsey\Uuid\Type\Hexadecimal; + +/** + * UUID fields, as defined by RFC 4122 + * + * This interface defines the fields of an RFC 4122 variant UUID. Since RFC 9562 removed the concept of fields and + * instead defined layouts that are specific to a given version, this interface is a legacy artifact of the earlier, and + * now obsolete, RFC 4122. + * + * The fields of an RFC 4122 variant UUID are: + * + * * **time_low**: The low field of the timestamp, an unsigned 32-bit integer + * * **time_mid**: The middle field of the timestamp, an unsigned 16-bit integer + * * **time_hi_and_version**: The high field of the timestamp multiplexed with the version number, an unsigned 16-bit integer + * * **clock_seq_hi_and_reserved**: The high field of the clock sequence multiplexed with the variant, an unsigned 8-bit integer + * * **clock_seq_low**: The low field of the clock sequence, an unsigned 8-bit integer + * * **node**: The spatially unique node identifier, an unsigned 48-bit integer + * + * @link https://www.rfc-editor.org/rfc/rfc4122#section-4.1 RFC 4122, 4.1. Format + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4 RFC 9562, 4. UUID Format + * + * @immutable + */ +interface FieldsInterface extends BaseFieldsInterface +{ + /** + * Returns the full 16-bit clock sequence, with the variant bits (two most significant bits) masked out + */ + public function getClockSeq(): Hexadecimal; + + /** + * Returns the high field of the clock sequence multiplexed with the variant + */ + public function getClockSeqHiAndReserved(): Hexadecimal; + + /** + * Returns the low field of the clock sequence + */ + public function getClockSeqLow(): Hexadecimal; + + /** + * Returns the node field + */ + public function getNode(): Hexadecimal; + + /** + * Returns the high field of the timestamp multiplexed with the version + */ + public function getTimeHiAndVersion(): Hexadecimal; + + /** + * Returns the low field of the timestamp + */ + public function getTimeLow(): Hexadecimal; + + /** + * Returns the middle field of the timestamp + */ + public function getTimeMid(): Hexadecimal; + + /** + * Returns the full 60-bit timestamp, without the version + */ + public function getTimestamp(): Hexadecimal; + + /** + * Returns the variant + * + * The variant number describes the layout of the UUID. The variant number has the following meaning: + * + * - 0 - Reserved for NCS backward compatibility + * - 2 - The RFC 9562 (formerly RFC 4122) variant + * - 6 - Reserved, Microsoft Corporation backward compatibility + * - 7 - Reserved for future definition + * + * For RFC 9562 (formerly RFC 4122) variant UUIDs, this value should always be the integer `2`. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public function getVariant(): int; + + /** + * Returns the UUID version + * + * The version number describes how the UUID was generated and has the following meaning: + * + * 1. Gregorian time UUID + * 2. DCE security UUID + * 3. Name-based UUID hashed with MD5 + * 4. Randomly generated UUID + * 5. Name-based UUID hashed with SHA-1 + * 6. Reordered Gregorian time UUID + * 7. Unix Epoch time UUID + * 8. Custom format UUID + * + * This returns `null` if the UUID is not an RFC 9562 (formerly RFC 4122) variant, since the version is only + * meaningful for this variant. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + * + * @pure + */ + public function getVersion(): ?int; + + /** + * Returns true if these fields represent a nil UUID + * + * The nil UUID is a special form of UUID that is specified to have all 128 bits set to zero. + * + * @pure + */ + public function isNil(): bool; +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php b/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php new file mode 100644 index 0000000..8646e6a --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php @@ -0,0 +1,40 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +/** + * Provides common functionality for max UUIDs + * + * @immutable + */ +trait MaxTrait +{ + /** + * Returns the bytes that comprise the fields + * + * @pure + */ + abstract public function getBytes(): string; + + /** + * Returns true if the byte string represents a max UUID + * + * @pure + */ + public function isMax(): bool + { + return $this->getBytes() === "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php b/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php new file mode 100644 index 0000000..ac50bce --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Uuid; + +/** + * The max UUID is a special form of UUID that has all 128 bits set to one (`1`) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 RFC 9562, 5.10. Max UUID + * + * @immutable + */ +final class MaxUuid extends Uuid implements UuidInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php b/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php new file mode 100644 index 0000000..19d1377 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php @@ -0,0 +1,38 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +/** + * Provides common functionality for nil UUIDs + * + * @immutable + */ +trait NilTrait +{ + /** + * Returns the bytes that comprise the fields + * + * @pure + */ + abstract public function getBytes(): string; + + /** + * Returns true if the byte string represents a nil UUID + */ + public function isNil(): bool + { + return $this->getBytes() === "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php b/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php new file mode 100644 index 0000000..a139de7 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Uuid; + +/** + * The nil UUID is a special form of UUID that has all 128 bits set to zero (`0`) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 RFC 9562, 5.9. Nil UUID + * + * @immutable + */ +final class NilUuid extends Uuid implements UuidInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php b/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php new file mode 100644 index 0000000..c468c9b --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php @@ -0,0 +1,53 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use DateTimeImmutable; +use DateTimeInterface; +use Ramsey\Uuid\Exception\DateTimeException; +use Throwable; + +use function str_pad; + +use const STR_PAD_LEFT; + +/** + * Provides common functionality for getting the time from a time-based UUID + * + * @immutable + */ +trait TimeTrait +{ + /** + * Returns a DateTimeInterface object representing the timestamp associated with the UUID + * + * @return DateTimeImmutable A PHP DateTimeImmutable instance representing the timestamp of a time-based UUID + */ + public function getDateTime(): DateTimeInterface + { + $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); + + try { + return new DateTimeImmutable( + '@' + . $time->getSeconds()->toString() + . '.' + . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) + ); + } catch (Throwable $e) { + throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); + } + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php b/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php new file mode 100644 index 0000000..787a0b7 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php @@ -0,0 +1,122 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\Time\UnixTimeConverter; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\UnableToBuildUuidException; +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Ramsey\Uuid\Math\BrickMathCalculator; +use Ramsey\Uuid\Rfc4122\UuidInterface as Rfc4122UuidInterface; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\UuidInterface; +use Throwable; + +/** + * UuidBuilder builds instances of RFC 9562 (formerly 4122) UUIDs + * + * @immutable + */ +class UuidBuilder implements UuidBuilderInterface +{ + private TimeConverterInterface $unixTimeConverter; + + /** + * Constructs the DefaultUuidBuilder + * + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Uuid + * @param TimeConverterInterface $timeConverter The time converter to use for converting Gregorian time extracted + * from version 1, 2, and 6 UUIDs to Unix timestamps + * @param TimeConverterInterface | null $unixTimeConverter The time converter to use for converter Unix Epoch time + * extracted from version 7 UUIDs to Unix timestamps + */ + public function __construct( + private NumberConverterInterface $numberConverter, + private TimeConverterInterface $timeConverter, + ?TimeConverterInterface $unixTimeConverter = null, + ) { + $this->unixTimeConverter = $unixTimeConverter ?? new UnixTimeConverter(new BrickMathCalculator()); + } + + /** + * Builds and returns a Uuid + * + * @param CodecInterface $codec The codec to use for building this Uuid instance + * @param string $bytes The byte string from which to construct a UUID + * + * @return Rfc4122UuidInterface UuidBuilder returns instances of Rfc4122UuidInterface + * + * @pure + */ + public function build(CodecInterface $codec, string $bytes): UuidInterface + { + try { + /** @var Fields $fields */ + $fields = $this->buildFields($bytes); + + if ($fields->isNil()) { + /** @phpstan-ignore possiblyImpure.new */ + return new NilUuid($fields, $this->numberConverter, $codec, $this->timeConverter); + } + + if ($fields->isMax()) { + /** @phpstan-ignore possiblyImpure.new */ + return new MaxUuid($fields, $this->numberConverter, $codec, $this->timeConverter); + } + + return match ($fields->getVersion()) { + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_TIME => new UuidV1($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_DCE_SECURITY + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV2($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_HASH_MD5 => new UuidV3($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_RANDOM => new UuidV4($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_HASH_SHA1 => new UuidV5($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_REORDERED_TIME + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV6($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_UNIX_TIME + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV7($fields, $this->numberConverter, $codec, $this->unixTimeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_CUSTOM => new UuidV8($fields, $this->numberConverter, $codec, $this->timeConverter), + default => throw new UnsupportedOperationException( + 'The UUID version in the given fields is not supported by this UUID builder', + ), + }; + } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ + throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); + } + } + + /** + * Proxy method to allow injecting a mock for testing + * + * @pure + */ + protected function buildFields(string $bytes): FieldsInterface + { + /** @phpstan-ignore possiblyImpure.new */ + return new Fields($bytes); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php b/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php new file mode 100644 index 0000000..5918306 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\UuidInterface as BaseUuidInterface; + +/** + * A universally unique identifier (UUID), as defined in RFC 9562 (formerly RFC 4122) + * + * @link https://www.rfc-editor.org/rfc/rfc9562 RFC 9562 + * + * @immutable + */ +interface UuidInterface extends BaseUuidInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php new file mode 100644 index 0000000..df2af6f --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php @@ -0,0 +1,58 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Gregorian time, or version 1, UUIDs include timestamp, clock sequence, and node values, combined into a 128-bit unsigned integer + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.1 RFC 9562, 5.1. UUID Version 1 + * + * @immutable + */ +final class UuidV1 extends Uuid implements UuidInterface +{ + use TimeTrait; + + /** + * Creates a version 1 (Gregorian time) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_TIME) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV1 must represent a version 1 (time-based) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php new file mode 100644 index 0000000..c3417d7 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php @@ -0,0 +1,107 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Uuid; + +use function hexdec; + +/** + * DCE Security version, or version 2, UUIDs include local domain identifier, local ID for the specified domain, and + * node values that are combined into a 128-bit unsigned integer + * + * It is important to note that a version 2 UUID suffers from some loss of timestamp fidelity, due to replacing the + * time_low field with the local identifier. When constructing the timestamp value for date purposes, we replace the + * local identifier bits with zeros. As a result, the timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 + * minutes, 9 seconds, and 496,730 microseconds). + * + * Astute observers might note this value directly corresponds to `2^32-1`, or `0xffffffff`. The local identifier is + * 32-bits, and we have set each of these bits to `0`, so the maximum range of timestamp drift is `0x00000000` to + * `0xffffffff` (counted in 100-nanosecond intervals). + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.2 RFC 9562, 5.2. UUID Version 2 + * @link https://publications.opengroup.org/c311 DCE 1.1: Authentication and Security Services + * @link https://publications.opengroup.org/c706 DCE 1.1: Remote Procedure Call + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 DCE 1.1: Auth & Sec, §5.2.1.1 + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1: Auth & Sec, §11.5.1.1 + * @link https://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm DCE 1.1: RPC, Appendix A + * @link https://github.com/google/uuid Go package for UUIDs (includes DCE implementation) + * + * @immutable + */ +final class UuidV2 extends Uuid implements UuidInterface +{ + use TimeTrait; + + /** + * Creates a version 2 (DCE Security) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_DCE_SECURITY) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV2 must represent a version 2 (DCE Security) UUID' + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } + + /** + * Returns the local domain used to create this version 2 UUID + */ + public function getLocalDomain(): int + { + /** @var Rfc4122FieldsInterface $fields */ + $fields = $this->getFields(); + + return (int) hexdec($fields->getClockSeqLow()->toString()); + } + + /** + * Returns the string name of the local domain + */ + public function getLocalDomainName(): string + { + return Uuid::DCE_DOMAIN_NAMES[$this->getLocalDomain()]; + } + + /** + * Returns the local identifier for the domain used to create this version 2 UUID + */ + public function getLocalIdentifier(): IntegerObject + { + /** @var Rfc4122FieldsInterface $fields */ + $fields = $this->getFields(); + + return new IntegerObject($this->numberConverter->fromHex($fields->getTimeLow()->toString())); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php new file mode 100644 index 0000000..1b065e2 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php @@ -0,0 +1,57 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Version 3 UUIDs are named-based, using a combination of a namespace and name that are hashed into a 128-bit unsigned + * integer using the MD5 hashing algorithm + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.3 RFC 9562, 5.3. UUID Version 3 + * + * @immutable + */ +final class UuidV3 extends Uuid implements UuidInterface +{ + /** + * Creates a version 3 (name-based, MD5-hashed) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_MD5) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV3 must represent a version 3 (name-based, MD5-hashed) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php new file mode 100644 index 0000000..e28ddc3 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php @@ -0,0 +1,56 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit integers + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.4 RFC 9562, 5.4. UUID Version 4 + * + * @immutable + */ +final class UuidV4 extends Uuid implements UuidInterface +{ + /** + * Creates a version 4 (random) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV4 must represent a version 4 (random) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php new file mode 100644 index 0000000..be43908 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php @@ -0,0 +1,57 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Version 5 UUIDs are named-based, using a combination of a namespace and name that are hashed into a 128-bit unsigned + * integer using the SHA1 hashing algorithm + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.5 RFC 9562, 5.5. UUID Version 5 + * + * @immutable + */ +final class UuidV5 extends Uuid implements UuidInterface +{ + /** + * Creates a version 5 (name-based, SHA1-hashed) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_SHA1) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV5 must represent a version 5 (named-based, SHA1-hashed) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php new file mode 100644 index 0000000..3ae4ffc --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php @@ -0,0 +1,29 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Nonstandard\UuidV6 as NonstandardUuidV6; + +/** + * Reordered Gregorian time, or version 6, UUIDs include timestamp, clock sequence, and node values that are combined + * into a 128-bit unsigned integer + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.6 RFC 9562, 5.6. UUID Version 6 + * + * @immutable + */ +final class UuidV6 extends NonstandardUuidV6 implements UuidInterface +{ +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php new file mode 100644 index 0000000..1f2f4b5 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php @@ -0,0 +1,58 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Unix Epoch time, or version 7, UUIDs include a timestamp in milliseconds since the Unix Epoch, along with random bytes + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.7 RFC 9562, 5.7. UUID Version 7 + * + * @immutable + */ +final class UuidV7 extends Uuid implements UuidInterface +{ + use TimeTrait; + + /** + * Creates a version 7 (Unix Epoch time) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_UNIX_TIME) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV7 must represent a version 7 (Unix Epoch time) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php new file mode 100644 index 0000000..ea57ec2 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php @@ -0,0 +1,60 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Uuid; + +/** + * Custom format, or version 8, UUIDs provide an RFC-compatible format for experimental or vendor-specific uses + * + * The only requirement for version 8 UUIDs is that the version and variant bits must be set. Otherwise, implementations + * are free to set the other bits according to their needs. As a result, the uniqueness of version 8 UUIDs is + * implementation-specific and should not be assumed. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.8 RFC 9562, 5.8. UUID Version 8 + * + * @immutable + */ +final class UuidV8 extends Uuid implements UuidInterface +{ + /** + * Creates a version 8 (custom format) UUID + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + if ($fields->getVersion() !== Uuid::UUID_TYPE_CUSTOM) { + throw new InvalidArgumentException( + 'Fields used to create a UuidV8 must represent a version 8 (custom format) UUID', + ); + } + + parent::__construct($fields, $numberConverter, $codec, $timeConverter); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/Validator.php b/vendor/ramsey/uuid/src/Rfc4122/Validator.php new file mode 100644 index 0000000..1736286 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/Validator.php @@ -0,0 +1,49 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Validator\ValidatorInterface; + +use function preg_match; +use function str_replace; + +/** + * Rfc4122\Validator validates strings as UUIDs of the RFC 9562 (formerly RFC 4122) variant + * + * @immutable + */ +final class Validator implements ValidatorInterface +{ + private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-' + . '[1-8][0-9A-Fa-f]{3}-[ABab89][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; + + /** + * @return non-empty-string + */ + public function getPattern(): string + { + return self::VALID_PATTERN; + } + + public function validate(string $uuid): bool + { + /** @phpstan-ignore possiblyImpure.functionCall */ + $uuid = strtolower(str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid)); + + /** @phpstan-ignore possiblyImpure.functionCall */ + return $uuid === Uuid::NIL || $uuid === Uuid::MAX || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php b/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php new file mode 100644 index 0000000..3d39369 --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php @@ -0,0 +1,93 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Exception\InvalidBytesException; +use Ramsey\Uuid\Uuid; + +use function decbin; +use function str_pad; +use function str_starts_with; +use function strlen; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + +/** + * Provides common functionality for handling the variant, as defined by RFC 9562 (formerly RFC 4122) + * + * @immutable + */ +trait VariantTrait +{ + /** + * Returns the bytes that comprise the fields + */ + abstract public function getBytes(): string; + + /** + * Returns the variant + * + * The variant number describes the layout of the UUID. The variant number has the following meaning: + * + * - 0 - Reserved for NCS backward compatibility + * - 2 - The RFC 9562 (formerly RFC 4122) variant + * - 6 - Reserved, Microsoft Corporation backward compatibility + * - 7 - Reserved for future definition + * + * For RFC 9562 (formerly RFC 4122) variant UUIDs, this value should always be the integer `2`. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public function getVariant(): int + { + if (strlen($this->getBytes()) !== 16) { + throw new InvalidBytesException('Invalid number of bytes'); + } + + // According to RFC 9562, sections {@link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 4.1} and + // {@link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 5.10}, the Max UUID falls within the range + // of the future variant. + if ($this->isMax()) { + return Uuid::RESERVED_FUTURE; + } + + // According to RFC 9562, sections {@link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 4.1} and + // {@link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 5.9}, the Nil UUID falls within the range + // of the Apollo NCS variant. + if ($this->isNil()) { + return Uuid::RESERVED_NCS; + } + + /** @var int[] $parts */ + $parts = unpack('n*', $this->getBytes()); + + // $parts[5] is a 16-bit, unsigned integer containing the variant bits of the UUID. We convert this integer into + // a string containing a binary representation, padded to 16 characters. We analyze the first three characters + // (three most-significant bits) to determine the variant. + $msb = substr(str_pad(decbin($parts[5]), 16, '0', STR_PAD_LEFT), 0, 3); + + if ($msb === '111') { + return Uuid::RESERVED_FUTURE; + } elseif ($msb === '110') { + return Uuid::RESERVED_MICROSOFT; + } elseif (str_starts_with($msb, '10')) { + return Uuid::RFC_4122; + } + + return Uuid::RESERVED_NCS; + } +} diff --git a/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php b/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php new file mode 100644 index 0000000..5f4e17b --- /dev/null +++ b/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php @@ -0,0 +1,78 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Rfc4122; + +use Ramsey\Uuid\Uuid; + +/** + * Provides common functionality for handling the version, as defined by RFC 9562 (formerly RFC 4122) + * + * @immutable + */ +trait VersionTrait +{ + /** + * Returns the UUID version + * + * The version number describes how the UUID was generated and has the following meaning: + * + * 1. Gregorian time UUID + * 2. DCE security UUID + * 3. Name-based UUID hashed with MD5 + * 4. Randomly generated UUID + * 5. Name-based UUID hashed with SHA-1 + * 6. Reordered Gregorian time UUID + * 7. Unix Epoch time UUID + * 8. Custom format UUID + * + * This returns `null` if the UUID is not an RFC 9562 (formerly RFC 4122) variant, since the version is only + * meaningful for this variant. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + * + * @pure + */ + abstract public function getVersion(): ?int; + + /** + * Returns true if these fields represent a max UUID + */ + abstract public function isMax(): bool; + + /** + * Returns true if these fields represent a nil UUID + */ + abstract public function isNil(): bool; + + /** + * Returns true if the version matches one of those defined by RFC 9562 (formerly RFC 4122) + * + * @return bool True if the UUID version is valid, false otherwise + */ + private function isCorrectVersion(): bool + { + if ($this->isNil() || $this->isMax()) { + return true; + } + + return match ($this->getVersion()) { + Uuid::UUID_TYPE_TIME, Uuid::UUID_TYPE_DCE_SECURITY, + Uuid::UUID_TYPE_HASH_MD5, Uuid::UUID_TYPE_RANDOM, + Uuid::UUID_TYPE_HASH_SHA1, Uuid::UUID_TYPE_REORDERED_TIME, + Uuid::UUID_TYPE_UNIX_TIME, Uuid::UUID_TYPE_CUSTOM => true, + default => false, + }; + } +} diff --git a/vendor/ramsey/uuid/src/Type/Decimal.php b/vendor/ramsey/uuid/src/Type/Decimal.php new file mode 100644 index 0000000..b5b4f97 --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/Decimal.php @@ -0,0 +1,125 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use ValueError; + +use function is_numeric; +use function sprintf; +use function str_starts_with; + +/** + * A value object representing a decimal + * + * This class exists for type-safety purposes, to ensure that decimals returned from ramsey/uuid methods as strings are + * truly decimals and not some other kind of string. + * + * To support values as true decimals and not as floats or doubles, we store the decimals as strings. + * + * @immutable + */ +final class Decimal implements NumberInterface +{ + private string $value; + private bool $isNegative; + + public function __construct(float | int | string | self $value) + { + $value = (string) $value; + + if (!is_numeric($value)) { + throw new InvalidArgumentException( + 'Value must be a signed decimal or a string containing only ' + . 'digits 0-9 and, optionally, a decimal point or sign (+ or -)' + ); + } + + // Remove the leading +-symbol. + if (str_starts_with($value, '+')) { + $value = substr($value, 1); + } + + // For cases like `-0` or `-0.0000`, convert the value to `0`. + if (abs((float) $value) === 0.0) { + $value = '0'; + } + + if (str_starts_with($value, '-')) { + $this->isNegative = true; + } else { + $this->isNegative = false; + } + + $this->value = $value; + } + + public function isNegative(): bool + { + return $this->isNegative; + } + + public function toString(): string + { + return $this->value; + } + + public function __toString(): string + { + return $this->toString(); + } + + public function jsonSerialize(): string + { + return $this->toString(); + } + + public function serialize(): string + { + return $this->toString(); + } + + /** + * @return array{string: string} + */ + public function __serialize(): array + { + return ['string' => $this->toString()]; + } + + /** + * Constructs the object from a serialized string representation + * + * @param string $data The serialized string representation of the object + */ + public function unserialize(string $data): void + { + $this->__construct($data); + } + + /** + * @param array{string?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['string'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['string']); + } +} diff --git a/vendor/ramsey/uuid/src/Type/Hexadecimal.php b/vendor/ramsey/uuid/src/Type/Hexadecimal.php new file mode 100644 index 0000000..c411764 --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/Hexadecimal.php @@ -0,0 +1,131 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use ValueError; + +use function preg_match; +use function sprintf; +use function substr; + +/** + * A value object representing a hexadecimal number + * + * This class exists for type-safety purposes, to ensure that hexadecimal numbers returned from ramsey/uuid methods as + * strings are truly hexadecimal and not some other kind of string. + * + * @immutable + */ +final class Hexadecimal implements TypeInterface +{ + /** + * @var non-empty-string + */ + private string $value; + + /** + * @param self | string $value The hexadecimal value to store + */ + public function __construct(self | string $value) + { + $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); + } + + /** + * @return non-empty-string + * + * @pure + */ + public function toString(): string + { + return $this->value; + } + + /** + * @return non-empty-string + */ + public function __toString(): string + { + return $this->toString(); + } + + /** + * @return non-empty-string + */ + public function jsonSerialize(): string + { + return $this->toString(); + } + + /** + * @return non-empty-string + */ + public function serialize(): string + { + return $this->toString(); + } + + /** + * @return array{string: string} + */ + public function __serialize(): array + { + return ['string' => $this->toString()]; + } + + /** + * Constructs the object from a serialized string representation + * + * @param string $data The serialized string representation of the object + */ + public function unserialize(string $data): void + { + $this->__construct($data); + } + + /** + * @param array{string?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['string'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['string']); + } + + /** + * @return non-empty-string + */ + private function prepareValue(string $value): string + { + $value = strtolower($value); + + if (str_starts_with($value, '0x')) { + $value = substr($value, 2); + } + + if (!preg_match('/^[A-Fa-f0-9]+$/', $value)) { + throw new InvalidArgumentException('Value must be a hexadecimal number'); + } + + /** @var non-empty-string */ + return $value; + } +} diff --git a/vendor/ramsey/uuid/src/Type/Integer.php b/vendor/ramsey/uuid/src/Type/Integer.php new file mode 100644 index 0000000..ed6c82d --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/Integer.php @@ -0,0 +1,160 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +use Ramsey\Uuid\Exception\InvalidArgumentException; +use ValueError; + +use function assert; +use function is_numeric; +use function preg_match; +use function sprintf; +use function substr; + +/** + * A value object representing an integer + * + * This class exists for type-safety purposes, to ensure that integers returned from ramsey/uuid methods as strings are + * truly integers and not some other kind of string. + * + * To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit and 32-bit systems, we store the integers + * as strings. + * + * @immutable + */ +final class Integer implements NumberInterface +{ + /** + * @var numeric-string + */ + private string $value; + + /** + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue + */ + private bool $isNegative = false; + + public function __construct(self | float | int | string $value) + { + $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); + } + + public function isNegative(): bool + { + return $this->isNegative; + } + + /** + * @return numeric-string + * + * @pure + */ + public function toString(): string + { + return $this->value; + } + + /** + * @return numeric-string + */ + public function __toString(): string + { + return $this->toString(); + } + + public function jsonSerialize(): string + { + return $this->toString(); + } + + public function serialize(): string + { + return $this->toString(); + } + + /** + * @return array{string: string} + */ + public function __serialize(): array + { + return ['string' => $this->toString()]; + } + + /** + * Constructs the object from a serialized string representation + * + * @param string $data The serialized string representation of the object + */ + public function unserialize(string $data): void + { + $this->__construct($data); + } + + /** + * @param array{string?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['string'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['string']); + } + + /** + * @return numeric-string + */ + private function prepareValue(float | int | string $value): string + { + $value = (string) $value; + $sign = '+'; + + // If the value contains a sign, remove it for the digit pattern check. + if (str_starts_with($value, '-') || str_starts_with($value, '+')) { + $sign = substr($value, 0, 1); + $value = substr($value, 1); + } + + if (!preg_match('/^\d+$/', $value)) { + throw new InvalidArgumentException( + 'Value must be a signed integer or a string containing only ' + . 'digits 0-9 and, optionally, a sign (+ or -)' + ); + } + + // Trim any leading zeros. + $value = ltrim($value, '0'); + + // Set to zero if the string is empty after trimming zeros. + if ($value === '') { + $value = '0'; + } + + // Add the negative sign back to the value. + if ($sign === '-' && $value !== '0') { + $value = $sign . $value; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ + $this->isNegative = true; + } + + assert(is_numeric($value)); + + return $value; + } +} diff --git a/vendor/ramsey/uuid/src/Type/NumberInterface.php b/vendor/ramsey/uuid/src/Type/NumberInterface.php new file mode 100644 index 0000000..d85e103 --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/NumberInterface.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +/** + * NumberInterface ensures consistency in numeric values returned by ramsey/uuid + * + * @immutable + */ +interface NumberInterface extends TypeInterface +{ + /** + * Returns true if this number is less than zero + */ + public function isNegative(): bool; +} diff --git a/vendor/ramsey/uuid/src/Type/Time.php b/vendor/ramsey/uuid/src/Type/Time.php new file mode 100644 index 0000000..2556c5b --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/Time.php @@ -0,0 +1,129 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use ValueError; + +use function json_decode; +use function json_encode; +use function sprintf; + +/** + * A value object representing a timestamp + * + * This class exists for type-safety purposes, to ensure that timestamps used by ramsey/uuid are truly timestamp + * integers and not some other kind of string or integer. + * + * @immutable + */ +final class Time implements TypeInterface +{ + private IntegerObject $seconds; + private IntegerObject $microseconds; + + public function __construct( + IntegerObject | float | int | string $seconds, + IntegerObject | float | int | string $microseconds = 0, + ) { + $this->seconds = new IntegerObject($seconds); + $this->microseconds = new IntegerObject($microseconds); + } + + /** + * @pure + */ + public function getSeconds(): IntegerObject + { + return $this->seconds; + } + + /** + * @pure + */ + public function getMicroseconds(): IntegerObject + { + return $this->microseconds; + } + + public function toString(): string + { + return $this->seconds->toString() . '.' . sprintf('%06s', $this->microseconds->toString()); + } + + public function __toString(): string + { + return $this->toString(); + } + + /** + * @return string[] + */ + public function jsonSerialize(): array + { + return [ + 'seconds' => $this->getSeconds()->toString(), + 'microseconds' => $this->getMicroseconds()->toString(), + ]; + } + + public function serialize(): string + { + return (string) json_encode($this); + } + + /** + * @return array{seconds: string, microseconds: string} + */ + public function __serialize(): array + { + return [ + 'seconds' => $this->getSeconds()->toString(), + 'microseconds' => $this->getMicroseconds()->toString(), + ]; + } + + /** + * Constructs the object from a serialized string representation + * + * @param string $data The serialized string representation of the object + */ + public function unserialize(string $data): void + { + /** @var array{seconds?: float | int | string, microseconds?: float | int | string} $time */ + $time = json_decode($data, true); + + if (!isset($time['seconds']) || !isset($time['microseconds'])) { + throw new UnsupportedOperationException('Attempted to unserialize an invalid value'); + } + + $this->__construct($time['seconds'], $time['microseconds']); + } + + /** + * @param array{seconds?: string, microseconds?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['seconds']) || !isset($data['microseconds'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->__construct($data['seconds'], $data['microseconds']); + } +} diff --git a/vendor/ramsey/uuid/src/Type/TypeInterface.php b/vendor/ramsey/uuid/src/Type/TypeInterface.php new file mode 100644 index 0000000..0c88a28 --- /dev/null +++ b/vendor/ramsey/uuid/src/Type/TypeInterface.php @@ -0,0 +1,36 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Type; + +use JsonSerializable; +use Serializable; + +/** + * TypeInterface ensures consistency in typed values returned by ramsey/uuid + * + * @immutable + */ +interface TypeInterface extends JsonSerializable, Serializable +{ + /** + * @pure + */ + public function toString(): string; + + /** + * @pure + */ + public function __toString(): string; +} diff --git a/vendor/ramsey/uuid/src/Uuid.php b/vendor/ramsey/uuid/src/Uuid.php new file mode 100644 index 0000000..0f05bbf --- /dev/null +++ b/vendor/ramsey/uuid/src/Uuid.php @@ -0,0 +1,730 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use BadMethodCallException; +use DateTimeInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; +use Ramsey\Uuid\Exception\UnsupportedOperationException; +use Ramsey\Uuid\Fields\FieldsInterface; +use Ramsey\Uuid\Lazy\LazyUuidFromString; +use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use ValueError; + +use function assert; +use function bin2hex; +use function method_exists; +use function preg_match; +use function sprintf; +use function str_replace; +use function strcmp; +use function strlen; +use function strtolower; +use function substr; + +/** + * Uuid provides constants and static methods for working with and generating UUIDs + * + * @immutable + */ +class Uuid implements UuidInterface +{ + use DeprecatedUuidMethodsTrait; + + /** + * When this namespace is specified, the name string is a fully qualified domain name + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation + */ + public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; + + /** + * When this namespace is specified, the name string is a URL + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation + */ + public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; + + /** + * When this namespace is specified, the name string is an ISO OID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation + */ + public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; + + /** + * When this namespace is specified, the name string is an X.500 DN (in DER or a text output format) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation + */ + public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; + + /** + * The Nil UUID is a special form of UUID that is specified to have all 128 bits set to zero + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 RFC 9562, 5.9. Nil UUID + */ + public const NIL = '00000000-0000-0000-0000-000000000000'; + + /** + * The Max UUID is a special form of UUID that is specified to have all 128 bits set to one + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 RFC 9562, 5.10. Max UUID + */ + public const MAX = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; + + /** + * Variant: reserved, NCS backward compatibility + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public const RESERVED_NCS = 0; + + /** + * Variant: the UUID layout specified in RFC 9562 (formerly RFC 4122) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + * @see Uuid::RFC_9562 + */ + public const RFC_4122 = 2; + + /** + * Variant: the UUID layout specified in RFC 9562 (formerly RFC 4122) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public const RFC_9562 = 2; + + /** + * Variant: reserved, Microsoft Corporation backward compatibility + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public const RESERVED_MICROSOFT = 6; + + /** + * Variant: reserved for future definition + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public const RESERVED_FUTURE = 7; + + /** + * @deprecated Use {@see ValidatorInterface::getPattern()} instead. + */ + public const VALID_PATTERN = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'; + + /** + * Version 1 (Gregorian time) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_TIME = 1; + + /** + * Version 2 (DCE Security) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_DCE_SECURITY = 2; + + /** + * @deprecated Use {@see Uuid::UUID_TYPE_DCE_SECURITY} instead. + */ + public const UUID_TYPE_IDENTIFIER = 2; + + /** + * Version 3 (name-based and hashed with MD5) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_HASH_MD5 = 3; + + /** + * Version 4 (random) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_RANDOM = 4; + + /** + * Version 5 (name-based and hashed with SHA1) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_HASH_SHA1 = 5; + + /** + * @deprecated Use {@see Uuid::UUID_TYPE_REORDERED_TIME} instead. + */ + public const UUID_TYPE_PEABODY = 6; + + /** + * Version 6 (reordered Gregorian time) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_REORDERED_TIME = 6; + + /** + * Version 7 (Unix Epoch time) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_UNIX_TIME = 7; + + /** + * Version 8 (custom format) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + */ + public const UUID_TYPE_CUSTOM = 8; + + /** + * DCE Security principal domain + * + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 + */ + public const DCE_DOMAIN_PERSON = 0; + + /** + * DCE Security group domain + * + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 + */ + public const DCE_DOMAIN_GROUP = 1; + + /** + * DCE Security organization domain + * + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 + */ + public const DCE_DOMAIN_ORG = 2; + + /** + * DCE Security domain string names + * + * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 + */ + public const DCE_DOMAIN_NAMES = [ + self::DCE_DOMAIN_PERSON => 'person', + self::DCE_DOMAIN_GROUP => 'group', + self::DCE_DOMAIN_ORG => 'org', + ]; + + /** + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue + */ + private static ?UuidFactoryInterface $factory = null; + + /** + * @var bool flag to detect if the UUID factory was replaced internally, which disables all optimizations for the + * default/happy path internal scenarios + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue + */ + private static bool $factoryReplaced = false; + + protected CodecInterface $codec; + protected NumberConverterInterface $numberConverter; + protected Rfc4122FieldsInterface $fields; + protected TimeConverterInterface $timeConverter; + + /** + * Creates a universally unique identifier (UUID) from an array of fields + * + * Unless you're making advanced use of this library to generate identifiers that deviate from RFC 9562 (formerly + * RFC 4122), you probably do not want to instantiate a UUID directly. Use the static methods, instead: + * + * ``` + * use Ramsey\Uuid\Uuid; + * + * $timeBasedUuid = Uuid::uuid1(); + * $namespaceMd5Uuid = Uuid::uuid3(Uuid::NAMESPACE_URL, 'http://php.net/'); + * $randomUuid = Uuid::uuid4(); + * $namespaceSha1Uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, 'http://php.net/'); + * ``` + * + * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps + */ + public function __construct( + Rfc4122FieldsInterface $fields, + NumberConverterInterface $numberConverter, + CodecInterface $codec, + TimeConverterInterface $timeConverter, + ) { + $this->fields = $fields; + $this->codec = $codec; + $this->numberConverter = $numberConverter; + $this->timeConverter = $timeConverter; + } + + /** + * @return non-empty-string + */ + public function __toString(): string + { + return $this->toString(); + } + + /** + * Converts the UUID to a string for JSON serialization + */ + public function jsonSerialize(): string + { + return $this->toString(); + } + + /** + * Converts the UUID to a string for PHP serialization + */ + public function serialize(): string + { + return $this->codec->encode($this); + } + + /** + * @return array{bytes: string} + */ + public function __serialize(): array + { + return ['bytes' => $this->serialize()]; + } + + /** + * Re-constructs the object from its serialized form + * + * @param string $data The serialized PHP string to unserialize into a UuidInterface instance + */ + public function unserialize(string $data): void + { + if (strlen($data) === 16) { + /** @var Uuid $uuid */ + $uuid = self::getFactory()->fromBytes($data); + } else { + /** @var Uuid $uuid */ + $uuid = self::getFactory()->fromString($data); + } + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ + $this->codec = $uuid->codec; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ + $this->numberConverter = $uuid->numberConverter; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ + $this->fields = $uuid->fields; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ + $this->timeConverter = $uuid->timeConverter; + } + + /** + * @param array{bytes?: string} $data + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + if (!isset($data['bytes'])) { + throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($data['bytes']); + } + + public function compareTo(UuidInterface $other): int + { + $compare = strcmp($this->toString(), $other->toString()); + + if ($compare < 0) { + return -1; + } + + if ($compare > 0) { + return 1; + } + + return 0; + } + + public function equals(?object $other): bool + { + if (!$other instanceof UuidInterface) { + return false; + } + + return $this->compareTo($other) === 0; + } + + /** + * @return non-empty-string + */ + public function getBytes(): string + { + return $this->codec->encodeBinary($this); + } + + public function getFields(): FieldsInterface + { + return $this->fields; + } + + public function getHex(): Hexadecimal + { + return new Hexadecimal(str_replace('-', '', $this->toString())); + } + + public function getInteger(): IntegerObject + { + return new IntegerObject($this->numberConverter->fromHex($this->getHex()->toString())); + } + + public function getUrn(): string + { + return 'urn:uuid:' . $this->toString(); + } + + /** + * @return non-empty-string + */ + public function toString(): string + { + return $this->codec->encode($this); + } + + /** + * Returns the factory used to create UUIDs + */ + public static function getFactory(): UuidFactoryInterface + { + if (self::$factory === null) { + self::$factory = new UuidFactory(); + } + + return self::$factory; + } + + /** + * Sets the factory used to create UUIDs + * + * @param UuidFactoryInterface $factory A factory that will be used by this class to create UUIDs + */ + public static function setFactory(UuidFactoryInterface $factory): void + { + // Note: non-strict equality is intentional here. If the factory is configured differently, every assumption + // around purity is broken, and we have to internally decide everything differently. + // phpcs:ignore SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator + self::$factoryReplaced = ($factory != new UuidFactory()); + + self::$factory = $factory; + } + + /** + * Creates a UUID from a byte string + * + * @param string $bytes A binary string + * + * @return UuidInterface A UuidInterface instance created from a binary string representation + * + * @throws InvalidArgumentException + * + * @pure + */ + public static function fromBytes(string $bytes): UuidInterface + { + /** @phpstan-ignore impure.staticPropertyAccess */ + if (!self::$factoryReplaced && strlen($bytes) === 16) { + $base16Uuid = bin2hex($bytes); + + // Note: we are calling `fromString` internally because we don't know if the given `$bytes` is a valid UUID + return self::fromString( + substr($base16Uuid, 0, 8) + . '-' + . substr($base16Uuid, 8, 4) + . '-' + . substr($base16Uuid, 12, 4) + . '-' + . substr($base16Uuid, 16, 4) + . '-' + . substr($base16Uuid, 20, 12), + ); + } + + /** @phpstan-ignore possiblyImpure.methodCall */ + return self::getFactory()->fromBytes($bytes); + } + + /** + * Creates a UUID from the string standard representation + * + * @param string $uuid A hexadecimal string + * + * @return UuidInterface A UuidInterface instance created from a hexadecimal string representation + * + * @throws InvalidArgumentException + * + * @pure + */ + public static function fromString(string $uuid): UuidInterface + { + $uuid = strtolower($uuid); + /** @phpstan-ignore impure.staticPropertyAccess, possiblyImpure.functionCall */ + if (!self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { + /** @phpstan-ignore possiblyImpure.functionCall */ + assert($uuid !== ''); + + /** @phpstan-ignore possiblyImpure.new */ + return new LazyUuidFromString($uuid); + } + + /** @phpstan-ignore possiblyImpure.methodCall */ + return self::getFactory()->fromString($uuid); + } + + /** + * Creates a UUID from a DateTimeInterface instance + * + * @param DateTimeInterface $dateTime The date and time + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID created from a DateTimeInterface instance + */ + public static function fromDateTime( + DateTimeInterface $dateTime, + ?Hexadecimal $node = null, + ?int $clockSeq = null + ): UuidInterface { + return self::getFactory()->fromDateTime($dateTime, $node, $clockSeq); + } + + /** + * Creates a UUID from the Hexadecimal object + * + * @param Hexadecimal $hex Hexadecimal object representing a hexadecimal number + * + * @return UuidInterface A UuidInterface instance created from the Hexadecimal object representing a hexadecimal number + * + * @throws InvalidArgumentException + * + * @pure + */ + public static function fromHexadecimal(Hexadecimal $hex): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $factory = self::getFactory(); + + if (method_exists($factory, 'fromHexadecimal')) { + /** @phpstan-ignore possiblyImpure.methodCall */ + $uuid = $factory->fromHexadecimal($hex); + /** @phpstan-ignore possiblyImpure.functionCall */ + assert($uuid instanceof UuidInterface); + + return $uuid; + } + + throw new BadMethodCallException('The method fromHexadecimal() does not exist on the provided factory'); + } + + /** + * Creates a UUID from a 128-bit integer string + * + * @param string $integer String representation of 128-bit integer + * + * @return UuidInterface A UuidInterface instance created from the string representation of a 128-bit integer + * + * @throws InvalidArgumentException + * + * @pure + */ + public static function fromInteger(string $integer): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return self::getFactory()->fromInteger($integer); + } + + /** + * Returns true if the provided string is a valid UUID + * + * @param string $uuid A string to validate as a UUID + * + * @return bool True if the string is a valid UUID, false otherwise + * + * @phpstan-assert-if-true =non-empty-string $uuid + * + * @pure + */ + public static function isValid(string $uuid): bool + { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ + return self::getFactory()->getValidator()->validate($uuid); + } + + /** + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID + */ + public static function uuid1($node = null, ?int $clockSeq = null): UuidInterface + { + return self::getFactory()->uuid1($node, $clockSeq); + } + + /** + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems, if the local domain is "person" or "group," or it may be a site-defined identifier if the + * local domain is "org" + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes (in a version 2 UUID, the lower 8 bits of this number are + * replaced with the domain). + * + * @return UuidInterface A UuidInterface instance that represents a version 2 UUID + */ + public static function uuid2( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null + ): UuidInterface { + return self::getFactory()->uuid2($localDomain, $localIdentifier, $node, $clockSeq); + } + + /** + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * @param string $name The name to use for creating a UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 3 UUID + * + * @pure + */ + public static function uuid3($ns, string $name): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return self::getFactory()->uuid3($ns, $name); + } + + /** + * Returns a version 4 (random) UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 4 UUID + */ + public static function uuid4(): UuidInterface + { + return self::getFactory()->uuid4(); + } + + /** + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * @param string $name The name to use for creating a UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 5 UUID + * + * @pure + */ + public static function uuid5($ns, string $name): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return self::getFactory()->uuid5($ns, $name); + } + + /** + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 6 UUID + */ + public static function uuid6( + ?Hexadecimal $node = null, + ?int $clockSeq = null + ): UuidInterface { + return self::getFactory()->uuid6($node, $clockSeq); + } + + /** + * Returns a version 7 (Unix Epoch time) UUID + * + * @param DateTimeInterface | null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. + * + * @return UuidInterface A UuidInterface instance that represents a version 7 UUID + */ + public static function uuid7(?DateTimeInterface $dateTime = null): UuidInterface + { + $factory = self::getFactory(); + + if (method_exists($factory, 'uuid7')) { + /** @var UuidInterface */ + return $factory->uuid7($dateTime); + } + + throw new UnsupportedOperationException('The provided factory does not support the uuid7() method'); + } + + /** + * Returns a version 8 (custom format) UUID + * + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. + * + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 + * and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. + * + * @return UuidInterface A UuidInterface instance that represents a version 8 UUID + * + * @pure + */ + public static function uuid8(string $bytes): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + $factory = self::getFactory(); + + if (method_exists($factory, 'uuid8')) { + /** + * @var UuidInterface + * @phpstan-ignore possiblyImpure.methodCall + */ + return $factory->uuid8($bytes); + } + + throw new UnsupportedOperationException('The provided factory does not support the uuid8() method'); + } +} diff --git a/vendor/ramsey/uuid/src/UuidFactory.php b/vendor/ramsey/uuid/src/UuidFactory.php new file mode 100644 index 0000000..c7607a1 --- /dev/null +++ b/vendor/ramsey/uuid/src/UuidFactory.php @@ -0,0 +1,476 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use DateTimeInterface; +use Ramsey\Uuid\Builder\UuidBuilderInterface; +use Ramsey\Uuid\Codec\CodecInterface; +use Ramsey\Uuid\Converter\NumberConverterInterface; +use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; +use Ramsey\Uuid\Generator\DefaultTimeGenerator; +use Ramsey\Uuid\Generator\NameGeneratorInterface; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; +use Ramsey\Uuid\Generator\TimeGeneratorInterface; +use Ramsey\Uuid\Generator\UnixTimeGenerator; +use Ramsey\Uuid\Lazy\LazyUuidFromString; +use Ramsey\Uuid\Provider\NodeProviderInterface; +use Ramsey\Uuid\Provider\Time\FixedTimeProvider; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Type\Time; +use Ramsey\Uuid\Validator\ValidatorInterface; + +use function bin2hex; +use function hex2bin; +use function pack; +use function str_pad; +use function strtolower; +use function substr; +use function substr_replace; +use function unpack; + +use const STR_PAD_LEFT; + +class UuidFactory implements UuidFactoryInterface +{ + private CodecInterface $codec; + private DceSecurityGeneratorInterface $dceSecurityGenerator; + private NameGeneratorInterface $nameGenerator; + private NodeProviderInterface $nodeProvider; + private NumberConverterInterface $numberConverter; + private RandomGeneratorInterface $randomGenerator; + private TimeConverterInterface $timeConverter; + private TimeGeneratorInterface $timeGenerator; + private TimeGeneratorInterface $unixTimeGenerator; + private UuidBuilderInterface $uuidBuilder; + private ValidatorInterface $validator; + + /** + * @var bool whether the feature set was provided from outside, or we can operate under "default" assumptions + */ + private bool $isDefaultFeatureSet; + + /** + * @param FeatureSet | null $features A set of available features in the current environment + */ + public function __construct(?FeatureSet $features = null) + { + $this->isDefaultFeatureSet = $features === null; + + $features = $features ?: new FeatureSet(); + + $this->codec = $features->getCodec(); + $this->dceSecurityGenerator = $features->getDceSecurityGenerator(); + $this->nameGenerator = $features->getNameGenerator(); + $this->nodeProvider = $features->getNodeProvider(); + $this->numberConverter = $features->getNumberConverter(); + $this->randomGenerator = $features->getRandomGenerator(); + $this->timeConverter = $features->getTimeConverter(); + $this->timeGenerator = $features->getTimeGenerator(); + $this->uuidBuilder = $features->getBuilder(); + $this->validator = $features->getValidator(); + $this->unixTimeGenerator = $features->getUnixTimeGenerator(); + } + + /** + * Returns the codec used by this factory + */ + public function getCodec(): CodecInterface + { + return $this->codec; + } + + /** + * Sets the codec to use for this factory + * + * @param CodecInterface $codec A UUID encoder-decoder + */ + public function setCodec(CodecInterface $codec): void + { + $this->isDefaultFeatureSet = false; + + $this->codec = $codec; + } + + /** + * Returns the name generator used by this factory + */ + public function getNameGenerator(): NameGeneratorInterface + { + return $this->nameGenerator; + } + + /** + * Sets the name generator to use for this factory + * + * @param NameGeneratorInterface $nameGenerator A generator to generate binary data, based on a namespace and name + */ + public function setNameGenerator(NameGeneratorInterface $nameGenerator): void + { + $this->isDefaultFeatureSet = false; + + $this->nameGenerator = $nameGenerator; + } + + /** + * Returns the node provider used by this factory + */ + public function getNodeProvider(): NodeProviderInterface + { + return $this->nodeProvider; + } + + /** + * Returns the random generator used by this factory + */ + public function getRandomGenerator(): RandomGeneratorInterface + { + return $this->randomGenerator; + } + + /** + * Returns the time generator used by this factory + */ + public function getTimeGenerator(): TimeGeneratorInterface + { + return $this->timeGenerator; + } + + /** + * Sets the time generator to use for this factory + * + * @param TimeGeneratorInterface $generator A generator to generate binary data, based on the time + */ + public function setTimeGenerator(TimeGeneratorInterface $generator): void + { + $this->isDefaultFeatureSet = false; + + $this->timeGenerator = $generator; + } + + /** + * Returns the DCE Security generator used by this factory + */ + public function getDceSecurityGenerator(): DceSecurityGeneratorInterface + { + return $this->dceSecurityGenerator; + } + + /** + * Sets the DCE Security generator to use for this factory + * + * @param DceSecurityGeneratorInterface $generator A generator to generate binary data, based on a local domain and + * local identifier + */ + public function setDceSecurityGenerator(DceSecurityGeneratorInterface $generator): void + { + $this->isDefaultFeatureSet = false; + + $this->dceSecurityGenerator = $generator; + } + + /** + * Returns the number converter used by this factory + */ + public function getNumberConverter(): NumberConverterInterface + { + return $this->numberConverter; + } + + /** + * Sets the random generator to use for this factory + * + * @param RandomGeneratorInterface $generator A generator to generate binary data, based on some random input + */ + public function setRandomGenerator(RandomGeneratorInterface $generator): void + { + $this->isDefaultFeatureSet = false; + + $this->randomGenerator = $generator; + } + + /** + * Sets the number converter to use for this factory + * + * @param NumberConverterInterface $converter A converter to use for working with large integers (i.e., integers + * greater than PHP_INT_MAX) + */ + public function setNumberConverter(NumberConverterInterface $converter): void + { + $this->isDefaultFeatureSet = false; + + $this->numberConverter = $converter; + } + + /** + * Returns the UUID builder used by this factory + */ + public function getUuidBuilder(): UuidBuilderInterface + { + return $this->uuidBuilder; + } + + /** + * Sets the UUID builder to use for this factory + * + * @param UuidBuilderInterface $builder A builder for constructing instances of UuidInterface + */ + public function setUuidBuilder(UuidBuilderInterface $builder): void + { + $this->isDefaultFeatureSet = false; + + $this->uuidBuilder = $builder; + } + + public function getValidator(): ValidatorInterface + { + return $this->validator; + } + + /** + * Sets the validator to use for this factory + * + * @param ValidatorInterface $validator A validator to use for validating whether a string is a valid UUID + */ + public function setValidator(ValidatorInterface $validator): void + { + $this->isDefaultFeatureSet = false; + + $this->validator = $validator; + } + + /** + * @pure + */ + public function fromBytes(string $bytes): UuidInterface + { + return $this->codec->decodeBytes($bytes); + } + + /** + * @pure + */ + public function fromString(string $uuid): UuidInterface + { + $uuid = strtolower($uuid); + + return $this->codec->decode($uuid); + } + + /** + * @pure + */ + public function fromInteger(string $integer): UuidInterface + { + $hex = $this->numberConverter->toHex($integer); + $hex = str_pad($hex, 32, '0', STR_PAD_LEFT); + + return $this->fromString($hex); + } + + public function fromDateTime( + DateTimeInterface $dateTime, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): UuidInterface { + $timeProvider = new FixedTimeProvider(new Time($dateTime->format('U'), $dateTime->format('u'))); + $timeGenerator = new DefaultTimeGenerator($this->nodeProvider, $this->timeConverter, $timeProvider); + $bytes = $timeGenerator->generate($node?->toString(), $clockSeq); + + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME); + } + + /** + * @pure + */ + public function fromHexadecimal(Hexadecimal $hex): UuidInterface + { + return $this->codec->decode($hex->__toString()); + } + + /** + * @inheritDoc + */ + public function uuid1($node = null, ?int $clockSeq = null): UuidInterface + { + $bytes = $this->timeGenerator->generate($node, $clockSeq); + + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME); + } + + public function uuid2( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): UuidInterface { + $bytes = $this->dceSecurityGenerator->generate($localDomain, $localIdentifier, $node, $clockSeq); + + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_DCE_SECURITY); + } + + /** + * @inheritDoc + * @pure + */ + public function uuid3($ns, string $name): UuidInterface + { + return $this->uuidFromNsAndName($ns, $name, Uuid::UUID_TYPE_HASH_MD5, 'md5'); + } + + public function uuid4(): UuidInterface + { + $bytes = $this->randomGenerator->generate(16); + + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_RANDOM); + } + + /** + * @inheritDoc + * @pure + */ + public function uuid5($ns, string $name): UuidInterface + { + return $this->uuidFromNsAndName($ns, $name, Uuid::UUID_TYPE_HASH_SHA1, 'sha1'); + } + + public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface + { + $bytes = $this->timeGenerator->generate($node?->toString(), $clockSeq); + + // Rearrange the bytes, according to the UUID version 6 specification. + $v6 = $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] + . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3]; + $v6 = bin2hex($v6); + + // Drop the first four bits, while adding an empty four bits for the version field. This allows us to + // reconstruct the correct time from the bytes of this UUID. + $v6Bytes = hex2bin(substr($v6, 1, 12) . '0' . substr($v6, -3)); + $v6Bytes .= substr($bytes, 8); + + return $this->uuidFromBytesAndVersion($v6Bytes, Uuid::UUID_TYPE_REORDERED_TIME); + } + + /** + * Returns a version 7 (Unix Epoch time) UUID + * + * @param DateTimeInterface | null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. + * + * @return UuidInterface A UuidInterface instance that represents a version 7 UUID + */ + public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface + { + assert($this->unixTimeGenerator instanceof UnixTimeGenerator); + $bytes = $this->unixTimeGenerator->generate(null, null, $dateTime); + + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_UNIX_TIME); + } + + /** + * Returns a version 8 (custom format) UUID + * + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. + * + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 + * and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. + * + * @return UuidInterface A UuidInterface instance that represents a version 8 UUID + * + * @pure + */ + public function uuid8(string $bytes): UuidInterface + { + /** @phpstan-ignore possiblyImpure.methodCall */ + return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_CUSTOM); + } + + /** + * Returns a Uuid created from the provided byte string + * + * Uses the configured builder and codec and the provided byte string to construct a Uuid object. + * + * @param string $bytes The byte string from which to construct a UUID + * + * @return UuidInterface An instance of UuidInterface, created from the provided bytes + * + * @pure + */ + public function uuid(string $bytes): UuidInterface + { + return $this->uuidBuilder->build($this->codec, $bytes); + } + + /** + * Returns a version 3 or 5 namespaced Uuid + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * @param string $name The name to hash together with the namespace + * @param int $version The version of UUID to create (3 or 5) + * @param string $hashAlgorithm The hashing algorithm to use when hashing together the namespace and name + * + * @return UuidInterface An instance of UuidInterface, created by hashing together the provided namespace and name + * + * @pure + */ + private function uuidFromNsAndName( + UuidInterface | string $ns, + string $name, + int $version, + string $hashAlgorithm, + ): UuidInterface { + if (!($ns instanceof UuidInterface)) { + $ns = $this->fromString($ns); + } + + $bytes = $this->nameGenerator->generate($ns, $name, $hashAlgorithm); + + /** @phpstan-ignore possiblyImpure.methodCall */ + return $this->uuidFromBytesAndVersion(substr($bytes, 0, 16), $version); + } + + /** + * Returns a Uuid created from the provided bytes and version + * + * @param string $bytes The byte string to convert to a UUID + * @param int $version The version to apply to the UUID + * + * @return UuidInterface An instance of UuidInterface, created from the byte string and version + */ + private function uuidFromBytesAndVersion(string $bytes, int $version): UuidInterface + { + /** @var int[] $unpackedTime */ + $unpackedTime = unpack('n*', substr($bytes, 6, 2)); + $timeHi = $unpackedTime[1]; + $timeHiAndVersion = pack('n*', BinaryUtils::applyVersion($timeHi, $version)); + + /** @var int[] $unpackedClockSeq */ + $unpackedClockSeq = unpack('n*', substr($bytes, 8, 2)); + $clockSeqHi = $unpackedClockSeq[1]; + $clockSeqHiAndReserved = pack('n*', BinaryUtils::applyVariant($clockSeqHi)); + + $bytes = substr_replace($bytes, $timeHiAndVersion, 6, 2); + $bytes = substr_replace($bytes, $clockSeqHiAndReserved, 8, 2); + + if ($this->isDefaultFeatureSet) { + return LazyUuidFromString::fromBytes($bytes); + } + + return $this->uuid($bytes); + } +} diff --git a/vendor/ramsey/uuid/src/UuidFactoryInterface.php b/vendor/ramsey/uuid/src/UuidFactoryInterface.php new file mode 100644 index 0000000..5a83a79 --- /dev/null +++ b/vendor/ramsey/uuid/src/UuidFactoryInterface.php @@ -0,0 +1,155 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use DateTimeInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Ramsey\Uuid\Validator\ValidatorInterface; + +/** + * UuidFactoryInterface defines the common functionality all `UuidFactory` instances must implement + */ +interface UuidFactoryInterface +{ + /** + * Creates a UUID from a byte string + * + * @param string $bytes A binary string + * + * @return UuidInterface A UuidInterface instance created from a binary string representation + * + * @pure + */ + public function fromBytes(string $bytes): UuidInterface; + + /** + * Creates a UUID from a DateTimeInterface instance + * + * @param DateTimeInterface $dateTime The date and time + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID created from a DateTimeInterface instance + */ + public function fromDateTime( + DateTimeInterface $dateTime, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): UuidInterface; + + /** + * Creates a UUID from a 128-bit integer string + * + * @param string $integer String representation of 128-bit integer + * + * @return UuidInterface A UuidInterface instance created from the string representation of a 128-bit integer + * + * @pure + */ + public function fromInteger(string $integer): UuidInterface; + + /** + * Creates a UUID from the string standard representation + * + * @param string $uuid A hexadecimal string + * + * @return UuidInterface A UuidInterface instance created from a hexadecimal string representation + * + * @pure + */ + public function fromString(string $uuid): UuidInterface; + + /** + * Returns the validator used by the factory + */ + public function getValidator(): ValidatorInterface; + + /** + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID + */ + public function uuid1($node = null, ?int $clockSeq = null): UuidInterface; + + /** + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the + * current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems, if the local domain is a person or group, or it may be a site-defined identifier if the + * local domain is org + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 2 UUID + */ + public function uuid2( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null, + ): UuidInterface; + + /** + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * @param string $name The name to use for creating a UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 3 UUID + * + * @pure + */ + public function uuid3($ns, string $name): UuidInterface; + + /** + * Returns a version 4 (random) UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 4 UUID + */ + public function uuid4(): UuidInterface; + + /** + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * @param string $name The name to use for creating a UUID + * + * @return UuidInterface A UuidInterface instance that represents a version 5 UUID + * + * @pure + */ + public function uuid5($ns, string $name): UuidInterface; + + /** + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 6 UUID + */ + public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface; +} diff --git a/vendor/ramsey/uuid/src/UuidInterface.php b/vendor/ramsey/uuid/src/UuidInterface.php new file mode 100644 index 0000000..38525cb --- /dev/null +++ b/vendor/ramsey/uuid/src/UuidInterface.php @@ -0,0 +1,110 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use JsonSerializable; +use Ramsey\Uuid\Fields\FieldsInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; +use Serializable; +use Stringable; + +/** + * A UUID is a universally unique identifier adhering to an agreed-upon representation format and standard for generation + * + * @immutable + */ +interface UuidInterface extends + DeprecatedUuidInterface, + JsonSerializable, + Serializable, + Stringable +{ + /** + * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID + * + * The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is + * greater for the first UUID. + * + * @param UuidInterface $other The UUID to compare + * + * @return int<-1,1> -1, 0, or 1 if the UUID is less than, equal to, or greater than $other + */ + public function compareTo(UuidInterface $other): int; + + /** + * Returns true if the UUID is equal to the provided object + * + * The result is true if and only if the argument is not null, is a UUID object, has the same variant, and contains + * the same value, bit-for-bit, as the UUID. + * + * @param object | null $other An object to test for equality with this UUID + * + * @return bool True if the other object is equal to this UUID + */ + public function equals(?object $other): bool; + + /** + * Returns the binary string representation of the UUID + * + * @return non-empty-string + * + * @pure + */ + public function getBytes(): string; + + /** + * Returns the fields that comprise this UUID + */ + public function getFields(): FieldsInterface; + + /** + * Returns the hexadecimal representation of the UUID + */ + public function getHex(): Hexadecimal; + + /** + * Returns the integer representation of the UUID + */ + public function getInteger(): IntegerObject; + + /** + * Returns the string standard representation of the UUID as a URN + * + * @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name + * @link https://www.rfc-editor.org/rfc/rfc9562.html#section-4 RFC 9562, 4. UUID Format + * @link https://www.rfc-editor.org/rfc/rfc9562.html#section-7 RFC 9562, 7. IANA Considerations + * @link https://www.rfc-editor.org/rfc/rfc4122.html#section-3 RFC 4122, 3. Namespace Registration Template + */ + public function getUrn(): string; + + /** + * Returns the string standard representation of the UUID + * + * @return non-empty-string + * + * @pure + */ + public function toString(): string; + + /** + * Casts the UUID to the string standard representation + * + * @return non-empty-string + * + * @pure + */ + public function __toString(): string; +} diff --git a/vendor/ramsey/uuid/src/Validator/GenericValidator.php b/vendor/ramsey/uuid/src/Validator/GenericValidator.php new file mode 100644 index 0000000..6d60647 --- /dev/null +++ b/vendor/ramsey/uuid/src/Validator/GenericValidator.php @@ -0,0 +1,50 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Validator; + +use Ramsey\Uuid\Uuid; + +use function preg_match; +use function str_replace; + +/** + * GenericValidator validates strings as UUIDs of any variant + * + * @immutable + */ +final class GenericValidator implements ValidatorInterface +{ + /** + * Regular expression pattern for matching a UUID of any variant. + */ + private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\z'; + + /** + * @return non-empty-string + */ + public function getPattern(): string + { + return self::VALID_PATTERN; + } + + public function validate(string $uuid): bool + { + /** @phpstan-ignore possiblyImpure.functionCall */ + $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); + + /** @phpstan-ignore possiblyImpure.functionCall */ + return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); + } +} diff --git a/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php b/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php new file mode 100644 index 0000000..95dc8eb --- /dev/null +++ b/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php @@ -0,0 +1,41 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid\Validator; + +/** + * A validator validates a string as a proper UUID + * + * @immutable + */ +interface ValidatorInterface +{ + /** + * Returns the regular expression pattern used by this validator + * + * @return non-empty-string The regular expression pattern this validator uses + */ + public function getPattern(): string; + + /** + * Returns true if the provided string represents a UUID + * + * @param string $uuid The string to validate as a UUID + * + * @return bool True if the string is a valid UUID, false otherwise + * + * @pure + */ + public function validate(string $uuid): bool; +} diff --git a/vendor/ramsey/uuid/src/functions.php b/vendor/ramsey/uuid/src/functions.php new file mode 100644 index 0000000..854c5c5 --- /dev/null +++ b/vendor/ramsey/uuid/src/functions.php @@ -0,0 +1,141 @@ + + * @license http://opensource.org/licenses/MIT MIT + * phpcs:disable Squiz.Functions.GlobalFunction + */ + +declare(strict_types=1); + +namespace Ramsey\Uuid; + +use DateTimeInterface; +use Ramsey\Uuid\Type\Hexadecimal; +use Ramsey\Uuid\Type\Integer as IntegerObject; + +/** + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may be + * represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return non-empty-string Version 1 UUID as a string + */ +function v1($node = null, ?int $clockSeq = null): string +{ + return Uuid::uuid1($node, $clockSeq)->toString(); +} + +/** + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID on + * POSIX systems, if the local domain is a person or group, or it may be a site-defined identifier if the local + * domain is org + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return non-empty-string Version 2 UUID as a string + */ +function v2( + int $localDomain, + ?IntegerObject $localIdentifier = null, + ?Hexadecimal $node = null, + ?int $clockSeq = null, +): string { + return Uuid::uuid2($localDomain, $localIdentifier, $node, $clockSeq)->toString(); +} + +/** + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * + * @return non-empty-string Version 3 UUID as a string + * + * @pure + */ +function v3($ns, string $name): string +{ + return Uuid::uuid3($ns, $name)->toString(); +} + +/** + * Returns a version 4 (random) UUID + * + * @return non-empty-string Version 4 UUID as a string + */ +function v4(): string +{ + return Uuid::uuid4()->toString(); +} + +/** + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name + * + * @param UuidInterface | string $ns The namespace (must be a valid UUID) + * + * @return non-empty-string Version 5 UUID as a string + * + * @pure + */ +function v5($ns, string $name): string +{ + return Uuid::uuid5($ns, $name)->toString(); +} + +/** + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return non-empty-string Version 6 UUID as a string + */ +function v6(?Hexadecimal $node = null, ?int $clockSeq = null): string +{ + return Uuid::uuid6($node, $clockSeq)->toString(); +} + +/** + * Returns a version 7 (Unix Epoch time) UUID + * + * @param DateTimeInterface|null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. + * + * @return non-empty-string Version 7 UUID as a string + */ +function v7(?DateTimeInterface $dateTime = null): string +{ + return Uuid::uuid7($dateTime)->toString(); +} + +/** + * Returns a version 8 (custom format) UUID + * + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. + * + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 and + * 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. + * + * @return non-empty-string Version 8 UUID as a string + * + * @pure + */ +function v8(string $bytes): string +{ + return Uuid::uuid8($bytes)->toString(); +} diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 0000000..7932e26 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 0000000..0ed3a24 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md new file mode 100644 index 0000000..9814864 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/README.md @@ -0,0 +1,26 @@ +Symfony Deprecation Contracts +============================= + +A generic function and convention to trigger deprecation notices. + +This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. + +By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, +the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. + +The function requires at least 3 arguments: + - the name of the Composer package that is triggering the deprecation + - the version of the package that introduced the deprecation + - the message of the deprecation + - more arguments can be provided: they will be inserted in the message using `printf()` formatting + +Example: +```php +trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); +``` + +This will generate the following message: +`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` + +While not recommended, the deprecation notices can be completely ignored by declaring an empty +`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json new file mode 100644 index 0000000..5533b5c --- /dev/null +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/deprecation-contracts", + "type": "library", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.1" + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.6-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 0000000..2d56512 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +}