Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 1 | <?php |
| 2 | // DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 |
| 3 | // Source: helloworld.proto |
Stanley Cheung | d2dd37b | 2015-09-24 15:27:58 -0700 | [diff] [blame] | 4 | // Date: 2015-09-24 20:40:14 |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 5 | |
| 6 | namespace helloworld { |
| 7 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 8 | class HelloRequest extends \DrSlump\Protobuf\Message |
| 9 | { |
| 10 | /** @var string */ |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 11 | public $name = null; |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 12 | |
| 13 | /** @var \Closure[] */ |
| 14 | protected static $__extensions = array(); |
| 15 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 16 | public static function descriptor() |
| 17 | { |
| 18 | $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'helloworld.HelloRequest'); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 19 | |
| 20 | // OPTIONAL STRING name = 1 |
| 21 | $f = new \DrSlump\Protobuf\Field(); |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 22 | $f->number = 1; |
| 23 | $f->name = 'name'; |
| 24 | $f->type = \DrSlump\Protobuf::TYPE_STRING; |
| 25 | $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; |
| 26 | $descriptor->addField($f); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 27 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 28 | foreach (self::$__extensions as $cb) { |
| 29 | $descriptor->addField($cb(), true); |
| 30 | } |
| 31 | |
| 32 | return $descriptor; |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 33 | } |
| 34 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 35 | /** |
| 36 | * Check if <name> has a value. |
| 37 | * |
| 38 | * @return bool |
| 39 | */ |
| 40 | public function hasName() |
| 41 | { |
| 42 | return $this->_has(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 46 | * Clear <name> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 47 | * |
| 48 | * @return \helloworld\HelloRequest |
| 49 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 50 | public function clearName() |
| 51 | { |
| 52 | return $this->_clear(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 53 | } |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 54 | |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 55 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 56 | * Get <name> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 57 | * |
| 58 | * @return string |
| 59 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 60 | public function getName() |
| 61 | { |
| 62 | return $this->_get(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 63 | } |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 64 | |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 65 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 66 | * Set <name> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 67 | * |
| 68 | * @param string $value |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 69 | * |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 70 | * @return \helloworld\HelloRequest |
| 71 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 72 | public function setName($value) |
| 73 | { |
| 74 | return $this->_set(1, $value); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | namespace helloworld { |
| 80 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 81 | class HelloReply extends \DrSlump\Protobuf\Message |
| 82 | { |
| 83 | /** @var string */ |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 84 | public $message = null; |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 85 | |
| 86 | /** @var \Closure[] */ |
| 87 | protected static $__extensions = array(); |
| 88 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 89 | public static function descriptor() |
| 90 | { |
| 91 | $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'helloworld.HelloReply'); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 92 | |
| 93 | // OPTIONAL STRING message = 1 |
| 94 | $f = new \DrSlump\Protobuf\Field(); |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 95 | $f->number = 1; |
| 96 | $f->name = 'message'; |
| 97 | $f->type = \DrSlump\Protobuf::TYPE_STRING; |
| 98 | $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; |
| 99 | $descriptor->addField($f); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 100 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 101 | foreach (self::$__extensions as $cb) { |
| 102 | $descriptor->addField($cb(), true); |
| 103 | } |
| 104 | |
| 105 | return $descriptor; |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 108 | /** |
| 109 | * Check if <message> has a value. |
| 110 | * |
| 111 | * @return bool |
| 112 | */ |
| 113 | public function hasMessage() |
| 114 | { |
| 115 | return $this->_has(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 119 | * Clear <message> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 120 | * |
| 121 | * @return \helloworld\HelloReply |
| 122 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 123 | public function clearMessage() |
| 124 | { |
| 125 | return $this->_clear(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 126 | } |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 127 | |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 128 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 129 | * Get <message> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 130 | * |
| 131 | * @return string |
| 132 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 133 | public function getMessage() |
| 134 | { |
| 135 | return $this->_get(1); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 136 | } |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 137 | |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 138 | /** |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 139 | * Set <message> value. |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 140 | * |
| 141 | * @param string $value |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 142 | * |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 143 | * @return \helloworld\HelloReply |
| 144 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 145 | public function setMessage($value) |
| 146 | { |
| 147 | return $this->_set(1, $value); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | namespace helloworld { |
| 153 | |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 154 | class GreeterClient extends \Grpc\BaseStub |
| 155 | { |
| 156 | public function __construct($hostname, $opts) |
| 157 | { |
| 158 | parent::__construct($hostname, $opts); |
| 159 | } |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 160 | /** |
| 161 | * @param helloworld\HelloRequest $input |
| 162 | */ |
Stanley Cheung | 46d94bb | 2016-05-19 16:47:52 -0700 | [diff] [blame] | 163 | public function SayHello(\helloworld\HelloRequest $argument, $metadata = array(), $options = array()) |
| 164 | { |
| 165 | return $this->_simpleRequest('/helloworld.Greeter/SayHello', $argument, '\helloworld\HelloReply::deserialize', $metadata, $options); |
Stanley Cheung | f8401a7 | 2015-05-29 15:09:04 -0700 | [diff] [blame] | 166 | } |
| 167 | } |
| 168 | } |