.gitignore000064400000000171151742733500006542 0ustar00.DS_Store phpunit.xml composer.phar composer.lock composer-test.lock vendor/ build/artifacts/ artifacts/ .idea .metadata CONTRIBUTING.md000064400000002654151742733500007013 0ustar00Want to contribute? Great! First, read this page (including the small print at the end). ### Before you contribute Before we can use your code, you must sign the [Google Individual Contributor License Agreement] (https://cla.developers.google.com/about/google-individual) (CLA), which you can do online. The CLA is necessary mainly because you own the copyright to your changes, even after your contribution becomes part of our codebase, so we need your permission to use and distribute your code. We also need to be sure of various other things—for instance that you'll tell us if you know that your code infringes on other people's patents. You don't have to sign the CLA until after you've submitted your code for review and a member has approved it, but you must do it before we can put your code into our codebase. Before you start working on a larger contribution, you should get in touch with us first through the issue tracker with your idea so that we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on. ### Code reviews All submissions, including submissions by project members, require review. We use Github pull requests for this purpose. ### The small print Contributions made by corporations are covered by a different agreement than the one above, the [Software Grant and Corporate Contributor License Agreement] (https://cla.developers.google.com/about/google-corporate). LICENSE000064400000002700151742733500005557 0ustar00Copyright 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. README.md000064400000002642151742733500006036 0ustar00Google API Extensions for PHP ================================= Google API Extensions 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 5.5 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/master/CONTRIBUTING.md Versioning ---------- This library follows [Semantic Versioning][]. It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. [Semantic Versioning]: http://semver.org/ Repository Structure ------- All code lives under src/ and is contained in the \Google\GAX namespace. License ------- BSD - See [LICENSE][] for more information. [LICENSE]: https://github.com/googleapis/gax-php/blob/master/LICENSE composer.json000064400000001017151742733500007274 0ustar00{ "name": "google/gax", "type": "library", "description": "Google API Extensions for PHP", "keywords": ["google"], "homepage": "https://github.com/googleapis/gax-php", "license": "BSD-3-Clause", "require": { "php": ">=5.5", "google/auth": "0.7", "grpc/grpc": "dev-release-0_13" }, "require-dev": { "phpunit/phpunit": "4.8.*" }, "autoload": { "psr-4": { "Google\\GAX\\":"src/" }, "classmap": ["src/generated"] } } phpunit.xml.dist000064400000000476151742733500007735 0ustar00 tests src src/AgentHeaderDescriptor.php000064400000007041151742733500012263 0ustar00clientName = $headerInfo['clientName']; $this->clientVersion = $headerInfo['clientVersion']; $this->codeGenName = $headerInfo['codeGenName']; $this->codeGenVersion = $headerInfo['codeGenVersion']; $this->gaxVersion = $headerInfo['gaxVersion']; $this->phpVersion = $headerInfo['phpVersion']; } /** * Returns an associative array that contains GAPIC header metadata. */ public function getHeader() { return [self::AGENT_HEADER_KEY => "$this->clientName/$this->clientVersion;". "$this->codeGenName/$this->codeGenVersion;gax/$this->gaxVersion;". "php/$this->phpVersion"]; } private static function validate($descriptor) { $requiredFields = ['clientName', 'clientVersion', 'codeGenName', 'codeGenVersion', 'gaxVersion', 'phpVersion']; foreach ($requiredFields as $field) { if (empty($descriptor[$field])) { throw new InvalidArgumentException( "$field is required for AgentHeaderDescriptor"); } } } } src/ApiCallable.php000064400000017072151742733500010213 0ustar00getBackoffSettings(); // Initialize retry parameters $delayMult = $backoffSettings->getRetryDelayMultiplier(); $maxDelayMillis = $backoffSettings->getMaxRetryDelayMillis(); $timeoutMult = $backoffSettings->getRpcTimeoutMultiplier(); $maxTimeoutMillis = $backoffSettings->getMaxRpcTimeoutMillis(); $totalTimeoutMillis = $backoffSettings->getTotalTimeoutMillis(); $delayMillis = $backoffSettings->getInitialRetryDelayMillis(); $timeoutMillis = $backoffSettings->getInitialRpcTimeoutMillis(); $currentTimeMillis = time() * 1000; $deadlineMillis = $currentTimeMillis + $totalTimeoutMillis; while ($currentTimeMillis < $deadlineMillis) { $nextApiCall = self::setTimeout($apiCall, $timeoutMillis); try { return call_user_func_array($nextApiCall, func_get_args()); } catch (ApiException $e) { if (!in_array($e->getCode(), $retrySettings->getRetryableCodes())) { throw $e; } } catch (Exception $e) { throw $e; } // TODO don't sleep if the failure was a timeout // TODO (2) use usleep sleep($delayMillis / 1000); // TODO use microtime() $currentTimeMillis = time() * 1000; $delayMillis = min($delayMillis * $delayMult, $maxDelayMillis); $timeoutMillis = min($timeoutMillis * $timeoutMult, $maxTimeoutMillis, $deadlineMillis - $currentTimeMillis); } throw new ApiException("Retry total timeout exceeded.", \Grpc\STATUS_DEADLINE_EXCEEDED); }; return $inner; } private static function setPageStreaming($callable, $pageStreamingDescriptor) { $inner = function() use ($callable, $pageStreamingDescriptor) { return new PageAccessor(func_get_args(), $callable, $pageStreamingDescriptor); }; return $inner; } private static function setCustomHeader($callable, $headerDescriptor) { $inner = function() use ($callable, $headerDescriptor) { $params = func_get_args(); if (count($params) != self::GRPC_CALLABLE_PARAM_COUNT || !is_array($params[self::GRPC_CALLABLE_METADATA_INDEX])) { throw new InvalidArgumentException('Metadata argument is not found.'); } else { $metadata = $params[self::GRPC_CALLABLE_METADATA_INDEX]; $headers = $headerDescriptor->getHeader(); if (array_key_exists('headers', $metadata)) { $headers = array_merge($headers, $metadata['headers']); } $params[self::GRPC_CALLABLE_METADATA_INDEX]['headers'] = $headers; return call_user_func_array($callable, $params); } }; return $inner; } /** * @param \Grpc\BaseStub $stub the gRPC stub to make calls through. * @param string $methodName the method name on the stub to call. * @param \Google\GAX\CallSettings $settings the call settings to use for this call. * @param array $options { * Optional. * @type \Google\GAX\PageStreamingDescriptor $pageStreamingDescriptor * the descriptor used for page-streaming. * @type \Google\GAX\AgentHeaderDescriptor $headerDescriptor * the descriptor used for creating GAPIC header. * } */ public static function createApiCall($stub, $methodName, CallSettings $settings, $options = []) { $apiCall = function() use ($stub, $methodName) { list($response, $status) = call_user_func_array(array($stub, $methodName), func_get_args())->wait(); if ($status->code == \Grpc\STATUS_OK) { return $response; } else { throw new ApiException($status->details, $status->code); } }; $retrySettings = $settings->getRetrySettings(); if (!is_null($retrySettings) && !is_null($retrySettings->getRetryableCodes())) { $apiCall = self::setRetry($apiCall, $settings->getRetrySettings()); } else if ($settings->getTimeoutMillis() > 0) { $apiCall = self::setTimeout($apiCall, $settings->getTimeoutMillis()); } if (array_key_exists('pageStreamingDescriptor', $options)) { $apiCall = self::setPageStreaming($apiCall, $options['pageStreamingDescriptor']); } if (array_key_exists('headerDescriptor', $options)) { $apiCall = self::setCustomHeader($apiCall, $options['headerDescriptor']); } return $apiCall; } } src/ApiException.php000064400000003634151742733500010451 0ustar00code}]: {$this->message}\n"; } } src/BackoffSettings.php000064400000015716151742733500011141 0ustar00 $value) { $wordsKey = str_replace('_', ' ', $key); $camelCaseKey = str_replace(' ', '', ucwords($wordsKey)); $camelCaseSettings[lcfirst($camelCaseKey)] = $value; } return new BackoffSettings($camelCaseSettings); } /** * Constructs an instance. * * @param array $settings { * Required. Settings for configuring the backoff settings * * @type integer $initialRetryDelayMillis The initial delay of retry in milliseconds. * @type integer $retryDelayMultiplier The exponential multiplier of retry delay. * @type integer $maxRetryDelayMillis The max delay of retry in milliseconds. * @type integer $initialRpcTimeoutMillis The initial timeout of rpc call in milliseconds. * @type integer $rpcTimeoutMultiplier The exponential multiplier of rpc timeout. * @type integer $maxRpcTimeoutMillis The max timout of rpc call in milliseconds. * @type integer $totalTimeoutMillis The max accumulative timeout in total. * } */ public function __construct($settings) { self::validate($settings); $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']; } public function getInitialRetryDelayMillis() { return $this->initialRetryDelayMillis; } public function getRetryDelayMultiplier() { return $this->retryDelayMultiplier; } public function getMaxRetryDelayMillis() { return $this->maxRetryDelayMillis; } public function getInitialRpcTimeoutMillis() { return $this->initialRpcTimeoutMillis; } public function getRpcTimeoutMultiplier() { return $this->rpcTimeoutMultiplier; } public function getMaxRpcTimeoutMillis() { return $this->maxRpcTimeoutMillis; } public function getTotalTimeoutMillis() { return $this->totalTimeoutMillis; } private static function validate($settings) { $requiredFields = ['initialRetryDelayMillis', 'retryDelayMultiplier', 'maxRetryDelayMillis', 'initialRpcTimeoutMillis', 'rpcTimeoutMultiplier', 'maxRpcTimeoutMillis', 'totalTimeoutMillis']; foreach ($requiredFields as $field) { if (empty($settings[$field])) { throw new InvalidArgumentException("$field is required for BackoffSettings"); } } } }src/CallSettings.php000064400000017124151742733500010454 0ustar00 $methodConfig) { $phpMethodKey = lcfirst($methodName); $retrySettings = null; if (self::inheritRetrySettings($retryingOverrides, $phpMethodKey)) { $retrySettings = self::constructRetry( $methodConfig, $statusCodes, $serviceConfig['retry_codes'], $serviceConfig['retry_params']); } else { $retrySettings = $retryingOverrides[$phpMethodKey]; } $callSettings[$phpMethodKey] = new CallSettings( ['timeoutMillis' => $timeoutMillis, 'retrySettings' => $retrySettings]); } return $callSettings; } private static function inheritRetrySettings($retryingOverrides, $phpMethodKey) { if (empty($retryingOverrides)) { return true; } if (!array_key_exists($phpMethodKey, $retryingOverrides)) { return true; } $retrySettings = $retryingOverrides[$phpMethodKey]; if (is_null($retrySettings)) { // Retry has been turned off explicitly. return false; } return $retrySettings->shouldInherit(); } private static function constructRetry($methodConfig, $statusCodes, $retryCodes, $retryParams) { $codes = []; if (!empty($retryCodes)) { foreach ($retryCodes as $retryCodesName => $retryCodeList) { if ($retryCodesName === $methodConfig['retry_codes_name'] && !empty($retryCodeList)) { foreach ($retryCodeList as $retryCodeName) { if (!array_key_exists($retryCodeName, $statusCodes)) { throw new InvalidArgumentException("Invalid status code: $retryCodeName"); } array_push($codes, $statusCodes[$retryCodeName]); } break; } } } $backoffSettings = null; if (!empty($methodConfig['retry_params_name'])) { foreach ($retryParams as $retryParamsName => $retryParamValues) { if ($retryParamsName === $methodConfig['retry_params_name']) { $backoffSettings = BackoffSettings::fromSnakeCase($retryParamValues); } } } if (!empty($codes) && !empty($backoffSettings)) { return new RetrySettings($codes, $backoffSettings); } else { return null; } } /** * Construct an instance. * * @param array $options { * Optional. * @type \Google\GAX\RetrySettings $retrySettings * Retry settings to use for this method. If present, then * $timeout is ignored. * @type integer $timeoutMillis * Timeout to use for the call. Only used if $retrySettings * is not set. * } */ public function __construct($settings = []) { $this->timeoutMillis = self::INHERIT_TIMEOUT; $this->retrySettings = RetrySettings::inherit(); if (array_key_exists('timeoutMillis', $settings)) { $this->timeoutMillis = $settings['timeoutMillis']; } if (array_key_exists('retrySettings', $settings)) { $this->retrySettings = $settings['retrySettings']; } } public function getTimeoutMillis() { return $this->timeoutMillis; } public function getRetrySettings() { return $this->retrySettings; } /** * Returns a new CallSettings merged from this and another CallSettings object. * * @param CallSettings $otherSettings * A CallSettings whose values override those in this object. If * null, then a copy of this object is returned. */ public function merge(CallSettings $otherSettings = null) { if (is_null($otherSettings)) { return new CallSettings([ 'timeoutMillis' => $this->timeoutMillis, 'retrySettings' => $this->retrySettings]); } else { $timeoutMillis = $this->timeoutMillis; if ($otherSettings->getTimeoutMillis() != self::INHERIT_TIMEOUT) { $timeoutMillis = $otherSettings->getTimeoutMillis(); } $retrySettings = $this->retrySettings; if (is_null($otherSettings->getRetrySettings()) || !$otherSettings->getRetrySettings()->shouldInherit()) { $retrySettings = $otherSettings->getRetrySettings(); } return new CallSettings([ 'timeoutMillis' => $timeoutMillis, 'retrySettings' => $retrySettings]); } } } src/GrpcBootstrap.php000064400000010417151742733500010647 0ustar00getADCCredentials($scopes); $callback = function($context) use ($authCredentials) { return $authCredentials->updateMetadata([], $context->service_url); }; return $callback; } /** * Gets credentials from ADC. This exists to allow overriding in unit tests. */ protected function getADCCredentials($scopes) { return ApplicationDefaultCredentials::getCredentials($scopes); } // TODO(garrettjones): // add: // 1. (when supported in gRPC) channel /** * Creates a gRPC client stub. * * @oaram function $generatedCreateStub * Function callback which must accept two arguments ($hostname, $opts) * and return an instance of the stub of the specific API to call. * Generally, this should just call the stub's constructor and return * the instance. * @param string $serviceAddress The domain name of the API remote host. * @param mixed $port The port on which to connect to the remote host. * @param array $options { * Optional. Options for configuring the gRPC stub. * * @type \Grpc\ChannelCredentials $sslCreds * A `ChannelCredentials` for use with an SSL-enabled channel. * Default: a credentials object returned from * \Grpc\ChannelCredentials::createSsl() * } */ public function createStub($generatedCreateStub, $serviceAddress, $port, $options = array()) { $stubOpts = []; if (empty($options['sslCreds'])) { $stubOpts['credentials'] = $this->createSslChannelCredentials(); } else { $stubOpts['credentials'] = $options['sslCreds']; } $fullAddress = "$serviceAddress:$port"; $stubOpts['grpc.ssl_target_name_override'] = $fullAddress; return $generatedCreateStub($fullAddress, $stubOpts); } /** * Gets credentials from ADC. This exists to allow overriding in unit tests. */ protected function createSslChannelCredentials() { return ChannelCredentials::createSsl(); } } src/GrpcConstants.php000064400000006256151742733500010654 0ustar00 \Grpc\STATUS_ABORTED, 'ALREADY_EXISTS' => \Grpc\STATUS_ALREADY_EXISTS, 'CANCELLED' => \Grpc\STATUS_CANCELLED, 'DATA_LOSS' => \Grpc\STATUS_DATA_LOSS, 'DEADLINE_EXCEEDED' => \Grpc\STATUS_DEADLINE_EXCEEDED, 'FAILED_PRECONDITION' => \Grpc\STATUS_FAILED_PRECONDITION, 'INTERNAL' => \Grpc\STATUS_INTERNAL, 'INVALID_ARGUMENT' => \Grpc\STATUS_INVALID_ARGUMENT, 'NOT_FOUND' => \Grpc\STATUS_NOT_FOUND, 'OK' => \Grpc\STATUS_OK, 'OUT_OF_RANGE' => \Grpc\STATUS_OUT_OF_RANGE, 'PERMISSION_DENIED' => \Grpc\STATUS_PERMISSION_DENIED, 'RESOURCE_EXHAUSTED' => \Grpc\STATUS_RESOURCE_EXHAUSTED, 'UNAUTHENTICATED' => \Grpc\STATUS_UNAUTHENTICATED, 'UNAVAILABLE' => \Grpc\STATUS_UNAVAILABLE, 'UNIMPLEMENTED' => \Grpc\STATUS_UNIMPLEMENTED, 'UNKNOWN' => \Grpc\STATUS_UNKNOWN ]; } /** * Provides an array that maps from status code name to an object * representing that status code. */ public static function getStatusCodeNames() { return self::$statusCodeNames; } } GrpcConstants::initClass(); src/JisonParser.jison000064400000013510151742733500010645 0ustar00/* * 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. */ /* description: Parses a path template string and returns an array of * Segment objects. */ /* lexical grammar */ %lex %% \s+ /* skip whitespace */ "/" return 'FORWARD_SLASH' "{" return 'LEFT_BRACE' "}" return 'RIGHT_BRACE' "=" return 'EQUALS' "**" return 'PATH_WILDCARD' "*" return 'WILDCARD' [^*=}{}\/]+ return 'LITERAL' <> /* skip EOF */ /lex %token 'FORWARD_SLASH' %token 'LEFT_BRACE' %token 'RIGHT_BRACE' %token 'EQUALS' %token 'LITERAL' %token 'PATH_WILDCARD' %token 'WILDCARD' %% /* language grammar */ /* This file is used by a php port of Jison (https://github.com/zaach/jison). * However, the port to php uses the Jison tool to generate the parser before * converting the generated Node.js parser to php. This means that the code * fragments written below are parsed by Jison as Node.js, and if they are not * valid Node.js syntax the generation will fail. * * In order to work around this, we do the following: * - object properties are accessed using get_object_vars(foo)['bar'] * instead of foo->bar * - global variables are defined in GLOBALS to avoid using backslash to * reference the global namespace */ template : FORWARD_SLASH bound_segments { return get_object_vars($2)['text']; } | bound_segments { return get_object_vars($1)['text']; } ; bound_segments : bound_segment FORWARD_SLASH bound_segments { $t1 = get_object_vars($1)['text']; $t3 = get_object_vars($3)['text']; $$ = array_merge($t1, $t3); } | bound_segment { $$ = get_object_vars($1)['text']; } ; unbound_segments : unbound_terminal FORWARD_SLASH unbound_segments { $t1 = get_object_vars($1)['text']; $t3 = get_object_vars($3)['text']; $$ = array_merge($t1, $t3); } | unbound_terminal { $$ = get_object_vars($1)['text']; } ; bound_segment : bound_terminal { $$ = get_object_vars($1)['text']; } | variable { $$ = get_object_vars($1)['text']; } ; unbound_terminal : WILDCARD { $t1 = get_object_vars($1)['text']; $GLOBALS['gax_path_template_segment_count'] += 1; $$ = [new Segment(GAX_PATH_TEMPLATE_TERMINAL, $t1)]; } | PATH_WILDCARD { $t1 = get_object_vars($1)['text']; $GLOBALS['gax_path_template_segment_count'] += 1; $$ = [new Segment(GAX_PATH_TEMPLATE_TERMINAL, $t1)]; } | LITERAL { $t1 = get_object_vars($1)['text']; $GLOBALS['gax_path_template_segment_count'] += 1; $$ = [new Segment(GAX_PATH_TEMPLATE_TERMINAL, $t1)]; } ; bound_terminal : unbound_terminal { $t1 = get_object_vars($1)['text']; if (in_array($t1[0]['literal'], ['*', '**'])) { $$ = [ new Segment(GAX_PATH_TEMPLATE_BINDING, sprintf('$%d', $GLOBALS['gax_path_template_binding_count'])), $t1[0], new Segment(GAX_PATH_TEMPLATE_END_BINDING, '') ]; $GLOBALS['gax_path_template_binding_count'] += 1; } else { $$ = $t1; } } ; variable : LEFT_BRACE LITERAL EQUALS unbound_segments RIGHT_BRACE { $t2 = get_object_vars($2)['text']; $t4 = get_object_vars($4)['text']; $tmp = [new Segment(GAX_PATH_TEMPLATE_BINDING, $t2)]; $tmp = array_merge($tmp, $t4); array_push($tmp, new Segment(GAX_PATH_TEMPLATE_END_BINDING, '')); $$ = $tmp; } | LEFT_BRACE LITERAL RIGHT_BRACE { $t2 = get_object_vars($2)['text']; $$ = [ new Segment(GAX_PATH_TEMPLATE_BINDING, $t2), new Segment(GAX_PATH_TEMPLATE_TERMINAL, '*'), new Segment(GAX_PATH_TEMPLATE_END_BINDING, '')]; $GLOBALS['gax_path_template_segment_count'] += 1; } ; src/JisonParser.php000064400000073754151742733500010332 0ustar00symbols[0] = $symbol0; $this->symbols["accept"] = $symbol0; $this->symbols[1] = $symbol1; $this->symbols["end"] = $symbol1; $this->symbols[2] = $symbol2; $this->symbols["error"] = $symbol2; $this->symbols[3] = $symbol3; $this->symbols["template"] = $symbol3; $this->symbols[4] = $symbol4; $this->symbols["FORWARD_SLASH"] = $symbol4; $this->symbols[5] = $symbol5; $this->symbols["bound_segments"] = $symbol5; $this->symbols[6] = $symbol6; $this->symbols["bound_segment"] = $symbol6; $this->symbols[7] = $symbol7; $this->symbols["unbound_segments"] = $symbol7; $this->symbols[8] = $symbol8; $this->symbols["unbound_terminal"] = $symbol8; $this->symbols[9] = $symbol9; $this->symbols["bound_terminal"] = $symbol9; $this->symbols[10] = $symbol10; $this->symbols["variable"] = $symbol10; $this->symbols[11] = $symbol11; $this->symbols["WILDCARD"] = $symbol11; $this->symbols[12] = $symbol12; $this->symbols["PATH_WILDCARD"] = $symbol12; $this->symbols[13] = $symbol13; $this->symbols["LITERAL"] = $symbol13; $this->symbols[14] = $symbol14; $this->symbols["LEFT_BRACE"] = $symbol14; $this->symbols[15] = $symbol15; $this->symbols["EQUALS"] = $symbol15; $this->symbols[16] = $symbol16; $this->symbols["RIGHT_BRACE"] = $symbol16; $this->terminals = array( 2=>&$symbol2, 4=>&$symbol4, 11=>&$symbol11, 12=>&$symbol12, 13=>&$symbol13, 14=>&$symbol14, 15=>&$symbol15, 16=>&$symbol16 ); $table0 = new ParserState(0); $table1 = new ParserState(1); $table2 = new ParserState(2); $table3 = new ParserState(3); $table4 = new ParserState(4); $table5 = new ParserState(5); $table6 = new ParserState(6); $table7 = new ParserState(7); $table8 = new ParserState(8); $table9 = new ParserState(9); $table10 = new ParserState(10); $table11 = new ParserState(11); $table12 = new ParserState(12); $table13 = new ParserState(13); $table14 = new ParserState(14); $table15 = new ParserState(15); $table16 = new ParserState(16); $table17 = new ParserState(17); $table18 = new ParserState(18); $table19 = new ParserState(19); $table20 = new ParserState(20); $table21 = new ParserState(21); $table22 = new ParserState(22); $tableDefinition0 = array( 3=>new ParserAction($this->none, $table1), 4=>new ParserAction($this->shift, $table2), 5=>new ParserAction($this->none, $table3), 6=>new ParserAction($this->none, $table4), 8=>new ParserAction($this->none, $table7), 9=>new ParserAction($this->none, $table5), 10=>new ParserAction($this->none, $table6), 11=>new ParserAction($this->shift, $table9), 12=>new ParserAction($this->shift, $table10), 13=>new ParserAction($this->shift, $table11), 14=>new ParserAction($this->shift, $table8) ); $tableDefinition1 = array( 1=>new ParserAction($this->accept) ); $tableDefinition2 = array( 5=>new ParserAction($this->none, $table12), 6=>new ParserAction($this->none, $table4), 8=>new ParserAction($this->none, $table7), 9=>new ParserAction($this->none, $table5), 10=>new ParserAction($this->none, $table6), 11=>new ParserAction($this->shift, $table9), 12=>new ParserAction($this->shift, $table10), 13=>new ParserAction($this->shift, $table11), 14=>new ParserAction($this->shift, $table8) ); $tableDefinition3 = array( 1=>new ParserAction($this->reduce, $table2) ); $tableDefinition4 = array( 1=>new ParserAction($this->reduce, $table4), 4=>new ParserAction($this->shift, $table13) ); $tableDefinition5 = array( 1=>new ParserAction($this->reduce, $table7), 4=>new ParserAction($this->reduce, $table7) ); $tableDefinition6 = array( 1=>new ParserAction($this->reduce, $table8), 4=>new ParserAction($this->reduce, $table8) ); $tableDefinition7 = array( 1=>new ParserAction($this->reduce, $table12), 4=>new ParserAction($this->reduce, $table12) ); $tableDefinition8 = array( 13=>new ParserAction($this->shift, $table14) ); $tableDefinition9 = array( 1=>new ParserAction($this->reduce, $table9), 4=>new ParserAction($this->reduce, $table9), 16=>new ParserAction($this->reduce, $table9) ); $tableDefinition10 = array( 1=>new ParserAction($this->reduce, $table10), 4=>new ParserAction($this->reduce, $table10), 16=>new ParserAction($this->reduce, $table10) ); $tableDefinition11 = array( 1=>new ParserAction($this->reduce, $table11), 4=>new ParserAction($this->reduce, $table11), 16=>new ParserAction($this->reduce, $table11) ); $tableDefinition12 = array( 1=>new ParserAction($this->reduce, $table1) ); $tableDefinition13 = array( 5=>new ParserAction($this->none, $table15), 6=>new ParserAction($this->none, $table4), 8=>new ParserAction($this->none, $table7), 9=>new ParserAction($this->none, $table5), 10=>new ParserAction($this->none, $table6), 11=>new ParserAction($this->shift, $table9), 12=>new ParserAction($this->shift, $table10), 13=>new ParserAction($this->shift, $table11), 14=>new ParserAction($this->shift, $table8) ); $tableDefinition14 = array( 15=>new ParserAction($this->shift, $table16), 16=>new ParserAction($this->shift, $table17) ); $tableDefinition15 = array( 1=>new ParserAction($this->reduce, $table3) ); $tableDefinition16 = array( 7=>new ParserAction($this->none, $table18), 8=>new ParserAction($this->none, $table19), 11=>new ParserAction($this->shift, $table9), 12=>new ParserAction($this->shift, $table10), 13=>new ParserAction($this->shift, $table11) ); $tableDefinition17 = array( 1=>new ParserAction($this->reduce, $table14), 4=>new ParserAction($this->reduce, $table14) ); $tableDefinition18 = array( 16=>new ParserAction($this->shift, $table20) ); $tableDefinition19 = array( 4=>new ParserAction($this->shift, $table21), 16=>new ParserAction($this->reduce, $table6) ); $tableDefinition20 = array( 1=>new ParserAction($this->reduce, $table13), 4=>new ParserAction($this->reduce, $table13) ); $tableDefinition21 = array( 7=>new ParserAction($this->none, $table22), 8=>new ParserAction($this->none, $table19), 11=>new ParserAction($this->shift, $table9), 12=>new ParserAction($this->shift, $table10), 13=>new ParserAction($this->shift, $table11) ); $tableDefinition22 = array( 16=>new ParserAction($this->reduce, $table5) ); $table0->setActions($tableDefinition0); $table1->setActions($tableDefinition1); $table2->setActions($tableDefinition2); $table3->setActions($tableDefinition3); $table4->setActions($tableDefinition4); $table5->setActions($tableDefinition5); $table6->setActions($tableDefinition6); $table7->setActions($tableDefinition7); $table8->setActions($tableDefinition8); $table9->setActions($tableDefinition9); $table10->setActions($tableDefinition10); $table11->setActions($tableDefinition11); $table12->setActions($tableDefinition12); $table13->setActions($tableDefinition13); $table14->setActions($tableDefinition14); $table15->setActions($tableDefinition15); $table16->setActions($tableDefinition16); $table17->setActions($tableDefinition17); $table18->setActions($tableDefinition18); $table19->setActions($tableDefinition19); $table20->setActions($tableDefinition20); $table21->setActions($tableDefinition21); $table22->setActions($tableDefinition22); $this->table = array( 0=>$table0, 1=>$table1, 2=>$table2, 3=>$table3, 4=>$table4, 5=>$table5, 6=>$table6, 7=>$table7, 8=>$table8, 9=>$table9, 10=>$table10, 11=>$table11, 12=>$table12, 13=>$table13, 14=>$table14, 15=>$table15, 16=>$table16, 17=>$table17, 18=>$table18, 19=>$table19, 20=>$table20, 21=>$table21, 22=>$table22 ); $this->defaultActions = array( 3=>new ParserAction($this->reduce, $table2), 12=>new ParserAction($this->reduce, $table1), 15=>new ParserAction($this->reduce, $table3), 22=>new ParserAction($this->reduce, $table5) ); $this->productions = array( 0=>new ParserProduction($symbol0), 1=>new ParserProduction($symbol3,2), 2=>new ParserProduction($symbol3,1), 3=>new ParserProduction($symbol5,3), 4=>new ParserProduction($symbol5,1), 5=>new ParserProduction($symbol7,3), 6=>new ParserProduction($symbol7,1), 7=>new ParserProduction($symbol6,1), 8=>new ParserProduction($symbol6,1), 9=>new ParserProduction($symbol8,1), 10=>new ParserProduction($symbol8,1), 11=>new ParserProduction($symbol8,1), 12=>new ParserProduction($symbol9,1), 13=>new ParserProduction($symbol10,5), 14=>new ParserProduction($symbol10,3) ); //Setup Lexer $this->rules = array( 0=>"/^(?:\s+)/", 1=>"/^(?:\/)/", 2=>"/^(?:\{)/", 3=>"/^(?:\})/", 4=>"/^(?:=)/", 5=>"/^(?:\*\*)/", 6=>"/^(?:\*)/", 7=>"/^(?:[^*=}{}\/]+)/", 8=>"/^(?:$)/" ); $this->conditions = array( "INITIAL"=>new LexerConditions(array( 0,1,2,3,4,5,6,7,8), true) ); } function parserPerformAction(&$thisS, &$yy, $yystate, &$s, $o) { /* this == yyval */ switch ($yystate) { case 1: case 2: return get_object_vars($s[$o])['text']; break; case 3: case 5: $t1 = get_object_vars($s[$o-2])['text']; $t3 = get_object_vars($s[$o])['text']; $thisS = array_merge($t1, $t3); break; case 4: case 6: case 7: case 8: $thisS = get_object_vars($s[$o])['text']; break; case 9: case 10: case 11: $t1 = get_object_vars($s[$o])['text']; $GLOBALS['gax_path_template_segment_count'] += 1; $thisS = [new Segment(GAX_PATH_TEMPLATE_TERMINAL, $t1)]; break; case 12: $t1 = get_object_vars($s[$o])['text']; if (in_array($t1[0]['literal'], ['*', '**'])) { $thisS = [ new Segment(GAX_PATH_TEMPLATE_BINDING, sprintf('$%d', $GLOBALS['gax_path_template_binding_count'])), $t1[0], new Segment(GAX_PATH_TEMPLATE_END_BINDING, '') ]; $GLOBALS['gax_path_template_binding_count'] += 1; } else { $thisS = $t1; } break; case 13: $t2 = get_object_vars($s[$o-3])['text']; $t4 = get_object_vars($s[$o-1])['text']; $tmp = [new Segment(GAX_PATH_TEMPLATE_BINDING, $t2)]; $tmp = array_merge($tmp, $t4); array_push($tmp, new Segment(GAX_PATH_TEMPLATE_END_BINDING, '')); $thisS = $tmp; break; case 14: $t2 = get_object_vars($s[$o-1])['text']; $thisS = [ new Segment(GAX_PATH_TEMPLATE_BINDING, $t2), new Segment(GAX_PATH_TEMPLATE_TERMINAL, '*'), new Segment(GAX_PATH_TEMPLATE_END_BINDING, '')]; $GLOBALS['gax_path_template_segment_count'] += 1; break; } } function parserLex() { $token = $this->lexerLex(); // $end = 1 if (isset($token)) { return $token; } return $this->symbols["end"]; } function parseError($str = "", ParserError $hash = null) { throw new Exception($str); } function lexerError($str = "", LexerError $hash = null) { throw new Exception($str); } function parse($input) { if (empty($this->table)) { throw new Exception("Empty Table"); } $this->eof = new ParserSymbol("Eof", 1); $firstAction = new ParserAction(0, $this->table[0]); $firstCachedAction = new ParserCachedAction($firstAction); $stack = array($firstCachedAction); $stackCount = 1; $vstack = array(null); $vstackCount = 1; $yy = null; $_yy = null; $recovering = 0; $symbol = null; $action = null; $errStr = ""; $preErrorSymbol = null; $state = null; $this->setInput($input); while (true) { // retrieve state number from top of stack $state = $stack[$stackCount - 1]->action->state; // use default actions if available if ($state != null && isset($this->defaultActions[$state->index])) { $action = $this->defaultActions[$state->index]; } else { if (empty($symbol) == true) { $symbol = $this->parserLex(); } // read action for current state and first input if (isset($state) && isset($state->actions[$symbol->index])) { //$action = $this->table[$state][$symbol]; $action = $state->actions[$symbol->index]; } else { $action = null; } } if ($action == null) { if ($recovering == 0) { // Report error $expected = array(); foreach($this->table[$state->index]->actions as $p => $item) { if (!empty($this->terminals[$p]) && $p > 2) { $expected[] = $this->terminals[$p]->name; } } $errStr = "Parse error on line " . ($this->yy->lineNo + 1) . ":\n" . $this->showPosition() . "\nExpecting " . implode(", ", $expected) . ", got '" . (isset($this->terminals[$symbol->index]) ? $this->terminals[$symbol->index]->name : 'NOTHING') . "'"; $this->parseError($errStr, new ParserError($this->match, $state, $symbol, $this->yy->lineNo, $this->yy->loc, $expected)); } } if ($state === null || $action === null) { break; } switch ($action->action) { case 1: // shift //$this->shiftCount++; $stack[] = new ParserCachedAction($action, $symbol); $stackCount++; $vstack[] = clone($this->yy); $vstackCount++; $symbol = ""; if ($preErrorSymbol == null) { // normal execution/no error $yy = clone($this->yy); if ($recovering > 0) $recovering--; } else { // error just occurred, resume old look ahead f/ before error $symbol = $preErrorSymbol; $preErrorSymbol = null; } break; case 2: // reduce $len = $this->productions[$action->state->index]->len; // perform semantic action $_yy = $vstack[$vstackCount - $len];// default to $S = $1 // default location, uses first token for firsts, last for lasts if (isset($this->ranges)) { //TODO: add ranges } $r = $this->parserPerformAction($_yy->text, $yy, $action->state->index, $vstack, $vstackCount - 1); if (isset($r)) { return $r; } // pop off stack while ($len > 0) { $len--; array_pop($stack); $stackCount--; array_pop($vstack); $vstackCount--; } if (is_null($_yy)) { $vstack[] = new ParserValue(); } else { $vstack[] = $_yy; } $vstackCount++; $nextSymbol = $this->productions[$action->state->index]->symbol; // goto new state = table[STATE][NONTERMINAL] $nextState = $stack[$stackCount - 1]->action->state; $nextAction = $nextState->actions[$nextSymbol->index]; $stack[] = new ParserCachedAction($nextAction, $nextSymbol); $stackCount++; break; case 3: // accept return true; } } return true; } /* Jison generated lexer */ public $eof; public $yy = null; public $match = ""; public $matched = ""; public $conditionStack = array(); public $conditionStackCount = 0; public $rules = array(); public $conditions = array(); public $done = false; public $less; public $more; public $input; public $offset; public $ranges; public $flex = false; function setInput($input) { $this->input = $input; $this->more = $this->less = $this->done = false; $this->yy = new ParserValue(); $this->conditionStack = array('INITIAL'); $this->conditionStackCount = 1; if (isset($this->ranges)) { $loc = $this->yy->loc = new ParserLocation(); $loc->Range(new ParserRange(0, 0)); } else { $this->yy->loc = new ParserLocation(); } $this->offset = 0; } function input() { $ch = $this->input[0]; $this->yy->text .= $ch; $this->yy->leng++; $this->offset++; $this->match .= $ch; $this->matched .= $ch; $lines = preg_match("/(?:\r\n?|\n).*/", $ch); if (count($lines) > 0) { $this->yy->lineNo++; $this->yy->lastLine++; } else { $this->yy->loc->lastColumn++; } if (isset($this->ranges)) { $this->yy->loc->range->y++; } $this->input = array_slice($this->input, 1); return $ch; } function unput($ch) { $len = strlen($ch); $lines = explode("/(?:\r\n?|\n)/", $ch); $linesCount = count($lines); $this->input = $ch . $this->input; $this->yy->text = substr($this->yy->text, 0, $len - 1); //$this->yylen -= $len; $this->offset -= $len; $oldLines = explode("/(?:\r\n?|\n)/", $this->match); $oldLinesCount = count($oldLines); $this->match = substr($this->match, 0, strlen($this->match) - 1); $this->matched = substr($this->matched, 0, strlen($this->matched) - 1); if (($linesCount - 1) > 0) $this->yy->lineNo -= $linesCount - 1; $r = $this->yy->loc->range; $oldLinesLength = (isset($oldLines[$oldLinesCount - $linesCount]) ? strlen($oldLines[$oldLinesCount - $linesCount]) : 0); $this->yy->loc = new ParserLocation( $this->yy->loc->firstLine, $this->yy->lineNo, $this->yy->loc->firstColumn, $this->yy->loc->firstLine, (empty($lines) ? ($linesCount == $oldLinesCount ? $this->yy->loc->firstColumn : 0) + $oldLinesLength : $this->yy->loc->firstColumn - $len) ); if (isset($this->ranges)) { $this->yy->loc->range = array($r[0], $r[0] + $this->yy->leng - $len); } } function more() { $this->more = true; } function pastInput() { $past = substr($this->matched, 0, strlen($this->matched) - strlen($this->match)); return (strlen($past) > 20 ? '...' : '') . preg_replace("/\n/", "", substr($past, -20)); } function upcomingInput() { $next = $this->match; if (strlen($next) < 20) { $next .= substr($this->input, 0, 20 - strlen($next)); } return preg_replace("/\n/", "", substr($next, 0, 20) . (strlen($next) > 20 ? '...' : '')); } function showPosition() { $pre = $this->pastInput(); $c = ''; for($i = 0, $preLength = strlen($pre); $i < $preLength; $i++) { $c .= '-'; } return $pre . $this->upcomingInput() . "\n" . $c . "^"; } function next() { if ($this->done == true) { return $this->eof; } if (empty($this->input)) { $this->done = true; } if ($this->more == false) { $this->yy->text = ''; $this->match = ''; } $rules = $this->currentRules(); for ($i = 0, $j = count($rules); $i < $j; $i++) { preg_match($this->rules[$rules[$i]], $this->input, $tempMatch); if ($tempMatch && (empty($match) || count($tempMatch[0]) > count($match[0]))) { $match = $tempMatch; $index = $i; if (isset($this->flex) && $this->flex == false) { break; } } } if ( $match ) { $matchCount = strlen($match[0]); $lineCount = preg_match("/(?:\r\n?|\n).*/", $match[0], $lines); $line = ($lines ? $lines[$lineCount - 1] : false); $this->yy->lineNo += $lineCount; $this->yy->loc = new ParserLocation( $this->yy->loc->lastLine, $this->yy->lineNo + 1, $this->yy->loc->lastColumn, ($line ? count($line) - preg_match("/\r?\n?/", $line, $na) : $this->yy->loc->lastColumn + $matchCount ) ); $this->yy->text .= $match[0]; $this->match .= $match[0]; $this->matches = $match; $this->matched .= $match[0]; $this->yy->leng = strlen($this->yy->text); if (isset($this->ranges)) { $this->yy->loc->range = new ParserRange($this->offset, $this->offset += $this->yy->leng); } $this->more = false; $this->input = substr($this->input, $matchCount, strlen($this->input)); $ruleIndex = $rules[$index]; $nextCondition = $this->conditionStack[$this->conditionStackCount - 1]; $token = $this->lexerPerformAction($ruleIndex, $nextCondition); if ($this->done == true && empty($this->input) == false) { $this->done = false; } if (empty($token) == false) { return $this->symbols[ $token ]; } else { return null; } } if (empty($this->input)) { return $this->eof; } else { $this->lexerError("Lexical error on line " . ($this->yy->lineNo + 1) . ". Unrecognized text.\n" . $this->showPosition(), new LexerError("", -1, $this->yy->lineNo)); return null; } } function lexerLex() { $r = $this->next(); while (is_null($r) && !$this->done) { $r = $this->next(); } return $r; } function begin($condition) { $this->conditionStackCount++; $this->conditionStack[] = $condition; } function popState() { $this->conditionStackCount--; return array_pop($this->conditionStack); } function currentRules() { $peek = $this->conditionStack[$this->conditionStackCount - 1]; return $this->conditions[$peek]->rules; } function LexerPerformAction($avoidingNameCollisions, $YY_START = null) { ; switch($avoidingNameCollisions) { case 0:/* skip whitespace */ break; case 1:return 4; break; case 2:return 14; break; case 3:return 16; break; case 4:return 15; break; case 5:return 12; break; case 6:return 11; break; case 7:return 13; break; case 8:/* skip EOF */ break; } } } class ParserLocation { public $firstLine = 1; public $lastLine = 0; public $firstColumn = 1; public $lastColumn = 0; public $range; public function __construct($firstLine = 1, $lastLine = 0, $firstColumn = 1, $lastColumn = 0) { $this->firstLine = $firstLine; $this->lastLine = $lastLine; $this->firstColumn = $firstColumn; $this->lastColumn = $lastColumn; } public function Range($range) { $this->range = $range; } public function __clone() { return new ParserLocation($this->firstLine, $this->lastLine, $this->firstColumn, $this->lastColumn); } } class ParserValue { public $leng = 0; public $loc; public $lineNo = 0; public $text; function __clone() { $clone = new ParserValue(); $clone->leng = $this->leng; if (isset($this->loc)) { $clone->loc = clone $this->loc; } $clone->lineNo = $this->lineNo; $clone->text = $this->text; return $clone; } } class LexerConditions { public $rules; public $inclusive; function __construct($rules, $inclusive) { $this->rules = $rules; $this->inclusive = $inclusive; } } class ParserProduction { public $len = 0; public $symbol; public function __construct($symbol, $len = 0) { $this->symbol = $symbol; $this->len = $len; } } class ParserCachedAction { public $action; public $symbol; function __construct($action, $symbol = null) { $this->action = $action; $this->symbol = $symbol; } } class ParserAction { public $action; public $state; public $symbol; function __construct($action, &$state = null, &$symbol = null) { $this->action = $action; $this->state = $state; $this->symbol = $symbol; } } class ParserSymbol { public $name; public $index = -1; public $symbols = array(); public $symbolsByName = array(); function __construct($name, $index) { $this->name = $name; $this->index = $index; } public function addAction($a) { $this->symbols[$a->index] = $this->symbolsByName[$a->name] = $a; } } class ParserError { public $text; public $state; public $symbol; public $lineNo; public $loc; public $expected; function __construct($text, $state, $symbol, $lineNo, $loc, $expected) { $this->text = $text; $this->state = $state; $this->symbol = $symbol; $this->lineNo = $lineNo; $this->loc = $loc; $this->expected = $expected; } } class LexerError { public $text; public $token; public $lineNo; public function __construct($text, $token, $lineNo) { $this->text = $text; $this->token = $token; $this->lineNo = $lineNo; } } class ParserState { public $index; public $actions = array(); function __construct($index) { $this->index = $index; } public function setActions(&$actions) { $this->actions = $actions; } } class ParserRange { public $x; public $y; function __construct($x, $y) { $this->x = $x; $this->y = $y; } } src/PageAccessor.php000064400000013530151742733500010414 0ustar00parameters = $params; $this->callable = $callable; $this->pageStreamingDescriptor = $pageStreamingDescriptor; $requestPageTokenField = $this->pageStreamingDescriptor->getRequestPageTokenField(); $this->initialToken = $params[0]->$requestPageTokenField; } /** * Returns the token that can be used to fetch the next page. */ public function nextPageToken() { $responsePageTokenField = $this->pageStreamingDescriptor->getResponsePageTokenField(); return $this->getResponse()->$responsePageTokenField; } /** * Returns the resources of the current page. */ public function currentPageValues() { $resourceField = $this->pageStreamingDescriptor->getResourceField(); return $this->getResponse()->$resourceField; } function rewind() { $request = $this->parameters[0]; $requestPageTokenField = $this->pageStreamingDescriptor->getRequestPageTokenField(); $request->$requestPageTokenField = $this->initialToken; $this->currentIterator = null; } function current() { return $this->getIterator()->current(); } function next() { $iterator = $this->getIterator(); if (isset($iterator)) { $this->getIterator()->next(); } } function valid() { $iterator = $this->getIterator(); return isset($iterator); } function key() { // Returns the request object as the key. return $this->parameters[0]; } /** * Returns the response object of current page. */ private function getResponse() { if (!isset($this->currentResponse)) { $this->currentResponse = call_user_func_array($this->callable, $this->parameters); } return $this->currentResponse; } /** * Returns a valid iterator of current page. If the current iterator is not valid, fetch next. */ private function getIterator() { if (!isset($this->currentIterator)) { $resourceField = $this->pageStreamingDescriptor->getResourceField(); $resources = new ArrayObject($this->getResponse()->$resourceField); $this->currentIterator = $resources->getIterator(); } else if (!$this->currentIterator->valid()) { $this->currentIterator = $this->nextIterator(); } return $this->currentIterator; } private function nextIterator() { $requestPageTokenField = $this->pageStreamingDescriptor->getRequestPageTokenField(); $nextPageToken = $this->nextPageToken(); if (isset($nextPageToken)) { $request = $this->parameters[0]; // Updates the current request to point to the next page. $request->$requestPageTokenField = $nextPageToken; $this->currentResponse = null; $resourceField = $this->pageStreamingDescriptor->getResourceField(); $resources = new ArrayObject($this->getResponse()->$resourceField); return $resources->getIterator(); } else { return null; } } } src/PageStreamingDescriptor.php000064400000006160151742733500012643 0ustar00requestPageTokenField = $descriptor['requestPageTokenField']; $this->responsePageTokenField = $descriptor['responsePageTokenField']; $this->resourceField = $descriptor['resourceField']; } public function getRequestPageTokenField() { return $this->requestPageTokenField; } public function getResponsePageTokenField() { return $this->responsePageTokenField; } public function getResourceField() { return $this->resourceField; } private static function validate($descriptor) { $requiredFields = ['requestPageTokenField', 'responsePageTokenField', 'resourceField']; foreach ($requiredFields as $field) { if (empty($descriptor[$field])) { throw new InvalidArgumentException( "$field is required for PageStreamingDescriptor"); } } } }src/PathTemplate.php000064400000020165151742733500010447 0ustar00segments = $parser->parse($data); $this->segmentCount = $parser->segmentCount; } public function __toString() { return self::format($this->segments); } public function count() { return $this->segmentCount; } /** * 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($bindings) { $out = []; $binding = false; foreach ($this->segments as $segment) { if ($segment->kind == Segment::BINDING) { if (!array_key_exists($segment->literal, $bindings)) { throw new ValidationException( sprintf( 'render error: value for key "%s" not '. 'provided', $segment->literal)); } $out = array_merge($out, (new self($bindings[$segment->literal]))->segments); $binding = true; } elseif ($segment->kind == Segment::END_BINDING) { $binding = false; } else { if ($binding) { continue; } array_push($out, $segment); } } $path = self::format($out); $this->match($path); return $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($path) { $segments = $this->segments; $pathList = explode('/', $path); $currentVar = null; $bindings = []; $segmentCount = $this->segmentCount; $pathIndex = 0; foreach ($segments as $segment) { if ($pathIndex >= count($pathList)) { break; } if ($segment->kind == Segment::TERMINAL) { $pathItem = $pathList[$pathIndex]; if ($segment->literal == '*') { $bindings[$currentVar] = $pathItem; $pathIndex += 1; } elseif ($segment->literal == '**') { $length = count($pathList) - $segmentCount + 1; $segmentCount += count($pathList) - $segmentCount; $bindings[$currentVar] = implode('/', array_slice($pathList, $pathIndex, $length)); $pathIndex += $length; } elseif ($segment->literal != $pathItem) { throw new ValidationException( sprintf( 'mismatched literal: "%s" != "%s"', $segment->literal, $pathItem)); } else { $pathIndex += 1; } } elseif ($segment->kind == Segment::BINDING) { $currentVar = $segment->literal; } } if (($pathIndex != count($pathList)) || ($pathIndex != $segmentCount)) { throw new ValidationException( sprintf( 'match error: could not render a path template '. 'from %s', $path)); } return $bindings; } private static function format($segments) { $template = ''; $slash = true; foreach ($segments as $segment) { if ($segment->kind == Segment::TERMINAL) { if ($slash) { $template .= '/'; } $template .= $segment->literal; } $slash = true; if ($segment->kind == Segment::BINDING) { $template .= sprintf('/{%s=', $segment->literal); $slash = false; } if ($segment->kind == Segment::END_BINDING) { $template .= sprintf('%s}', $segment->literal); } } // Remove leading '/' return substr($template, 1); } } class Parser { private $parser = null; public $segmentCount = 0; public $bindingVarCount = 0; public function __construct() { $this->parser = new JisonParser(); } /** * Returns an array of path template segments parsed from data. * * @param string $data A path template string * * @throws ValidationException when $data cannot be parsed * * @return array An array of Segment */ public function parse($data) { try { $GLOBALS['gax_path_template_segment_count'] = 0; $GLOBALS['gax_path_template_binding_count'] = 0; $segments = $this->parser->parse($data); $this->segmentCount = $GLOBALS['gax_path_template_segment_count']; $this->bindingVarCount = $GLOBALS['gax_path_template_binding_count']; // Validation step: checks that there are no nested bindings. $pathWildcard = false; foreach ($segments as $segment) { if ($segment->kind == Segment::TERMINAL && $segment->literal == '**') { if ($pathWildcard) { throw new ValidationException( 'validation error: path template cannot contain '. 'more than one path wildcard'); } $pathWildcard = true; } } return $segments; } catch (Exception $e) { throw new ValidationException('Exception in parser', 0, $e); } } } src/RetrySettings.php000064400000005577151742733500010717 0ustar00inherit = true; return $retrySettings; } /** * Construct an instance. */ public function __construct($retryableCodes, $backoffSettings) { $this->retryableCodes = $retryableCodes; $this->backoffSettings = $backoffSettings; $this->inherit = false; } public function getRetryableCodes() { return $this->retryableCodes; } public function getBackoffSettings() { return $this->backoffSettings; } public function shouldInherit() { return $this->inherit; } }src/Segment.php000064400000004457151742733500007467 0ustar00kind = $kind; $this->literal = $literal; $this['kind'] = $kind; $this['literal'] = $literal; } } src/Testing/MockRequest.php000064400000003445151742733500011740 0ustar00pageToken = $pageToken; return $request; } }src/Testing/MockResponse.php000064400000003605151742733500012104 0ustar00nextPageToken = $nextPageToken; $response->resource = $resource; return $response; } }src/Testing/MockStatus.php000064400000003372151742733500011572 0ustar00code = $code; $this->details = $details; } } src/Testing/MockStub.php000064400000006370151742733500011225 0ustar00= 1 private $responseSequence; public $actualCalls; private function __construct() { $this->actualCalls = []; } public function create($responseObject) { $stub = new MockStub(); $status = new MockStatus(\Grpc\STATUS_OK, ''); $stub->responseSequence = [[$responseObject, $status]]; return $stub; } /** * Creates a sequence such that the responses are returned in order, * and once there is only one left, it is repeated indefinitely. */ public static function createWithResponseSequence($sequence) { if (count($sequence) == 0) { throw new \InvalidArgumentException("createResponseSequence: need at least 1 response"); } $stub = new MockStub(); $stub->responseSequence = $sequence; return $stub; } public function takeAction($request, $metadata = array(), $options = array()) { $actualCall = [ 'request' => $request, 'metadata' => $metadata, 'options' => $options]; array_push($this->actualCalls, $actualCall); if (count($this->responseSequence) == 1) { return new MockGrpcCall($this->responseSequence[0]); } else { $response = array_shift($this->responseSequence); return new MockGrpcCall($response); } } } class MockGrpcCall { // this will be an array of [responseObject, status] private $response; public function __construct($response) { $this->response = $response; } public function wait() { return $this->response; } } src/generated/annotations.php000064400000001035151742733500012345 0ustar00number = 72295728; $f->name = "google\api\http"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\api\HttpRule'; return $f; }); }src/generated/any.php000064400000005001151742733500010574 0ustar00number = 1; $f->name = "type_url"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL BYTES value = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "value"; $f->type = \DrSlump\Protobuf::TYPE_BYTES; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasTypeUrl(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\Any */ public function clearTypeUrl(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getTypeUrl(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\Any */ public function setTypeUrl( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasValue(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\Any */ public function clearValue(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getValue(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\protobuf\Any */ public function setValue( $value){ return $this->_set(2, $value); } } } src/generated/api.php000064400000050523151742733500010567 0ustar00number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED MESSAGE methods = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "methods"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\Method'; $descriptor->addField($f); // REPEATED MESSAGE options = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "options"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\Option'; $descriptor->addField($f); // OPTIONAL STRING version = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "version"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL MESSAGE source_context = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "source_context"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\SourceContext'; $descriptor->addField($f); // REPEATED MESSAGE mixins = 6 $f = new \DrSlump\Protobuf\Field(); $f->number = 6; $f->name = "mixins"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\Mixin'; $descriptor->addField($f); // OPTIONAL ENUM syntax = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "syntax"; $f->type = \DrSlump\Protobuf::TYPE_ENUM; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\Syntax'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\Api */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\Api */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasMethods(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\Api */ public function clearMethods(){ return $this->_clear(2); } /** * Get value * * @param int $idx * @return \google\protobuf\Method */ public function getMethods($idx = NULL){ return $this->_get(2, $idx); } /** * Set value * * @param \google\protobuf\Method $value * @return \google\protobuf\Api */ public function setMethods(\google\protobuf\Method $value, $idx = NULL){ return $this->_set(2, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\Method[] */ public function getMethodsList(){ return $this->_get(2); } /** * Add a new element to * * @param \google\protobuf\Method $value * @return \google\protobuf\Api */ public function addMethods(\google\protobuf\Method $value){ return $this->_add(2, $value); } /** * Check if has a value * * @return boolean */ public function hasOptions(){ return $this->_has(3); } /** * Clear value * * @return \google\protobuf\Api */ public function clearOptions(){ return $this->_clear(3); } /** * Get value * * @param int $idx * @return \google\protobuf\Option */ public function getOptions($idx = NULL){ return $this->_get(3, $idx); } /** * Set value * * @param \google\protobuf\Option $value * @return \google\protobuf\Api */ public function setOptions(\google\protobuf\Option $value, $idx = NULL){ return $this->_set(3, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\Option[] */ public function getOptionsList(){ return $this->_get(3); } /** * Add a new element to * * @param \google\protobuf\Option $value * @return \google\protobuf\Api */ public function addOptions(\google\protobuf\Option $value){ return $this->_add(3, $value); } /** * Check if has a value * * @return boolean */ public function hasVersion(){ return $this->_has(4); } /** * Clear value * * @return \google\protobuf\Api */ public function clearVersion(){ return $this->_clear(4); } /** * Get value * * @return string */ public function getVersion(){ return $this->_get(4); } /** * Set value * * @param string $value * @return \google\protobuf\Api */ public function setVersion( $value){ return $this->_set(4, $value); } /** * Check if has a value * * @return boolean */ public function hasSourceContext(){ return $this->_has(5); } /** * Clear value * * @return \google\protobuf\Api */ public function clearSourceContext(){ return $this->_clear(5); } /** * Get value * * @return \google\protobuf\SourceContext */ public function getSourceContext(){ return $this->_get(5); } /** * Set value * * @param \google\protobuf\SourceContext $value * @return \google\protobuf\Api */ public function setSourceContext(\google\protobuf\SourceContext $value){ return $this->_set(5, $value); } /** * Check if has a value * * @return boolean */ public function hasMixins(){ return $this->_has(6); } /** * Clear value * * @return \google\protobuf\Api */ public function clearMixins(){ return $this->_clear(6); } /** * Get value * * @param int $idx * @return \google\protobuf\Mixin */ public function getMixins($idx = NULL){ return $this->_get(6, $idx); } /** * Set value * * @param \google\protobuf\Mixin $value * @return \google\protobuf\Api */ public function setMixins(\google\protobuf\Mixin $value, $idx = NULL){ return $this->_set(6, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\Mixin[] */ public function getMixinsList(){ return $this->_get(6); } /** * Add a new element to * * @param \google\protobuf\Mixin $value * @return \google\protobuf\Api */ public function addMixins(\google\protobuf\Mixin $value){ return $this->_add(6, $value); } /** * Check if has a value * * @return boolean */ public function hasSyntax(){ return $this->_has(7); } /** * Clear value * * @return \google\protobuf\Api */ public function clearSyntax(){ return $this->_clear(7); } /** * Get value * * @return int - \google\protobuf\Syntax */ public function getSyntax(){ return $this->_get(7); } /** * Set value * * @param int - \google\protobuf\Syntax $value * @return \google\protobuf\Api */ public function setSyntax( $value){ return $this->_set(7, $value); } } } namespace google\protobuf { class Method extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var string */ public $request_type_url = null; /** @var boolean */ public $request_streaming = null; /** @var string */ public $response_type_url = null; /** @var boolean */ public $response_streaming = null; /** @var \google\protobuf\Option[] */ public $options = array(); /** @var int - \google\protobuf\Syntax */ public $syntax = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.Method'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING request_type_url = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "request_type_url"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL BOOL request_streaming = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "request_streaming"; $f->type = \DrSlump\Protobuf::TYPE_BOOL; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING response_type_url = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "response_type_url"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL BOOL response_streaming = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "response_streaming"; $f->type = \DrSlump\Protobuf::TYPE_BOOL; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED MESSAGE options = 6 $f = new \DrSlump\Protobuf\Field(); $f->number = 6; $f->name = "options"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\Option'; $descriptor->addField($f); // OPTIONAL ENUM syntax = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "syntax"; $f->type = \DrSlump\Protobuf::TYPE_ENUM; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\Syntax'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\Method */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\Method */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasRequestTypeUrl(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\Method */ public function clearRequestTypeUrl(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getRequestTypeUrl(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\protobuf\Method */ public function setRequestTypeUrl( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasRequestStreaming(){ return $this->_has(3); } /** * Clear value * * @return \google\protobuf\Method */ public function clearRequestStreaming(){ return $this->_clear(3); } /** * Get value * * @return boolean */ public function getRequestStreaming(){ return $this->_get(3); } /** * Set value * * @param boolean $value * @return \google\protobuf\Method */ public function setRequestStreaming( $value){ return $this->_set(3, $value); } /** * Check if has a value * * @return boolean */ public function hasResponseTypeUrl(){ return $this->_has(4); } /** * Clear value * * @return \google\protobuf\Method */ public function clearResponseTypeUrl(){ return $this->_clear(4); } /** * Get value * * @return string */ public function getResponseTypeUrl(){ return $this->_get(4); } /** * Set value * * @param string $value * @return \google\protobuf\Method */ public function setResponseTypeUrl( $value){ return $this->_set(4, $value); } /** * Check if has a value * * @return boolean */ public function hasResponseStreaming(){ return $this->_has(5); } /** * Clear value * * @return \google\protobuf\Method */ public function clearResponseStreaming(){ return $this->_clear(5); } /** * Get value * * @return boolean */ public function getResponseStreaming(){ return $this->_get(5); } /** * Set value * * @param boolean $value * @return \google\protobuf\Method */ public function setResponseStreaming( $value){ return $this->_set(5, $value); } /** * Check if has a value * * @return boolean */ public function hasOptions(){ return $this->_has(6); } /** * Clear value * * @return \google\protobuf\Method */ public function clearOptions(){ return $this->_clear(6); } /** * Get value * * @param int $idx * @return \google\protobuf\Option */ public function getOptions($idx = NULL){ return $this->_get(6, $idx); } /** * Set value * * @param \google\protobuf\Option $value * @return \google\protobuf\Method */ public function setOptions(\google\protobuf\Option $value, $idx = NULL){ return $this->_set(6, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\Option[] */ public function getOptionsList(){ return $this->_get(6); } /** * Add a new element to * * @param \google\protobuf\Option $value * @return \google\protobuf\Method */ public function addOptions(\google\protobuf\Option $value){ return $this->_add(6, $value); } /** * Check if has a value * * @return boolean */ public function hasSyntax(){ return $this->_has(7); } /** * Clear value * * @return \google\protobuf\Method */ public function clearSyntax(){ return $this->_clear(7); } /** * Get value * * @return int - \google\protobuf\Syntax */ public function getSyntax(){ return $this->_get(7); } /** * Set value * * @param int - \google\protobuf\Syntax $value * @return \google\protobuf\Method */ public function setSyntax( $value){ return $this->_set(7, $value); } } } namespace google\protobuf { class Mixin extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var string */ public $root = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.Mixin'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING root = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "root"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\Mixin */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\Mixin */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasRoot(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\Mixin */ public function clearRoot(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getRoot(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\protobuf\Mixin */ public function setRoot( $value){ return $this->_set(2, $value); } } } src/generated/auth.php000064400000041302151742733500010752 0ustar00number = 3; $f->name = "rules"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\AuthenticationRule'; $descriptor->addField($f); // REPEATED MESSAGE providers = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "providers"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\AuthProvider'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasRules(){ return $this->_has(3); } /** * Clear value * * @return \google\api\Authentication */ public function clearRules(){ return $this->_clear(3); } /** * Get value * * @param int $idx * @return \google\api\AuthenticationRule */ public function getRules($idx = NULL){ return $this->_get(3, $idx); } /** * Set value * * @param \google\api\AuthenticationRule $value * @return \google\api\Authentication */ public function setRules(\google\api\AuthenticationRule $value, $idx = NULL){ return $this->_set(3, $value, $idx); } /** * Get all elements of * * @return \google\api\AuthenticationRule[] */ public function getRulesList(){ return $this->_get(3); } /** * Add a new element to * * @param \google\api\AuthenticationRule $value * @return \google\api\Authentication */ public function addRules(\google\api\AuthenticationRule $value){ return $this->_add(3, $value); } /** * Check if has a value * * @return boolean */ public function hasProviders(){ return $this->_has(4); } /** * Clear value * * @return \google\api\Authentication */ public function clearProviders(){ return $this->_clear(4); } /** * Get value * * @param int $idx * @return \google\api\AuthProvider */ public function getProviders($idx = NULL){ return $this->_get(4, $idx); } /** * Set value * * @param \google\api\AuthProvider $value * @return \google\api\Authentication */ public function setProviders(\google\api\AuthProvider $value, $idx = NULL){ return $this->_set(4, $value, $idx); } /** * Get all elements of * * @return \google\api\AuthProvider[] */ public function getProvidersList(){ return $this->_get(4); } /** * Add a new element to * * @param \google\api\AuthProvider $value * @return \google\api\Authentication */ public function addProviders(\google\api\AuthProvider $value){ return $this->_add(4, $value); } } } namespace google\api { class AuthenticationRule extends \DrSlump\Protobuf\Message { /** @var string */ public $selector = null; /** @var \google\api\OAuthRequirements */ public $oauth = null; /** @var boolean */ public $allow_without_credential = null; /** @var \google\api\AuthRequirement[] */ public $requirements = array(); /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.AuthenticationRule'); // OPTIONAL STRING selector = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "selector"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL MESSAGE oauth = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "oauth"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\api\OAuthRequirements'; $descriptor->addField($f); // OPTIONAL BOOL allow_without_credential = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "allow_without_credential"; $f->type = \DrSlump\Protobuf::TYPE_BOOL; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED MESSAGE requirements = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "requirements"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\AuthRequirement'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasSelector(){ return $this->_has(1); } /** * Clear value * * @return \google\api\AuthenticationRule */ public function clearSelector(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getSelector(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\AuthenticationRule */ public function setSelector( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasOauth(){ return $this->_has(2); } /** * Clear value * * @return \google\api\AuthenticationRule */ public function clearOauth(){ return $this->_clear(2); } /** * Get value * * @return \google\api\OAuthRequirements */ public function getOauth(){ return $this->_get(2); } /** * Set value * * @param \google\api\OAuthRequirements $value * @return \google\api\AuthenticationRule */ public function setOauth(\google\api\OAuthRequirements $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasAllowWithoutCredential(){ return $this->_has(5); } /** * Clear value * * @return \google\api\AuthenticationRule */ public function clearAllowWithoutCredential(){ return $this->_clear(5); } /** * Get value * * @return boolean */ public function getAllowWithoutCredential(){ return $this->_get(5); } /** * Set value * * @param boolean $value * @return \google\api\AuthenticationRule */ public function setAllowWithoutCredential( $value){ return $this->_set(5, $value); } /** * Check if has a value * * @return boolean */ public function hasRequirements(){ return $this->_has(7); } /** * Clear value * * @return \google\api\AuthenticationRule */ public function clearRequirements(){ return $this->_clear(7); } /** * Get value * * @param int $idx * @return \google\api\AuthRequirement */ public function getRequirements($idx = NULL){ return $this->_get(7, $idx); } /** * Set value * * @param \google\api\AuthRequirement $value * @return \google\api\AuthenticationRule */ public function setRequirements(\google\api\AuthRequirement $value, $idx = NULL){ return $this->_set(7, $value, $idx); } /** * Get all elements of * * @return \google\api\AuthRequirement[] */ public function getRequirementsList(){ return $this->_get(7); } /** * Add a new element to * * @param \google\api\AuthRequirement $value * @return \google\api\AuthenticationRule */ public function addRequirements(\google\api\AuthRequirement $value){ return $this->_add(7, $value); } } } namespace google\api { class AuthProvider extends \DrSlump\Protobuf\Message { /** @var string */ public $id = null; /** @var string */ public $issuer = null; /** @var string */ public $jwks_uri = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.AuthProvider'); // OPTIONAL STRING id = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "id"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING issuer = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "issuer"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING jwks_uri = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "jwks_uri"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasId(){ return $this->_has(1); } /** * Clear value * * @return \google\api\AuthProvider */ public function clearId(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getId(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\AuthProvider */ public function setId( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasIssuer(){ return $this->_has(2); } /** * Clear value * * @return \google\api\AuthProvider */ public function clearIssuer(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getIssuer(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\api\AuthProvider */ public function setIssuer( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasJwksUri(){ return $this->_has(3); } /** * Clear value * * @return \google\api\AuthProvider */ public function clearJwksUri(){ return $this->_clear(3); } /** * Get value * * @return string */ public function getJwksUri(){ return $this->_get(3); } /** * Set value * * @param string $value * @return \google\api\AuthProvider */ public function setJwksUri( $value){ return $this->_set(3, $value); } } } namespace google\api { class OAuthRequirements extends \DrSlump\Protobuf\Message { /** @var string */ public $canonical_scopes = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.OAuthRequirements'); // OPTIONAL STRING canonical_scopes = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "canonical_scopes"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasCanonicalScopes(){ return $this->_has(1); } /** * Clear value * * @return \google\api\OAuthRequirements */ public function clearCanonicalScopes(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getCanonicalScopes(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\OAuthRequirements */ public function setCanonicalScopes( $value){ return $this->_set(1, $value); } } } namespace google\api { class AuthRequirement extends \DrSlump\Protobuf\Message { /** @var string */ public $provider_id = null; /** @var string */ public $audiences = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.AuthRequirement'); // OPTIONAL STRING provider_id = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "provider_id"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING audiences = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "audiences"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasProviderId(){ return $this->_has(1); } /** * Clear value * * @return \google\api\AuthRequirement */ public function clearProviderId(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getProviderId(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\AuthRequirement */ public function setProviderId( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasAudiences(){ return $this->_has(2); } /** * Clear value * * @return \google\api\AuthRequirement */ public function clearAudiences(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getAudiences(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\api\AuthRequirement */ public function setAudiences( $value){ return $this->_set(2, $value); } } } src/generated/backend.php000064400000013021151742733500011375 0ustar00number = 1; $f->name = "rules"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\BackendRule'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasRules(){ return $this->_has(1); } /** * Clear value * * @return \google\api\Backend */ public function clearRules(){ return $this->_clear(1); } /** * Get value * * @param int $idx * @return \google\api\BackendRule */ public function getRules($idx = NULL){ return $this->_get(1, $idx); } /** * Set value * * @param \google\api\BackendRule $value * @return \google\api\Backend */ public function setRules(\google\api\BackendRule $value, $idx = NULL){ return $this->_set(1, $value, $idx); } /** * Get all elements of * * @return \google\api\BackendRule[] */ public function getRulesList(){ return $this->_get(1); } /** * Add a new element to * * @param \google\api\BackendRule $value * @return \google\api\Backend */ public function addRules(\google\api\BackendRule $value){ return $this->_add(1, $value); } } } namespace google\api { class BackendRule extends \DrSlump\Protobuf\Message { /** @var string */ public $selector = null; /** @var string */ public $address = null; /** @var float */ public $deadline = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.BackendRule'); // OPTIONAL STRING selector = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "selector"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING address = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "address"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL DOUBLE deadline = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "deadline"; $f->type = \DrSlump\Protobuf::TYPE_DOUBLE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasSelector(){ return $this->_has(1); } /** * Clear value * * @return \google\api\BackendRule */ public function clearSelector(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getSelector(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\BackendRule */ public function setSelector( $value){ return $this->_set(1, $value); } /** * Check if
has a value * * @return boolean */ public function hasAddress(){ return $this->_has(2); } /** * Clear
value * * @return \google\api\BackendRule */ public function clearAddress(){ return $this->_clear(2); } /** * Get
value * * @return string */ public function getAddress(){ return $this->_get(2); } /** * Set
value * * @param string $value * @return \google\api\BackendRule */ public function setAddress( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasDeadline(){ return $this->_has(3); } /** * Clear value * * @return \google\api\BackendRule */ public function clearDeadline(){ return $this->_clear(3); } /** * Get value * * @return float */ public function getDeadline(){ return $this->_get(3); } /** * Set value * * @param float $value * @return \google\api\BackendRule */ public function setDeadline( $value){ return $this->_set(3, $value); } } } src/generated/billing.php000064400000015114151742733500011433 0ustar00number = 1; $f->name = "metrics"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); // REPEATED MESSAGE rules = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "rules"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\BillingStatusRule'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasMetrics(){ return $this->_has(1); } /** * Clear value * * @return \google\api\Billing */ public function clearMetrics(){ return $this->_clear(1); } /** * Get value * * @param int $idx * @return string */ public function getMetrics($idx = NULL){ return $this->_get(1, $idx); } /** * Set value * * @param string $value * @return \google\api\Billing */ public function setMetrics( $value, $idx = NULL){ return $this->_set(1, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getMetricsList(){ return $this->_get(1); } /** * Add a new element to * * @param string $value * @return \google\api\Billing */ public function addMetrics( $value){ return $this->_add(1, $value); } /** * Check if has a value * * @return boolean */ public function hasRules(){ return $this->_has(5); } /** * Clear value * * @return \google\api\Billing */ public function clearRules(){ return $this->_clear(5); } /** * Get value * * @param int $idx * @return \google\api\BillingStatusRule */ public function getRules($idx = NULL){ return $this->_get(5, $idx); } /** * Set value * * @param \google\api\BillingStatusRule $value * @return \google\api\Billing */ public function setRules(\google\api\BillingStatusRule $value, $idx = NULL){ return $this->_set(5, $value, $idx); } /** * Get all elements of * * @return \google\api\BillingStatusRule[] */ public function getRulesList(){ return $this->_get(5); } /** * Add a new element to * * @param \google\api\BillingStatusRule $value * @return \google\api\Billing */ public function addRules(\google\api\BillingStatusRule $value){ return $this->_add(5, $value); } } } namespace google\api { class BillingStatusRule extends \DrSlump\Protobuf\Message { /** @var string */ public $selector = null; /** @var string[] */ public $allowed_statuses = array(); /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.BillingStatusRule'); // OPTIONAL STRING selector = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "selector"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED STRING allowed_statuses = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "allowed_statuses"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasSelector(){ return $this->_has(1); } /** * Clear value * * @return \google\api\BillingStatusRule */ public function clearSelector(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getSelector(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\BillingStatusRule */ public function setSelector( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasAllowedStatuses(){ return $this->_has(2); } /** * Clear value * * @return \google\api\BillingStatusRule */ public function clearAllowedStatuses(){ return $this->_clear(2); } /** * Get value * * @param int $idx * @return string */ public function getAllowedStatuses($idx = NULL){ return $this->_get(2, $idx); } /** * Set value * * @param string $value * @return \google\api\BillingStatusRule */ public function setAllowedStatuses( $value, $idx = NULL){ return $this->_set(2, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getAllowedStatusesList(){ return $this->_get(2); } /** * Add a new element to * * @param string $value * @return \google\api\BillingStatusRule */ public function addAllowedStatuses( $value){ return $this->_add(2, $value); } } } src/generated/code.php000064400000001261151742733500010723 0ustar00number = 1; $f->name = "red"; $f->type = \DrSlump\Protobuf::TYPE_FLOAT; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL FLOAT green = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "green"; $f->type = \DrSlump\Protobuf::TYPE_FLOAT; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL FLOAT blue = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "blue"; $f->type = \DrSlump\Protobuf::TYPE_FLOAT; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL MESSAGE alpha = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "alpha"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\FloatValue'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasRed(){ return $this->_has(1); } /** * Clear value * * @return \google\type\Color */ public function clearRed(){ return $this->_clear(1); } /** * Get value * * @return float */ public function getRed(){ return $this->_get(1); } /** * Set value * * @param float $value * @return \google\type\Color */ public function setRed( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasGreen(){ return $this->_has(2); } /** * Clear value * * @return \google\type\Color */ public function clearGreen(){ return $this->_clear(2); } /** * Get value * * @return float */ public function getGreen(){ return $this->_get(2); } /** * Set value * * @param float $value * @return \google\type\Color */ public function setGreen( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasBlue(){ return $this->_has(3); } /** * Clear value * * @return \google\type\Color */ public function clearBlue(){ return $this->_clear(3); } /** * Get value * * @return float */ public function getBlue(){ return $this->_get(3); } /** * Set value * * @param float $value * @return \google\type\Color */ public function setBlue( $value){ return $this->_set(3, $value); } /** * Check if has a value * * @return boolean */ public function hasAlpha(){ return $this->_has(4); } /** * Clear value * * @return \google\type\Color */ public function clearAlpha(){ return $this->_clear(4); } /** * Get value * * @return \google\protobuf\FloatValue */ public function getAlpha(){ return $this->_get(4); } /** * Set value * * @param \google\protobuf\FloatValue $value * @return \google\type\Color */ public function setAlpha(\google\protobuf\FloatValue $value){ return $this->_set(4, $value); } } } src/generated/consumer.php000064400000013635151742733500011654 0ustar00number = 1; $f->name = "properties"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\Property'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasProperties(){ return $this->_has(1); } /** * Clear value * * @return \google\api\ProjectProperties */ public function clearProperties(){ return $this->_clear(1); } /** * Get value * * @param int $idx * @return \google\api\Property */ public function getProperties($idx = NULL){ return $this->_get(1, $idx); } /** * Set value * * @param \google\api\Property $value * @return \google\api\ProjectProperties */ public function setProperties(\google\api\Property $value, $idx = NULL){ return $this->_set(1, $value, $idx); } /** * Get all elements of * * @return \google\api\Property[] */ public function getPropertiesList(){ return $this->_get(1); } /** * Add a new element to * * @param \google\api\Property $value * @return \google\api\ProjectProperties */ public function addProperties(\google\api\Property $value){ return $this->_add(1, $value); } } } namespace google\api\Property { class PropertyType extends \DrSlump\Protobuf\Enum { const UNSPECIFIED = 0; const INT64 = 1; const BOOL = 2; const STRING = 3; const DOUBLE = 4; } } namespace google\api { class Property extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var int - \google\api\Property\PropertyType */ public $type = null; /** @var string */ public $description = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.Property'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL ENUM type = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "type"; $f->type = \DrSlump\Protobuf::TYPE_ENUM; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\api\Property\PropertyType'; $descriptor->addField($f); // OPTIONAL STRING description = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "description"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\api\Property */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\Property */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasType(){ return $this->_has(2); } /** * Clear value * * @return \google\api\Property */ public function clearType(){ return $this->_clear(2); } /** * Get value * * @return int - \google\api\Property\PropertyType */ public function getType(){ return $this->_get(2); } /** * Set value * * @param int - \google\api\Property\PropertyType $value * @return \google\api\Property */ public function setType( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasDescription(){ return $this->_has(3); } /** * Clear value * * @return \google\api\Property */ public function clearDescription(){ return $this->_clear(3); } /** * Get value * * @return string */ public function getDescription(){ return $this->_get(3); } /** * Set value * * @param string $value * @return \google\api\Property */ public function setDescription( $value){ return $this->_set(3, $value); } } } src/generated/context.php000064400000014652151742733500011505 0ustar00number = 1; $f->name = "rules"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\api\ContextRule'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasRules(){ return $this->_has(1); } /** * Clear value * * @return \google\api\Context */ public function clearRules(){ return $this->_clear(1); } /** * Get value * * @param int $idx * @return \google\api\ContextRule */ public function getRules($idx = NULL){ return $this->_get(1, $idx); } /** * Set value * * @param \google\api\ContextRule $value * @return \google\api\Context */ public function setRules(\google\api\ContextRule $value, $idx = NULL){ return $this->_set(1, $value, $idx); } /** * Get all elements of * * @return \google\api\ContextRule[] */ public function getRulesList(){ return $this->_get(1); } /** * Add a new element to * * @param \google\api\ContextRule $value * @return \google\api\Context */ public function addRules(\google\api\ContextRule $value){ return $this->_add(1, $value); } } } namespace google\api { class ContextRule extends \DrSlump\Protobuf\Message { /** @var string */ public $selector = null; /** @var string[] */ public $requested = array(); /** @var string[] */ public $provided = array(); /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.api.ContextRule'); // OPTIONAL STRING selector = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "selector"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED STRING requested = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "requested"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); // REPEATED STRING provided = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "provided"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasSelector(){ return $this->_has(1); } /** * Clear value * * @return \google\api\ContextRule */ public function clearSelector(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getSelector(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\ContextRule */ public function setSelector( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasRequested(){ return $this->_has(2); } /** * Clear value * * @return \google\api\ContextRule */ public function clearRequested(){ return $this->_clear(2); } /** * Get value * * @param int $idx * @return string */ public function getRequested($idx = NULL){ return $this->_get(2, $idx); } /** * Set value * * @param string $value * @return \google\api\ContextRule */ public function setRequested( $value, $idx = NULL){ return $this->_set(2, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getRequestedList(){ return $this->_get(2); } /** * Add a new element to * * @param string $value * @return \google\api\ContextRule */ public function addRequested( $value){ return $this->_add(2, $value); } /** * Check if has a value * * @return boolean */ public function hasProvided(){ return $this->_has(3); } /** * Clear value * * @return \google\api\ContextRule */ public function clearProvided(){ return $this->_clear(3); } /** * Get value * * @param int $idx * @return string */ public function getProvided($idx = NULL){ return $this->_get(3, $idx); } /** * Set value * * @param string $value * @return \google\api\ContextRule */ public function setProvided( $value, $idx = NULL){ return $this->_set(3, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getProvidedList(){ return $this->_get(3); } /** * Add a new element to * * @param string $value * @return \google\api\ContextRule */ public function addProvided( $value){ return $this->_add(3, $value); } } } src/generated/control.php000064400000003106151742733500011471 0ustar00number = 1; $f->name = "environment"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasEnvironment(){ return $this->_has(1); } /** * Clear value * * @return \google\api\Control */ public function clearEnvironment(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getEnvironment(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\api\Control */ public function setEnvironment( $value){ return $this->_set(1, $value); } } } src/generated/date.php000064400000006546151742733500010741 0ustar00number = 1; $f->name = "year"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 month = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "month"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 day = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "day"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasYear(){ return $this->_has(1); } /** * Clear value * * @return \google\type\Date */ public function clearYear(){ return $this->_clear(1); } /** * Get value * * @return int */ public function getYear(){ return $this->_get(1); } /** * Set value * * @param int $value * @return \google\type\Date */ public function setYear( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasMonth(){ return $this->_has(2); } /** * Clear value * * @return \google\type\Date */ public function clearMonth(){ return $this->_clear(2); } /** * Get value * * @return int */ public function getMonth(){ return $this->_get(2); } /** * Set value * * @param int $value * @return \google\type\Date */ public function setMonth( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasDay(){ return $this->_has(3); } /** * Clear value * * @return \google\type\Date */ public function clearDay(){ return $this->_clear(3); } /** * Get value * * @return int */ public function getDay(){ return $this->_get(3); } /** * Set value * * @param int $value * @return \google\type\Date */ public function setDay( $value){ return $this->_set(3, $value); } } } src/generated/dayofweek.php000064400000000644151742733500011773 0ustar00number = 1; $f->name = "file"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\FileDescriptorProto'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasFile(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\FileDescriptorSet */ public function clearFile(){ return $this->_clear(1); } /** * Get value * * @param int $idx * @return \google\protobuf\FileDescriptorProto */ public function getFile($idx = NULL){ return $this->_get(1, $idx); } /** * Set value * * @param \google\protobuf\FileDescriptorProto $value * @return \google\protobuf\FileDescriptorSet */ public function setFile(\google\protobuf\FileDescriptorProto $value, $idx = NULL){ return $this->_set(1, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\FileDescriptorProto[] */ public function getFileList(){ return $this->_get(1); } /** * Add a new element to * * @param \google\protobuf\FileDescriptorProto $value * @return \google\protobuf\FileDescriptorSet */ public function addFile(\google\protobuf\FileDescriptorProto $value){ return $this->_add(1, $value); } } } namespace google\protobuf { class FileDescriptorProto extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var string */ public $package = null; /** @var string[] */ public $dependency = array(); /** @var int[] */ public $public_dependency = array(); /** @var int[] */ public $weak_dependency = array(); /** @var \google\protobuf\DescriptorProto[] */ public $message_type = array(); /** @var \google\protobuf\EnumDescriptorProto[] */ public $enum_type = array(); /** @var \google\protobuf\ServiceDescriptorProto[] */ public $service = array(); /** @var \google\protobuf\FieldDescriptorProto[] */ public $extension = array(); /** @var \google\protobuf\FileOptions */ public $options = null; /** @var \google\protobuf\SourceCodeInfo */ public $source_code_info = null; /** @var string */ public $syntax = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.FileDescriptorProto'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING package = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "package"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED STRING dependency = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "dependency"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); // REPEATED INT32 public_dependency = 10 $f = new \DrSlump\Protobuf\Field(); $f->number = 10; $f->name = "public_dependency"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); // REPEATED INT32 weak_dependency = 11 $f = new \DrSlump\Protobuf\Field(); $f->number = 11; $f->name = "weak_dependency"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); // REPEATED MESSAGE message_type = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "message_type"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\DescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE enum_type = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "enum_type"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\EnumDescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE service = 6 $f = new \DrSlump\Protobuf\Field(); $f->number = 6; $f->name = "service"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\ServiceDescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE extension = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "extension"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\FieldDescriptorProto'; $descriptor->addField($f); // OPTIONAL MESSAGE options = 8 $f = new \DrSlump\Protobuf\Field(); $f->number = 8; $f->name = "options"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\FileOptions'; $descriptor->addField($f); // OPTIONAL MESSAGE source_code_info = 9 $f = new \DrSlump\Protobuf\Field(); $f->number = 9; $f->name = "source_code_info"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\SourceCodeInfo'; $descriptor->addField($f); // OPTIONAL STRING syntax = 12 $f = new \DrSlump\Protobuf\Field(); $f->number = 12; $f->name = "syntax"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\FileDescriptorProto */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasPackage(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearPackage(){ return $this->_clear(2); } /** * Get value * * @return string */ public function getPackage(){ return $this->_get(2); } /** * Set value * * @param string $value * @return \google\protobuf\FileDescriptorProto */ public function setPackage( $value){ return $this->_set(2, $value); } /** * Check if has a value * * @return boolean */ public function hasDependency(){ return $this->_has(3); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearDependency(){ return $this->_clear(3); } /** * Get value * * @param int $idx * @return string */ public function getDependency($idx = NULL){ return $this->_get(3, $idx); } /** * Set value * * @param string $value * @return \google\protobuf\FileDescriptorProto */ public function setDependency( $value, $idx = NULL){ return $this->_set(3, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getDependencyList(){ return $this->_get(3); } /** * Add a new element to * * @param string $value * @return \google\protobuf\FileDescriptorProto */ public function addDependency( $value){ return $this->_add(3, $value); } /** * Check if has a value * * @return boolean */ public function hasPublicDependency(){ return $this->_has(10); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearPublicDependency(){ return $this->_clear(10); } /** * Get value * * @param int $idx * @return int */ public function getPublicDependency($idx = NULL){ return $this->_get(10, $idx); } /** * Set value * * @param int $value * @return \google\protobuf\FileDescriptorProto */ public function setPublicDependency( $value, $idx = NULL){ return $this->_set(10, $value, $idx); } /** * Get all elements of * * @return int[] */ public function getPublicDependencyList(){ return $this->_get(10); } /** * Add a new element to * * @param int $value * @return \google\protobuf\FileDescriptorProto */ public function addPublicDependency( $value){ return $this->_add(10, $value); } /** * Check if has a value * * @return boolean */ public function hasWeakDependency(){ return $this->_has(11); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearWeakDependency(){ return $this->_clear(11); } /** * Get value * * @param int $idx * @return int */ public function getWeakDependency($idx = NULL){ return $this->_get(11, $idx); } /** * Set value * * @param int $value * @return \google\protobuf\FileDescriptorProto */ public function setWeakDependency( $value, $idx = NULL){ return $this->_set(11, $value, $idx); } /** * Get all elements of * * @return int[] */ public function getWeakDependencyList(){ return $this->_get(11); } /** * Add a new element to * * @param int $value * @return \google\protobuf\FileDescriptorProto */ public function addWeakDependency( $value){ return $this->_add(11, $value); } /** * Check if has a value * * @return boolean */ public function hasMessageType(){ return $this->_has(4); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearMessageType(){ return $this->_clear(4); } /** * Get value * * @param int $idx * @return \google\protobuf\DescriptorProto */ public function getMessageType($idx = NULL){ return $this->_get(4, $idx); } /** * Set value * * @param \google\protobuf\DescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function setMessageType(\google\protobuf\DescriptorProto $value, $idx = NULL){ return $this->_set(4, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\DescriptorProto[] */ public function getMessageTypeList(){ return $this->_get(4); } /** * Add a new element to * * @param \google\protobuf\DescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function addMessageType(\google\protobuf\DescriptorProto $value){ return $this->_add(4, $value); } /** * Check if has a value * * @return boolean */ public function hasEnumType(){ return $this->_has(5); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearEnumType(){ return $this->_clear(5); } /** * Get value * * @param int $idx * @return \google\protobuf\EnumDescriptorProto */ public function getEnumType($idx = NULL){ return $this->_get(5, $idx); } /** * Set value * * @param \google\protobuf\EnumDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function setEnumType(\google\protobuf\EnumDescriptorProto $value, $idx = NULL){ return $this->_set(5, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\EnumDescriptorProto[] */ public function getEnumTypeList(){ return $this->_get(5); } /** * Add a new element to * * @param \google\protobuf\EnumDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function addEnumType(\google\protobuf\EnumDescriptorProto $value){ return $this->_add(5, $value); } /** * Check if has a value * * @return boolean */ public function hasService(){ return $this->_has(6); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearService(){ return $this->_clear(6); } /** * Get value * * @param int $idx * @return \google\protobuf\ServiceDescriptorProto */ public function getService($idx = NULL){ return $this->_get(6, $idx); } /** * Set value * * @param \google\protobuf\ServiceDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function setService(\google\protobuf\ServiceDescriptorProto $value, $idx = NULL){ return $this->_set(6, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\ServiceDescriptorProto[] */ public function getServiceList(){ return $this->_get(6); } /** * Add a new element to * * @param \google\protobuf\ServiceDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function addService(\google\protobuf\ServiceDescriptorProto $value){ return $this->_add(6, $value); } /** * Check if has a value * * @return boolean */ public function hasExtension(){ return $this->_has(7); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearExtension(){ return $this->_clear(7); } /** * Get value * * @param int $idx * @return \google\protobuf\FieldDescriptorProto */ public function getExtension($idx = NULL){ return $this->_get(7, $idx); } /** * Set value * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function setExtension(\google\protobuf\FieldDescriptorProto $value, $idx = NULL){ return $this->_set(7, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\FieldDescriptorProto[] */ public function getExtensionList(){ return $this->_get(7); } /** * Add a new element to * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\FileDescriptorProto */ public function addExtension(\google\protobuf\FieldDescriptorProto $value){ return $this->_add(7, $value); } /** * Check if has a value * * @return boolean */ public function hasOptions(){ return $this->_has(8); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearOptions(){ return $this->_clear(8); } /** * Get value * * @return \google\protobuf\FileOptions */ public function getOptions(){ return $this->_get(8); } /** * Set value * * @param \google\protobuf\FileOptions $value * @return \google\protobuf\FileDescriptorProto */ public function setOptions(\google\protobuf\FileOptions $value){ return $this->_set(8, $value); } /** * Check if has a value * * @return boolean */ public function hasSourceCodeInfo(){ return $this->_has(9); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearSourceCodeInfo(){ return $this->_clear(9); } /** * Get value * * @return \google\protobuf\SourceCodeInfo */ public function getSourceCodeInfo(){ return $this->_get(9); } /** * Set value * * @param \google\protobuf\SourceCodeInfo $value * @return \google\protobuf\FileDescriptorProto */ public function setSourceCodeInfo(\google\protobuf\SourceCodeInfo $value){ return $this->_set(9, $value); } /** * Check if has a value * * @return boolean */ public function hasSyntax(){ return $this->_has(12); } /** * Clear value * * @return \google\protobuf\FileDescriptorProto */ public function clearSyntax(){ return $this->_clear(12); } /** * Get value * * @return string */ public function getSyntax(){ return $this->_get(12); } /** * Set value * * @param string $value * @return \google\protobuf\FileDescriptorProto */ public function setSyntax( $value){ return $this->_set(12, $value); } } } namespace google\protobuf\DescriptorProto { class ExtensionRange extends \DrSlump\Protobuf\Message { /** @var int */ public $start = null; /** @var int */ public $end = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.DescriptorProto.ExtensionRange'); // OPTIONAL INT32 start = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "start"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 end = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "end"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasStart(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\DescriptorProto\ExtensionRange */ public function clearStart(){ return $this->_clear(1); } /** * Get value * * @return int */ public function getStart(){ return $this->_get(1); } /** * Set value * * @param int $value * @return \google\protobuf\DescriptorProto\ExtensionRange */ public function setStart( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasEnd(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\DescriptorProto\ExtensionRange */ public function clearEnd(){ return $this->_clear(2); } /** * Get value * * @return int */ public function getEnd(){ return $this->_get(2); } /** * Set value * * @param int $value * @return \google\protobuf\DescriptorProto\ExtensionRange */ public function setEnd( $value){ return $this->_set(2, $value); } } } namespace google\protobuf\DescriptorProto { class ReservedRange extends \DrSlump\Protobuf\Message { /** @var int */ public $start = null; /** @var int */ public $end = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.DescriptorProto.ReservedRange'); // OPTIONAL INT32 start = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "start"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 end = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "end"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasStart(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\DescriptorProto\ReservedRange */ public function clearStart(){ return $this->_clear(1); } /** * Get value * * @return int */ public function getStart(){ return $this->_get(1); } /** * Set value * * @param int $value * @return \google\protobuf\DescriptorProto\ReservedRange */ public function setStart( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasEnd(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\DescriptorProto\ReservedRange */ public function clearEnd(){ return $this->_clear(2); } /** * Get value * * @return int */ public function getEnd(){ return $this->_get(2); } /** * Set value * * @param int $value * @return \google\protobuf\DescriptorProto\ReservedRange */ public function setEnd( $value){ return $this->_set(2, $value); } } } namespace google\protobuf { class DescriptorProto extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var \google\protobuf\FieldDescriptorProto[] */ public $field = array(); /** @var \google\protobuf\FieldDescriptorProto[] */ public $extension = array(); /** @var \google\protobuf\DescriptorProto[] */ public $nested_type = array(); /** @var \google\protobuf\EnumDescriptorProto[] */ public $enum_type = array(); /** @var \google\protobuf\DescriptorProto\ExtensionRange[] */ public $extension_range = array(); /** @var \google\protobuf\OneofDescriptorProto[] */ public $oneof_decl = array(); /** @var \google\protobuf\MessageOptions */ public $options = null; /** @var \google\protobuf\DescriptorProto\ReservedRange[] */ public $reserved_range = array(); /** @var string[] */ public $reserved_name = array(); /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.DescriptorProto'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // REPEATED MESSAGE field = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "field"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\FieldDescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE extension = 6 $f = new \DrSlump\Protobuf\Field(); $f->number = 6; $f->name = "extension"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\FieldDescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE nested_type = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "nested_type"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\DescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE enum_type = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "enum_type"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\EnumDescriptorProto'; $descriptor->addField($f); // REPEATED MESSAGE extension_range = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "extension_range"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\DescriptorProto\ExtensionRange'; $descriptor->addField($f); // REPEATED MESSAGE oneof_decl = 8 $f = new \DrSlump\Protobuf\Field(); $f->number = 8; $f->name = "oneof_decl"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\OneofDescriptorProto'; $descriptor->addField($f); // OPTIONAL MESSAGE options = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "options"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\MessageOptions'; $descriptor->addField($f); // REPEATED MESSAGE reserved_range = 9 $f = new \DrSlump\Protobuf\Field(); $f->number = 9; $f->name = "reserved_range"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $f->reference = '\google\protobuf\DescriptorProto\ReservedRange'; $descriptor->addField($f); // REPEATED STRING reserved_name = 10 $f = new \DrSlump\Protobuf\Field(); $f->number = 10; $f->name = "reserved_name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_REPEATED; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\DescriptorProto */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasField(){ return $this->_has(2); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearField(){ return $this->_clear(2); } /** * Get value * * @param int $idx * @return \google\protobuf\FieldDescriptorProto */ public function getField($idx = NULL){ return $this->_get(2, $idx); } /** * Set value * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function setField(\google\protobuf\FieldDescriptorProto $value, $idx = NULL){ return $this->_set(2, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\FieldDescriptorProto[] */ public function getFieldList(){ return $this->_get(2); } /** * Add a new element to * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function addField(\google\protobuf\FieldDescriptorProto $value){ return $this->_add(2, $value); } /** * Check if has a value * * @return boolean */ public function hasExtension(){ return $this->_has(6); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearExtension(){ return $this->_clear(6); } /** * Get value * * @param int $idx * @return \google\protobuf\FieldDescriptorProto */ public function getExtension($idx = NULL){ return $this->_get(6, $idx); } /** * Set value * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function setExtension(\google\protobuf\FieldDescriptorProto $value, $idx = NULL){ return $this->_set(6, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\FieldDescriptorProto[] */ public function getExtensionList(){ return $this->_get(6); } /** * Add a new element to * * @param \google\protobuf\FieldDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function addExtension(\google\protobuf\FieldDescriptorProto $value){ return $this->_add(6, $value); } /** * Check if has a value * * @return boolean */ public function hasNestedType(){ return $this->_has(3); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearNestedType(){ return $this->_clear(3); } /** * Get value * * @param int $idx * @return \google\protobuf\DescriptorProto */ public function getNestedType($idx = NULL){ return $this->_get(3, $idx); } /** * Set value * * @param \google\protobuf\DescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function setNestedType(\google\protobuf\DescriptorProto $value, $idx = NULL){ return $this->_set(3, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\DescriptorProto[] */ public function getNestedTypeList(){ return $this->_get(3); } /** * Add a new element to * * @param \google\protobuf\DescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function addNestedType(\google\protobuf\DescriptorProto $value){ return $this->_add(3, $value); } /** * Check if has a value * * @return boolean */ public function hasEnumType(){ return $this->_has(4); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearEnumType(){ return $this->_clear(4); } /** * Get value * * @param int $idx * @return \google\protobuf\EnumDescriptorProto */ public function getEnumType($idx = NULL){ return $this->_get(4, $idx); } /** * Set value * * @param \google\protobuf\EnumDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function setEnumType(\google\protobuf\EnumDescriptorProto $value, $idx = NULL){ return $this->_set(4, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\EnumDescriptorProto[] */ public function getEnumTypeList(){ return $this->_get(4); } /** * Add a new element to * * @param \google\protobuf\EnumDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function addEnumType(\google\protobuf\EnumDescriptorProto $value){ return $this->_add(4, $value); } /** * Check if has a value * * @return boolean */ public function hasExtensionRange(){ return $this->_has(5); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearExtensionRange(){ return $this->_clear(5); } /** * Get value * * @param int $idx * @return \google\protobuf\DescriptorProto\ExtensionRange */ public function getExtensionRange($idx = NULL){ return $this->_get(5, $idx); } /** * Set value * * @param \google\protobuf\DescriptorProto\ExtensionRange $value * @return \google\protobuf\DescriptorProto */ public function setExtensionRange(\google\protobuf\DescriptorProto\ExtensionRange $value, $idx = NULL){ return $this->_set(5, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\DescriptorProto\ExtensionRange[] */ public function getExtensionRangeList(){ return $this->_get(5); } /** * Add a new element to * * @param \google\protobuf\DescriptorProto\ExtensionRange $value * @return \google\protobuf\DescriptorProto */ public function addExtensionRange(\google\protobuf\DescriptorProto\ExtensionRange $value){ return $this->_add(5, $value); } /** * Check if has a value * * @return boolean */ public function hasOneofDecl(){ return $this->_has(8); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearOneofDecl(){ return $this->_clear(8); } /** * Get value * * @param int $idx * @return \google\protobuf\OneofDescriptorProto */ public function getOneofDecl($idx = NULL){ return $this->_get(8, $idx); } /** * Set value * * @param \google\protobuf\OneofDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function setOneofDecl(\google\protobuf\OneofDescriptorProto $value, $idx = NULL){ return $this->_set(8, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\OneofDescriptorProto[] */ public function getOneofDeclList(){ return $this->_get(8); } /** * Add a new element to * * @param \google\protobuf\OneofDescriptorProto $value * @return \google\protobuf\DescriptorProto */ public function addOneofDecl(\google\protobuf\OneofDescriptorProto $value){ return $this->_add(8, $value); } /** * Check if has a value * * @return boolean */ public function hasOptions(){ return $this->_has(7); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearOptions(){ return $this->_clear(7); } /** * Get value * * @return \google\protobuf\MessageOptions */ public function getOptions(){ return $this->_get(7); } /** * Set value * * @param \google\protobuf\MessageOptions $value * @return \google\protobuf\DescriptorProto */ public function setOptions(\google\protobuf\MessageOptions $value){ return $this->_set(7, $value); } /** * Check if has a value * * @return boolean */ public function hasReservedRange(){ return $this->_has(9); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearReservedRange(){ return $this->_clear(9); } /** * Get value * * @param int $idx * @return \google\protobuf\DescriptorProto\ReservedRange */ public function getReservedRange($idx = NULL){ return $this->_get(9, $idx); } /** * Set value * * @param \google\protobuf\DescriptorProto\ReservedRange $value * @return \google\protobuf\DescriptorProto */ public function setReservedRange(\google\protobuf\DescriptorProto\ReservedRange $value, $idx = NULL){ return $this->_set(9, $value, $idx); } /** * Get all elements of * * @return \google\protobuf\DescriptorProto\ReservedRange[] */ public function getReservedRangeList(){ return $this->_get(9); } /** * Add a new element to * * @param \google\protobuf\DescriptorProto\ReservedRange $value * @return \google\protobuf\DescriptorProto */ public function addReservedRange(\google\protobuf\DescriptorProto\ReservedRange $value){ return $this->_add(9, $value); } /** * Check if has a value * * @return boolean */ public function hasReservedName(){ return $this->_has(10); } /** * Clear value * * @return \google\protobuf\DescriptorProto */ public function clearReservedName(){ return $this->_clear(10); } /** * Get value * * @param int $idx * @return string */ public function getReservedName($idx = NULL){ return $this->_get(10, $idx); } /** * Set value * * @param string $value * @return \google\protobuf\DescriptorProto */ public function setReservedName( $value, $idx = NULL){ return $this->_set(10, $value, $idx); } /** * Get all elements of * * @return string[] */ public function getReservedNameList(){ return $this->_get(10); } /** * Add a new element to * * @param string $value * @return \google\protobuf\DescriptorProto */ public function addReservedName( $value){ return $this->_add(10, $value); } } } namespace google\protobuf\FieldDescriptorProto { class Type extends \DrSlump\Protobuf\Enum { const TYPE_DOUBLE = 1; const TYPE_FLOAT = 2; const TYPE_INT64 = 3; const TYPE_UINT64 = 4; const TYPE_INT32 = 5; const TYPE_FIXED64 = 6; const TYPE_FIXED32 = 7; const TYPE_BOOL = 8; const TYPE_STRING = 9; const TYPE_GROUP = 10; const TYPE_MESSAGE = 11; const TYPE_BYTES = 12; const TYPE_UINT32 = 13; const TYPE_ENUM = 14; const TYPE_SFIXED32 = 15; const TYPE_SFIXED64 = 16; const TYPE_SINT32 = 17; const TYPE_SINT64 = 18; } } namespace google\protobuf\FieldDescriptorProto { class Label extends \DrSlump\Protobuf\Enum { const LABEL_OPTIONAL = 1; const LABEL_REQUIRED = 2; const LABEL_REPEATED = 3; } } namespace google\protobuf { class FieldDescriptorProto extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; /** @var int */ public $number = null; /** @var int - \google\protobuf\FieldDescriptorProto\Label */ public $label = null; /** @var int - \google\protobuf\FieldDescriptorProto\Type */ public $type = null; /** @var string */ public $type_name = null; /** @var string */ public $extendee = null; /** @var string */ public $default_value = null; /** @var int */ public $oneof_index = null; /** @var string */ public $json_name = null; /** @var \google\protobuf\FieldOptions */ public $options = null; /** @var \Closure[] */ protected static $__extensions = array(); public static function descriptor() { $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'google.protobuf.FieldDescriptorProto'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); $f->number = 1; $f->name = "name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 number = 3 $f = new \DrSlump\Protobuf\Field(); $f->number = 3; $f->name = "number"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL ENUM label = 4 $f = new \DrSlump\Protobuf\Field(); $f->number = 4; $f->name = "label"; $f->type = \DrSlump\Protobuf::TYPE_ENUM; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\FieldDescriptorProto\Label'; $descriptor->addField($f); // OPTIONAL ENUM type = 5 $f = new \DrSlump\Protobuf\Field(); $f->number = 5; $f->name = "type"; $f->type = \DrSlump\Protobuf::TYPE_ENUM; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\FieldDescriptorProto\Type'; $descriptor->addField($f); // OPTIONAL STRING type_name = 6 $f = new \DrSlump\Protobuf\Field(); $f->number = 6; $f->name = "type_name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING extendee = 2 $f = new \DrSlump\Protobuf\Field(); $f->number = 2; $f->name = "extendee"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING default_value = 7 $f = new \DrSlump\Protobuf\Field(); $f->number = 7; $f->name = "default_value"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL INT32 oneof_index = 9 $f = new \DrSlump\Protobuf\Field(); $f->number = 9; $f->name = "oneof_index"; $f->type = \DrSlump\Protobuf::TYPE_INT32; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL STRING json_name = 10 $f = new \DrSlump\Protobuf\Field(); $f->number = 10; $f->name = "json_name"; $f->type = \DrSlump\Protobuf::TYPE_STRING; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $descriptor->addField($f); // OPTIONAL MESSAGE options = 8 $f = new \DrSlump\Protobuf\Field(); $f->number = 8; $f->name = "options"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\google\protobuf\FieldOptions'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { $descriptor->addField($cb(), true); } return $descriptor; } /** * Check if has a value * * @return boolean */ public function hasName(){ return $this->_has(1); } /** * Clear value * * @return \google\protobuf\FieldDescriptorProto */ public function clearName(){ return $this->_clear(1); } /** * Get value * * @return string */ public function getName(){ return $this->_get(1); } /** * Set value * * @param string $value * @return \google\protobuf\FieldDescriptorProto */ public function setName( $value){ return $this->_set(1, $value); } /** * Check if has a value * * @return boolean */ public function hasNumber(){ return $this->_has(3); } /** * Clear value * * @return \google\protobuf\FieldDescriptorProto */ public function clearNumber(){ return $this->_clear(3); } /** * Get value * * @return int */ public function getNumber(){ return $this->_get(3); } /** * Set value * * @param int $value * @return \google\protobuf\FieldDescriptorProto */ public function setNumber( $value){ return $this->_set(3, $value); } /** * Check if