Debian Codegraph @

src/php/tests/interop/Grpc/Testing/SimpleResponse.php

raw
1 <?php
2 # Generated by the protocol buffer compiler. DO NOT EDIT!
3 # source: src/proto/grpc/testing/messages.proto
4
5 namespace Grpc\Testing;
6
7 use Google\Protobuf\Internal\GPBType;
8 use Google\Protobuf\Internal\RepeatedField;
9 use Google\Protobuf\Internal\GPBUtil;
10
11 /**
12 * Unary response, as configured by the request.
13 *
14 * Generated from protobuf message <code>grpc.testing.SimpleResponse</code>
15 */
16 class SimpleResponse extends \Google\Protobuf\Internal\Message
17 {
18 /**
19 * Payload to increase message size.
20 *
21 * Generated from protobuf field <code>.grpc.testing.Payload payload = 1;</code>
22 */
23 protected $payload = null;
24 /**
25 * The user the request came from, for verifying authentication was
26 * successful when the client expected it.
27 *
28 * Generated from protobuf field <code>string username = 2;</code>
29 */
30 protected $username = '';
31 /**
32 * OAuth scope.
33 *
34 * Generated from protobuf field <code>string oauth_scope = 3;</code>
35 */
36 protected $oauth_scope = '';
37 /**
38 * Server ID. This must be unique among different server instances,
39 * but the same across all RPC's made to a particular server instance.
40 *
41 * Generated from protobuf field <code>string server_id = 4;</code>
42 */
43 protected $server_id = '';
44 /**
45 * gRPCLB Path.
46 *
47 * Generated from protobuf field <code>.grpc.testing.GrpclbRouteType grpclb_route_type = 5;</code>
48 */
49 protected $grpclb_route_type = 0;
50 /**
51 * Server hostname.
52 *
53 * Generated from protobuf field <code>string hostname = 6;</code>
54 */
55 protected $hostname = '';
56
57 /**
58 * Constructor.
59 *
60 * @param array $data {
61 * Optional. Data for populating the Message object.
62 *
63 * @type \Grpc\Testing\Payload $payload
64 * Payload to increase message size.
65 * @type string $username
66 * The user the request came from, for verifying authentication was
67 * successful when the client expected it.
68 * @type string $oauth_scope
69 * OAuth scope.
70 * @type string $server_id
71 * Server ID. This must be unique among different server instances,
72 * but the same across all RPC's made to a particular server instance.
73 * @type int $grpclb_route_type
74 * gRPCLB Path.
75 * @type string $hostname
76 * Server hostname.
77 * }
78 */
79 public function __construct($data = NULL) {
80 \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
81 parent::__construct($data);
82 }
83
84 /**
85 * Payload to increase message size.
86 *
87 * Generated from protobuf field <code>.grpc.testing.Payload payload = 1;</code>
88 * @return \Grpc\Testing\Payload|null
89 */
90 public function getPayload()
91 {
92 return $this->payload;
93 }
94
95 public function hasPayload()
96 {
97 return isset($this->payload);
98 }
99
100 public function clearPayload()
101 {
102 unset($this->payload);
103 }
104
105 /**
106 * Payload to increase message size.
107 *
108 * Generated from protobuf field <code>.grpc.testing.Payload payload = 1;</code>
109 * @param \Grpc\Testing\Payload $var
110 * @return $this
111 */
112 public function setPayload($var)
113 {
114 GPBUtil::checkMessage($var, \Grpc\Testing\Payload::class);
115 $this->payload = $var;
116
117 return $this;
118 }
119
120 /**
121 * The user the request came from, for verifying authentication was
122 * successful when the client expected it.
123 *
124 * Generated from protobuf field <code>string username = 2;</code>
125 * @return string
126 */
127 public function getUsername()
128 {
129 return $this->username;
130 }
131
132 /**
133 * The user the request came from, for verifying authentication was
134 * successful when the client expected it.
135 *
136 * Generated from protobuf field <code>string username = 2;</code>
137 * @param string $var
138 * @return $this
139 */
140 public function setUsername($var)
141 {
142 GPBUtil::checkString($var, True);
143 $this->username = $var;
144
145 return $this;
146 }
147
148 /**
149 * OAuth scope.
150 *
151 * Generated from protobuf field <code>string oauth_scope = 3;</code>
152 * @return string
153 */
154 public function getOauthScope()
155 {
156 return $this->oauth_scope;
157 }
158
159 /**
160 * OAuth scope.
161 *
162 * Generated from protobuf field <code>string oauth_scope = 3;</code>
163 * @param string $var
164 * @return $this
165 */
166 public function setOauthScope($var)
167 {
168 GPBUtil::checkString($var, True);
169 $this->oauth_scope = $var;
170
171 return $this;
172 }
173
174 /**
175 * Server ID. This must be unique among different server instances,
176 * but the same across all RPC's made to a particular server instance.
177 *
178 * Generated from protobuf field <code>string server_id = 4;</code>
179 * @return string
180 */
181 public function getServerId()
182 {
183 return $this->server_id;
184 }
185
186 /**
187 * Server ID. This must be unique among different server instances,
188 * but the same across all RPC's made to a particular server instance.
189 *
190 * Generated from protobuf field <code>string server_id = 4;</code>
191 * @param string $var
192 * @return $this
193 */
194 public function setServerId($var)
195 {
196 GPBUtil::checkString($var, True);
197 $this->server_id = $var;
198
199 return $this;
200 }
201
202 /**
203 * gRPCLB Path.
204 *
205 * Generated from protobuf field <code>.grpc.testing.GrpclbRouteType grpclb_route_type = 5;</code>
206 * @return int
207 */
208 public function getGrpclbRouteType()
209 {
210 return $this->grpclb_route_type;
211 }
212
213 /**
214 * gRPCLB Path.
215 *
216 * Generated from protobuf field <code>.grpc.testing.GrpclbRouteType grpclb_route_type = 5;</code>
217 * @param int $var
218 * @return $this
219 */
220 public function setGrpclbRouteType($var)
221 {
222 GPBUtil::checkEnum($var, \Grpc\Testing\GrpclbRouteType::class);
223 $this->grpclb_route_type = $var;
224
225 return $this;
226 }
227
228 /**
229 * Server hostname.
230 *
231 * Generated from protobuf field <code>string hostname = 6;</code>
232 * @return string
233 */
234 public function getHostname()
235 {
236 return $this->hostname;
237 }
238
239 /**
240 * Server hostname.
241 *
242 * Generated from protobuf field <code>string hostname = 6;</code>
243 * @param string $var
244 * @return $this
245 */
246 public function setHostname($var)
247 {
248 GPBUtil::checkString($var, True);
249 $this->hostname = $var;
250
251 return $this;
252 }
253
254 }
255