• 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 * A block of data, to simply increase gRPC message size.
13 *
14 * Generated from protobuf message <code>grpc.testing.Payload</code>
15 */
16class Payload extends \Google\Protobuf\Internal\Message
17{
18    /**
19     * The type of data in body.
20     *
21     * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
22     */
23    protected $type = 0;
24    /**
25     * Primary contents of payload.
26     *
27     * Generated from protobuf field <code>bytes body = 2;</code>
28     */
29    protected $body = '';
30
31    /**
32     * Constructor.
33     *
34     * @param array $data {
35     *     Optional. Data for populating the Message object.
36     *
37     *     @type int $type
38     *           The type of data in body.
39     *     @type string $body
40     *           Primary contents of payload.
41     * }
42     */
43    public function __construct($data = NULL) {
44        \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
45        parent::__construct($data);
46    }
47
48    /**
49     * The type of data in body.
50     *
51     * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
52     * @return int
53     */
54    public function getType()
55    {
56        return $this->type;
57    }
58
59    /**
60     * The type of data in body.
61     *
62     * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
63     * @param int $var
64     * @return $this
65     */
66    public function setType($var)
67    {
68        GPBUtil::checkEnum($var, \Grpc\Testing\PayloadType::class);
69        $this->type = $var;
70
71        return $this;
72    }
73
74    /**
75     * Primary contents of payload.
76     *
77     * Generated from protobuf field <code>bytes body = 2;</code>
78     * @return string
79     */
80    public function getBody()
81    {
82        return $this->body;
83    }
84
85    /**
86     * Primary contents of payload.
87     *
88     * Generated from protobuf field <code>bytes body = 2;</code>
89     * @param string $var
90     * @return $this
91     */
92    public function setBody($var)
93    {
94        GPBUtil::checkString($var, False);
95        $this->body = $var;
96
97        return $this;
98    }
99
100}
101
102