blob: 697f52aa65307187fe3008ef03ac60b21a6c641c [file] [log] [blame]
Stanley Cheungf8401a72015-05-29 15:09:04 -07001<?php
2// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
3// Source: helloworld.proto
Stanley Cheungd2dd37b2015-09-24 15:27:58 -07004// Date: 2015-09-24 20:40:14
Stanley Cheungf8401a72015-05-29 15:09:04 -07005
6namespace helloworld {
7
Stanley Cheung46d94bb2016-05-19 16:47:52 -07008 class HelloRequest extends \DrSlump\Protobuf\Message
9 {
10 /** @var string */
Stanley Cheungf8401a72015-05-29 15:09:04 -070011 public $name = null;
Stanley Cheungf8401a72015-05-29 15:09:04 -070012
13 /** @var \Closure[] */
14 protected static $__extensions = array();
15
Stanley Cheung46d94bb2016-05-19 16:47:52 -070016 public static function descriptor()
17 {
18 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'helloworld.HelloRequest');
Stanley Cheungf8401a72015-05-29 15:09:04 -070019
20 // OPTIONAL STRING name = 1
21 $f = new \DrSlump\Protobuf\Field();
Stanley Cheung46d94bb2016-05-19 16:47:52 -070022 $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 Cheungf8401a72015-05-29 15:09:04 -070027
Stanley Cheung46d94bb2016-05-19 16:47:52 -070028 foreach (self::$__extensions as $cb) {
29 $descriptor->addField($cb(), true);
30 }
31
32 return $descriptor;
Stanley Cheungf8401a72015-05-29 15:09:04 -070033 }
34
Stanley Cheung46d94bb2016-05-19 16:47:52 -070035 /**
36 * Check if <name> has a value.
37 *
38 * @return bool
39 */
40 public function hasName()
41 {
42 return $this->_has(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -070043 }
44
45 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -070046 * Clear <name> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -070047 *
48 * @return \helloworld\HelloRequest
49 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -070050 public function clearName()
51 {
52 return $this->_clear(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -070053 }
Stanley Cheung46d94bb2016-05-19 16:47:52 -070054
Stanley Cheungf8401a72015-05-29 15:09:04 -070055 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -070056 * Get <name> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -070057 *
58 * @return string
59 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -070060 public function getName()
61 {
62 return $this->_get(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -070063 }
Stanley Cheung46d94bb2016-05-19 16:47:52 -070064
Stanley Cheungf8401a72015-05-29 15:09:04 -070065 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -070066 * Set <name> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -070067 *
68 * @param string $value
Stanley Cheung46d94bb2016-05-19 16:47:52 -070069 *
Stanley Cheungf8401a72015-05-29 15:09:04 -070070 * @return \helloworld\HelloRequest
71 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -070072 public function setName($value)
73 {
74 return $this->_set(1, $value);
Stanley Cheungf8401a72015-05-29 15:09:04 -070075 }
76 }
77}
78
79namespace helloworld {
80
Stanley Cheung46d94bb2016-05-19 16:47:52 -070081 class HelloReply extends \DrSlump\Protobuf\Message
82 {
83 /** @var string */
Stanley Cheungf8401a72015-05-29 15:09:04 -070084 public $message = null;
Stanley Cheungf8401a72015-05-29 15:09:04 -070085
86 /** @var \Closure[] */
87 protected static $__extensions = array();
88
Stanley Cheung46d94bb2016-05-19 16:47:52 -070089 public static function descriptor()
90 {
91 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'helloworld.HelloReply');
Stanley Cheungf8401a72015-05-29 15:09:04 -070092
93 // OPTIONAL STRING message = 1
94 $f = new \DrSlump\Protobuf\Field();
Stanley Cheung46d94bb2016-05-19 16:47:52 -070095 $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 Cheungf8401a72015-05-29 15:09:04 -0700100
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700101 foreach (self::$__extensions as $cb) {
102 $descriptor->addField($cb(), true);
103 }
104
105 return $descriptor;
Stanley Cheungf8401a72015-05-29 15:09:04 -0700106 }
107
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700108 /**
109 * Check if <message> has a value.
110 *
111 * @return bool
112 */
113 public function hasMessage()
114 {
115 return $this->_has(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -0700116 }
117
118 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700119 * Clear <message> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -0700120 *
121 * @return \helloworld\HelloReply
122 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700123 public function clearMessage()
124 {
125 return $this->_clear(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -0700126 }
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700127
Stanley Cheungf8401a72015-05-29 15:09:04 -0700128 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700129 * Get <message> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -0700130 *
131 * @return string
132 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700133 public function getMessage()
134 {
135 return $this->_get(1);
Stanley Cheungf8401a72015-05-29 15:09:04 -0700136 }
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700137
Stanley Cheungf8401a72015-05-29 15:09:04 -0700138 /**
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700139 * Set <message> value.
Stanley Cheungf8401a72015-05-29 15:09:04 -0700140 *
141 * @param string $value
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700142 *
Stanley Cheungf8401a72015-05-29 15:09:04 -0700143 * @return \helloworld\HelloReply
144 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700145 public function setMessage($value)
146 {
147 return $this->_set(1, $value);
Stanley Cheungf8401a72015-05-29 15:09:04 -0700148 }
149 }
150}
151
152namespace helloworld {
153
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700154 class GreeterClient extends \Grpc\BaseStub
155 {
156 public function __construct($hostname, $opts)
157 {
158 parent::__construct($hostname, $opts);
159 }
Stanley Cheungf8401a72015-05-29 15:09:04 -0700160 /**
161 * @param helloworld\HelloRequest $input
162 */
Stanley Cheung46d94bb2016-05-19 16:47:52 -0700163 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 Cheungf8401a72015-05-29 15:09:04 -0700166 }
167 }
168}