• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: src/proto/grpc/testing/messages.proto
4
5namespace Grpc\Testing;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * Unary request.
13 *
14 * Generated from protobuf message <code>grpc.testing.SimpleRequest</code>
15 */
16class SimpleRequest extends \Google\Protobuf\Internal\Message
17{
18    /**
19     * Desired payload type in the response from the server.
20     * If response_type is RANDOM, server randomly chooses one from other formats.
21     *
22     * Generated from protobuf field <code>.grpc.testing.PayloadType response_type = 1;</code>
23     */
24    protected $response_type = 0;
25    /**
26     * Desired payload size in the response from the server.
27     *
28     * Generated from protobuf field <code>int32 response_size = 2;</code>
29     */
30    protected $response_size = 0;
31    /**
32     * Optional input payload sent along with the request.
33     *
34     * Generated from protobuf field <code>.grpc.testing.Payload payload = 3;</code>
35     */
36    protected $payload = null;
37    /**
38     * Whether SimpleResponse should include username.
39     *
40     * Generated from protobuf field <code>bool fill_username = 4;</code>
41     */
42    protected $fill_username = false;
43    /**
44     * Whether SimpleResponse should include OAuth scope.
45     *
46     * Generated from protobuf field <code>bool fill_oauth_scope = 5;</code>
47     */
48    protected $fill_oauth_scope = false;
49    /**
50     * Whether to request the server to compress the response. This field is
51     * "nullable" in order to interoperate seamlessly with clients not able to
52     * implement the full compression tests by introspecting the call to verify
53     * the response's compression status.
54     *
55     * Generated from protobuf field <code>.grpc.testing.BoolValue response_compressed = 6;</code>
56     */
57    protected $response_compressed = null;
58    /**
59     * Whether server should return a given status
60     *
61     * Generated from protobuf field <code>.grpc.testing.EchoStatus response_status = 7;</code>
62     */
63    protected $response_status = null;
64    /**
65     * Whether the server should expect this request to be compressed.
66     *
67     * Generated from protobuf field <code>.grpc.testing.BoolValue expect_compressed = 8;</code>
68     */
69    protected $expect_compressed = null;
70    /**
71     * Whether SimpleResponse should include server_id.
72     *
73     * Generated from protobuf field <code>bool fill_server_id = 9;</code>
74     */
75    protected $fill_server_id = false;
76    /**
77     * Whether SimpleResponse should include grpclb_route_type.
78     *
79     * Generated from protobuf field <code>bool fill_grpclb_route_type = 10;</code>
80     */
81    protected $fill_grpclb_route_type = false;
82
83    /**
84     * Constructor.
85     *
86     * @param array $data {
87     *     Optional. Data for populating the Message object.
88     *
89     *     @type int $response_type
90     *           Desired payload type in the response from the server.
91     *           If response_type is RANDOM, server randomly chooses one from other formats.
92     *     @type int $response_size
93     *           Desired payload size in the response from the server.
94     *     @type \Grpc\Testing\Payload $payload
95     *           Optional input payload sent along with the request.
96     *     @type bool $fill_username
97     *           Whether SimpleResponse should include username.
98     *     @type bool $fill_oauth_scope
99     *           Whether SimpleResponse should include OAuth scope.
100     *     @type \Grpc\Testing\BoolValue $response_compressed
101     *           Whether to request the server to compress the response. This field is
102     *           "nullable" in order to interoperate seamlessly with clients not able to
103     *           implement the full compression tests by introspecting the call to verify
104     *           the response's compression status.
105     *     @type \Grpc\Testing\EchoStatus $response_status
106     *           Whether server should return a given status
107     *     @type \Grpc\Testing\BoolValue $expect_compressed
108     *           Whether the server should expect this request to be compressed.
109     *     @type bool $fill_server_id
110     *           Whether SimpleResponse should include server_id.
111     *     @type bool $fill_grpclb_route_type
112     *           Whether SimpleResponse should include grpclb_route_type.
113     * }
114     */
115    public function __construct($data = NULL) {
116        \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
117        parent::__construct($data);
118    }
119
120    /**
121     * Desired payload type in the response from the server.
122     * If response_type is RANDOM, server randomly chooses one from other formats.
123     *
124     * Generated from protobuf field <code>.grpc.testing.PayloadType response_type = 1;</code>
125     * @return int
126     */
127    public function getResponseType()
128    {
129        return $this->response_type;
130    }
131
132    /**
133     * Desired payload type in the response from the server.
134     * If response_type is RANDOM, server randomly chooses one from other formats.
135     *
136     * Generated from protobuf field <code>.grpc.testing.PayloadType response_type = 1;</code>
137     * @param int $var
138     * @return $this
139     */
140    public function setResponseType($var)
141    {
142        GPBUtil::checkEnum($var, \Grpc\Testing\PayloadType::class);
143        $this->response_type = $var;
144
145        return $this;
146    }
147
148    /**
149     * Desired payload size in the response from the server.
150     *
151     * Generated from protobuf field <code>int32 response_size = 2;</code>
152     * @return int
153     */
154    public function getResponseSize()
155    {
156        return $this->response_size;
157    }
158
159    /**
160     * Desired payload size in the response from the server.
161     *
162     * Generated from protobuf field <code>int32 response_size = 2;</code>
163     * @param int $var
164     * @return $this
165     */
166    public function setResponseSize($var)
167    {
168        GPBUtil::checkInt32($var);
169        $this->response_size = $var;
170
171        return $this;
172    }
173
174    /**
175     * Optional input payload sent along with the request.
176     *
177     * Generated from protobuf field <code>.grpc.testing.Payload payload = 3;</code>
178     * @return \Grpc\Testing\Payload
179     */
180    public function getPayload()
181    {
182        return isset($this->payload) ? $this->payload : null;
183    }
184
185    public function hasPayload()
186    {
187        return isset($this->payload);
188    }
189
190    public function clearPayload()
191    {
192        unset($this->payload);
193    }
194
195    /**
196     * Optional input payload sent along with the request.
197     *
198     * Generated from protobuf field <code>.grpc.testing.Payload payload = 3;</code>
199     * @param \Grpc\Testing\Payload $var
200     * @return $this
201     */
202    public function setPayload($var)
203    {
204        GPBUtil::checkMessage($var, \Grpc\Testing\Payload::class);
205        $this->payload = $var;
206
207        return $this;
208    }
209
210    /**
211     * Whether SimpleResponse should include username.
212     *
213     * Generated from protobuf field <code>bool fill_username = 4;</code>
214     * @return bool
215     */
216    public function getFillUsername()
217    {
218        return $this->fill_username;
219    }
220
221    /**
222     * Whether SimpleResponse should include username.
223     *
224     * Generated from protobuf field <code>bool fill_username = 4;</code>
225     * @param bool $var
226     * @return $this
227     */
228    public function setFillUsername($var)
229    {
230        GPBUtil::checkBool($var);
231        $this->fill_username = $var;
232
233        return $this;
234    }
235
236    /**
237     * Whether SimpleResponse should include OAuth scope.
238     *
239     * Generated from protobuf field <code>bool fill_oauth_scope = 5;</code>
240     * @return bool
241     */
242    public function getFillOauthScope()
243    {
244        return $this->fill_oauth_scope;
245    }
246
247    /**
248     * Whether SimpleResponse should include OAuth scope.
249     *
250     * Generated from protobuf field <code>bool fill_oauth_scope = 5;</code>
251     * @param bool $var
252     * @return $this
253     */
254    public function setFillOauthScope($var)
255    {
256        GPBUtil::checkBool($var);
257        $this->fill_oauth_scope = $var;
258
259        return $this;
260    }
261
262    /**
263     * Whether to request the server to compress the response. This field is
264     * "nullable" in order to interoperate seamlessly with clients not able to
265     * implement the full compression tests by introspecting the call to verify
266     * the response's compression status.
267     *
268     * Generated from protobuf field <code>.grpc.testing.BoolValue response_compressed = 6;</code>
269     * @return \Grpc\Testing\BoolValue
270     */
271    public function getResponseCompressed()
272    {
273        return isset($this->response_compressed) ? $this->response_compressed : null;
274    }
275
276    public function hasResponseCompressed()
277    {
278        return isset($this->response_compressed);
279    }
280
281    public function clearResponseCompressed()
282    {
283        unset($this->response_compressed);
284    }
285
286    /**
287     * Whether to request the server to compress the response. This field is
288     * "nullable" in order to interoperate seamlessly with clients not able to
289     * implement the full compression tests by introspecting the call to verify
290     * the response's compression status.
291     *
292     * Generated from protobuf field <code>.grpc.testing.BoolValue response_compressed = 6;</code>
293     * @param \Grpc\Testing\BoolValue $var
294     * @return $this
295     */
296    public function setResponseCompressed($var)
297    {
298        GPBUtil::checkMessage($var, \Grpc\Testing\BoolValue::class);
299        $this->response_compressed = $var;
300
301        return $this;
302    }
303
304    /**
305     * Whether server should return a given status
306     *
307     * Generated from protobuf field <code>.grpc.testing.EchoStatus response_status = 7;</code>
308     * @return \Grpc\Testing\EchoStatus
309     */
310    public function getResponseStatus()
311    {
312        return isset($this->response_status) ? $this->response_status : null;
313    }
314
315    public function hasResponseStatus()
316    {
317        return isset($this->response_status);
318    }
319
320    public function clearResponseStatus()
321    {
322        unset($this->response_status);
323    }
324
325    /**
326     * Whether server should return a given status
327     *
328     * Generated from protobuf field <code>.grpc.testing.EchoStatus response_status = 7;</code>
329     * @param \Grpc\Testing\EchoStatus $var
330     * @return $this
331     */
332    public function setResponseStatus($var)
333    {
334        GPBUtil::checkMessage($var, \Grpc\Testing\EchoStatus::class);
335        $this->response_status = $var;
336
337        return $this;
338    }
339
340    /**
341     * Whether the server should expect this request to be compressed.
342     *
343     * Generated from protobuf field <code>.grpc.testing.BoolValue expect_compressed = 8;</code>
344     * @return \Grpc\Testing\BoolValue
345     */
346    public function getExpectCompressed()
347    {
348        return isset($this->expect_compressed) ? $this->expect_compressed : null;
349    }
350
351    public function hasExpectCompressed()
352    {
353        return isset($this->expect_compressed);
354    }
355
356    public function clearExpectCompressed()
357    {
358        unset($this->expect_compressed);
359    }
360
361    /**
362     * Whether the server should expect this request to be compressed.
363     *
364     * Generated from protobuf field <code>.grpc.testing.BoolValue expect_compressed = 8;</code>
365     * @param \Grpc\Testing\BoolValue $var
366     * @return $this
367     */
368    public function setExpectCompressed($var)
369    {
370        GPBUtil::checkMessage($var, \Grpc\Testing\BoolValue::class);
371        $this->expect_compressed = $var;
372
373        return $this;
374    }
375
376    /**
377     * Whether SimpleResponse should include server_id.
378     *
379     * Generated from protobuf field <code>bool fill_server_id = 9;</code>
380     * @return bool
381     */
382    public function getFillServerId()
383    {
384        return $this->fill_server_id;
385    }
386
387    /**
388     * Whether SimpleResponse should include server_id.
389     *
390     * Generated from protobuf field <code>bool fill_server_id = 9;</code>
391     * @param bool $var
392     * @return $this
393     */
394    public function setFillServerId($var)
395    {
396        GPBUtil::checkBool($var);
397        $this->fill_server_id = $var;
398
399        return $this;
400    }
401
402    /**
403     * Whether SimpleResponse should include grpclb_route_type.
404     *
405     * Generated from protobuf field <code>bool fill_grpclb_route_type = 10;</code>
406     * @return bool
407     */
408    public function getFillGrpclbRouteType()
409    {
410        return $this->fill_grpclb_route_type;
411    }
412
413    /**
414     * Whether SimpleResponse should include grpclb_route_type.
415     *
416     * Generated from protobuf field <code>bool fill_grpclb_route_type = 10;</code>
417     * @param bool $var
418     * @return $this
419     */
420    public function setFillGrpclbRouteType($var)
421    {
422        GPBUtil::checkBool($var);
423        $this->fill_grpclb_route_type = $var;
424
425        return $this;
426    }
427
428}
429
430