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